From 1fe470bcaac9e3a95a185b8476f66ec61b3cb26f Mon Sep 17 00:00:00 2001 From: maowenbo Date: Thu, 23 Nov 2023 17:58:40 +0800 Subject: [PATCH] feat: support multi version feat: multi version release --- README.md | 2 +- larksuite-oapi/pom.xml | 2 +- .../src/main/java/com/lark/oapi/Client.java | 567 +- .../com/lark/oapi/event/EventDispatcher.java | 131 +- .../com/lark/oapi/service/acs/AcsService.java | 76 + .../lark/oapi/service/acs/v1/AcsService.java | 720 -- .../java/com/lark/oapi/service/acs/v1/V1.java | 53 + .../v1/enums/AccessRecordAccessTypeEnum.java | 4 +- .../v1/enums/PropertyOnlineStatusEnum.java | 32 + .../v1/enums/UserExternalUserTypeEnum.java | 34 + .../oapi/service/acs/v1/model/Device.java | 37 + .../service/acs/v1/model/DeviceExternal.java | 111 + .../acs/v1/model/OpeningTimeExternal.java | 148 + .../v1/model/OpeningTimePeriodExternal.java | 111 + .../v1/model/OpeningTimeValidDayExternal.java | 111 + .../oapi/service/acs/v1/model/Property.java | 271 + .../lark/oapi/service/acs/v1/model/Rule.java | 370 + .../service/acs/v1/model/UserExternal.java | 197 + .../service/acs/v1/resource/AccessRecord.java | 105 + .../v1/resource/AccessRecordAccessPhoto.java | 127 + .../oapi/service/acs/v1/resource/Device.java | 102 + .../oapi/service/acs/v1/resource/User.java | 240 + .../service/acs/v1/resource/UserFace.java | 197 + .../lark/oapi/service/admin/AdminService.java | 71 + .../oapi/service/admin/v1/AdminService.java | 1014 --- .../com/lark/oapi/service/admin/v1/V1.java | 65 + .../enums/ListAuditInfoOperatorTypeEnum.java | 32 + .../v1/enums/ListAuditInfoUserIdTypeEnum.java | 33 + .../admin/v1/model/ListAuditInfoReq.java | 368 + .../admin/v1/model/ListAuditInfoResp.java | 19 + .../admin/v1/model/ListAuditInfoRespBody.java | 62 + .../admin/v1/resource/AdminDeptStat.java | 107 + .../admin/v1/resource/AdminUserStat.java | 107 + .../service/admin/v1/resource/AuditInfo.java | 105 + .../oapi/service/admin/v1/resource/Badge.java | 302 + .../service/admin/v1/resource/BadgeGrant.java | 368 + .../service/admin/v1/resource/BadgeImage.java | 107 + .../service/admin/v1/resource/Password.java | 105 + .../application/ApplicationService.java | 177 + .../application/v6/ApplicationService.java | 1417 ---- .../lark/oapi/service/application/v6/V6.java | 77 + .../application/v6/resource/AppBadge.java | 105 + .../v6/resource/AppRecommendRule.java | 105 + .../application/v6/resource/Application.java | 302 + .../v6/resource/ApplicationAppUsage.java | 177 + .../v6/resource/ApplicationAppVersion.java | 302 + .../v6/resource/ApplicationContactsRange.java | 105 + .../v6/resource/ApplicationFeedback.java | 173 + .../v6/resource/ApplicationVisibility.java | 173 + .../service/application/v6/resource/Bot.java | 29 + .../service/approval/ApprovalService.java | 129 + .../service/approval/v4/ApprovalService.java | 2141 ------ .../com/lark/oapi/service/approval/v4/V4.java | 65 + .../approval/v4/resource/Approval.java | 304 + .../v4/resource/ExternalApproval.java | 175 + .../v4/resource/ExternalInstance.java | 173 + .../approval/v4/resource/ExternalTask.java | 105 + .../approval/v4/resource/Instance.java | 698 ++ .../approval/v4/resource/InstanceComment.java | 302 + .../service/approval/v4/resource/Task.java | 434 ++ .../service/attendance/AttendanceService.java | 119 + .../attendance/v1/AttendanceService.java | 2475 ------ .../lark/oapi/service/attendance/v1/V1.java | 113 + .../attendance/v1/model/GetGroupRespBody.java | 14 + .../v1/model/GetUserFlowRespBody.java | 16 +- .../service/attendance/v1/model/Group.java | 37 + .../v1/model/OpenApplyTimeRange.java | 111 + .../attendance/v1/model/ShiftGroupUser.java | 111 + .../service/attendance/v1/model/UserFlow.java | 37 + .../v1/model/UserShiftGroupsList.java | 185 + .../attendance/v1/resource/ApprovalInfo.java | 107 + .../service/attendance/v1/resource/File.java | 197 + .../service/attendance/v1/resource/Group.java | 372 + .../v1/resource/LeaveAccrualRecord.java | 105 + .../v1/resource/LeaveEmployExpireRecord.java | 105 + .../service/attendance/v1/resource/Shift.java | 370 + .../attendance/v1/resource/UserApproval.java | 177 + .../v1/resource/UserDailyShift.java | 173 + .../attendance/v1/resource/UserFlow.java | 240 + .../attendance/v1/resource/UserSetting.java | 173 + .../attendance/v1/resource/UserStatsData.java | 105 + .../v1/resource/UserStatsField.java | 105 + .../attendance/v1/resource/UserStatsView.java | 173 + .../attendance/v1/resource/UserTask.java | 107 + .../v1/resource/UserTaskRemedy.java | 236 + .../lark/oapi/service/auth/AuthService.java | 49 + .../oapi/service/auth/v3/AuthService.java | 422 - .../com/lark/oapi/service/auth/v3/V3.java | 43 + .../auth/v3/resource/AppAccessToken.java | 172 + .../service/auth/v3/resource/AppTicket.java | 104 + .../auth/v3/resource/TenantAccessToken.java | 172 + .../oapi/service/authen/AuthenService.java | 59 + .../oapi/service/authen/v1/AuthenService.java | 544 -- .../com/lark/oapi/service/authen/v1/V1.java | 53 + .../authen/v1/resource/AccessToken.java | 105 + .../authen/v1/resource/OidcAccessToken.java | 105 + .../v1/resource/OidcRefreshAccessToken.java | 105 + .../v1/resource/RefreshAccessToken.java | 105 + .../service/authen/v1/resource/UserInfo.java | 102 + .../lark/oapi/service/baike/BaikeService.java | 56 + .../oapi/service/baike/v1/BaikeService.java | 1000 --- .../com/lark/oapi/service/baike/v1/V1.java | 50 + .../baike/v1/resource/Classification.java | 105 + .../oapi/service/baike/v1/resource/Draft.java | 177 + .../service/baike/v1/resource/Entity.java | 568 ++ .../oapi/service/baike/v1/resource/File.java | 197 + .../oapi/service/bitable/BitableService.java | 89 + .../service/bitable/v1/BitableService.java | 3056 -------- .../com/lark/oapi/service/bitable/v1/V1.java | 83 + .../enums/ChildrenFilterConjunctionEnum.java | 32 + .../v1/enums/ConditionOperatorEnum.java | 42 + .../v1/enums/FilterInfoConjunctionEnum.java | 32 + .../service/bitable/v1/model/AppWorkflow.java | 148 + .../model/BatchUpdateAppTableRecordReq.java | 1 + .../bitable/v1/model/ChildrenFilter.java | 123 + .../service/bitable/v1/model/Condition.java | 160 + .../v1/model/CreateAppRoleMemberReq.java | 1 + .../v1/model/CreateAppTableFieldReq.java | 1 + .../v1/model/DeleteAppRoleMemberReq.java | 2 + .../service/bitable/v1/model/FilterInfo.java | 123 + .../oapi/service/bitable/v1/model/Sort.java | 111 + .../v1/model/UpdateAppTableRecordReq.java | 1 + .../oapi/service/bitable/v1/resource/App.java | 308 + .../bitable/v1/resource/AppDashboard.java | 175 + .../service/bitable/v1/resource/AppRole.java | 304 + .../bitable/v1/resource/AppRoleMember.java | 368 + .../service/bitable/v1/resource/AppTable.java | 444 ++ .../bitable/v1/resource/AppTableField.java | 310 + .../bitable/v1/resource/AppTableForm.java | 177 + .../v1/resource/AppTableFormField.java | 177 + .../bitable/v1/resource/AppTableRecord.java | 582 ++ .../bitable/v1/resource/AppTableView.java | 374 + .../lark/oapi/service/block/BlockService.java | 42 + .../oapi/service/block/v2/BlockService.java | 272 - .../com/lark/oapi/service/block/v2/V2.java | 36 + .../service/block/v2/resource/Entity.java | 173 + .../service/block/v2/resource/Message.java | 105 + .../service/calendar/CalendarService.java | 122 + .../service/calendar/v4/CalendarService.java | 2744 ------- .../com/lark/oapi/service/calendar/v4/V4.java | 83 + .../v4/enums/InstanceEventStatusEnum.java | 33 + .../ListCalendarEventUserIdTypeEnum.java | 33 + .../BatchDeleteCalendarEventAttendeeReq.java | 1 + .../v4/model/BookMeetingRoomData.java | 37 + .../calendar/v4/model/CalendarEvent.java | 74 + .../v4/model/CalendarPrimaryBatchReq.java | 74 + .../v4/model/CalendarUnderstandExtra.java | 148 + .../CalendarUnderstandScenarioContext.java | 148 + .../model/CreateCalendarEventAttendeeReq.java | 1 + .../DeleteCalendarEventMeetingChatReq.java | 1 + .../v4/model/DeleteCalendarEventReq.java | 1 + .../service/calendar/v4/model/EventCard.java | 111 + .../calendar/v4/model/EventOrganizer.java | 111 + .../service/calendar/v4/model/FreeTimeAi.java | 74 + .../calendar/v4/model/FreeTimeSlot.java | 148 + .../service/calendar/v4/model/Instance.java | 345 + .../v4/model/ListCalendarEventReq.java | 45 + .../v4/model/ListFreebusyReqBody.java | 74 + .../service/calendar/v4/model/MyaiReply.java | 37 + .../v4/model/PatchCalendarEventReq.java | 1 + .../calendar/v4/model/UserFreebusy.java | 111 + .../service/calendar/v4/model/UserMeta.java | 111 + .../service/calendar/v4/model/Workhour.java | 148 + .../calendar/v4/model/WorkhourSetting.java | 185 + .../calendar/v4/resource/Calendar.java | 772 ++ .../calendar/v4/resource/CalendarAcl.java | 378 + .../calendar/v4/resource/CalendarEvent.java | 582 ++ .../v4/resource/CalendarEventAttendee.java | 242 + .../CalendarEventAttendeeChatMember.java | 107 + .../v4/resource/CalendarEventMeetingChat.java | 173 + .../calendar/v4/resource/ExchangeBinding.java | 242 + .../calendar/v4/resource/Freebusy.java | 105 + .../service/calendar/v4/resource/Setting.java | 105 + .../calendar/v4/resource/TimeoffEvent.java | 173 + .../oapi/service/contact/ContactService.java | 254 + .../service/contact/v3/ContactService.java | 5094 ------------ .../com/lark/oapi/service/contact/v3/V3.java | 113 + .../contact/v3/resource/CustomAttr.java | 107 + .../contact/v3/resource/CustomAttrEvent.java | 29 + .../contact/v3/resource/Department.java | 846 ++ .../contact/v3/resource/EmployeeTypeEnum.java | 302 + .../contact/v3/resource/FunctionalRole.java | 236 + .../v3/resource/FunctionalRoleMember.java | 368 + .../service/contact/v3/resource/Group.java | 434 ++ .../contact/v3/resource/GroupMember.java | 372 + .../contact/v3/resource/JobFamily.java | 368 + .../service/contact/v3/resource/JobLevel.java | 368 + .../service/contact/v3/resource/JobTitle.java | 173 + .../service/contact/v3/resource/Scope.java | 105 + .../service/contact/v3/resource/Unit.java | 566 ++ .../service/contact/v3/resource/User.java | 776 ++ .../service/contact/v3/resource/WorkCity.java | 173 + .../oapi/service/corehr/CorehrService.java | 443 ++ .../oapi/service/corehr/v1/CorehrService.java | 6795 ----------------- .../com/lark/oapi/service/corehr/v1/V1.java | 209 + .../oapi/service/corehr/v1/model/Company.java | 185 + .../v1/model/CreateJobChangeReqBody.java | 1 + .../service/corehr/v1/model/LeaveRequest.java | 148 + .../service/corehr/v1/model/Offboarding.java | 37 + .../corehr/v1/model/P2JobCreatedV1.java | 34 + .../corehr/v1/model/P2JobCreatedV1Data.java | 34 + .../corehr/v1/model/P2JobDeletedV1.java | 34 + .../corehr/v1/model/P2JobDeletedV1Data.java | 34 + .../corehr/v1/model/P2JobUpdatedV1.java | 34 + .../corehr/v1/model/P2JobUpdatedV1Data.java | 34 + .../corehr/v1/model/PatchCompanyReq.java | 133 + .../corehr/v1/model/PatchCompanyResp.java | 19 + .../corehr/v1/model/PatchCompanyRespBody.java | 33 + .../v1/model/PhoneNumberAndAreaCode.java | 111 + .../service/corehr/v1/model/TransferInfo.java | 74 + .../corehr/v1/resource/AssignedUser.java | 105 + .../service/corehr/v1/resource/Company.java | 368 + .../v1/resource/CompensationStandard.java | 105 + .../service/corehr/v1/resource/Contract.java | 368 + .../corehr/v1/resource/CountryRegion.java | 173 + .../service/corehr/v1/resource/Currency.java | 173 + .../corehr/v1/resource/CustomField.java | 236 + .../corehr/v1/resource/Department.java | 368 + .../corehr/v1/resource/EmployeeType.java | 368 + .../corehr/v1/resource/Employment.java | 236 + .../oapi/service/corehr/v1/resource/File.java | 127 + .../oapi/service/corehr/v1/resource/Job.java | 368 + .../service/corehr/v1/resource/JobChange.java | 105 + .../service/corehr/v1/resource/JobData.java | 368 + .../service/corehr/v1/resource/JobFamily.java | 368 + .../service/corehr/v1/resource/JobLevel.java | 368 + .../service/corehr/v1/resource/Leave.java | 236 + .../v1/resource/LeaveGrantingRecord.java | 173 + .../service/corehr/v1/resource/Location.java | 302 + .../corehr/v1/resource/NationalIdType.java | 368 + .../corehr/v1/resource/Offboarding.java | 236 + .../v1/resource/OrgRoleAuthorization.java | 29 + .../service/corehr/v1/resource/Person.java | 238 + .../service/corehr/v1/resource/PreHire.java | 302 + .../v1/resource/ProcessFormVariableData.java | 105 + .../corehr/v1/resource/SecurityGroup.java | 173 + .../corehr/v1/resource/Subdivision.java | 173 + .../service/corehr/v1/resource/Subregion.java | 173 + .../corehr/v1/resource/TransferReason.java | 105 + .../corehr/v1/resource/TransferType.java | 105 + .../corehr/v1/resource/WorkingHoursType.java | 368 + .../com/lark/oapi/service/corehr/v2/V2.java | 138 + .../ApprovalGroupApprovalGroupStatusEnum.java | 36 + .../enums/ApprovalGroupDraftStatusEnum.java | 34 + ...sessmentForCreateAssessmentResultEnum.java | 32 + ...sessmentForCreateAssessmentStatusEnum.java | 34 + .../v2/enums/BankBasicDataObjStatusEnum.java | 32 + .../BankBranchBasicDataObjStatusEnum.java | 32 + .../BatchGetEmployeeDepartmentIdTypeEnum.java | 33 + .../enums/BatchGetEmployeeUserIdTypeEnum.java | 34 + .../BatchGetEmployeesBpUserIdTypeEnum.java | 34 + ...tEmployeesJobDataDepartmentIdTypeEnum.java | 33 + ...atchGetEmployeesJobDataUserIdTypeEnum.java | 34 + .../v2/enums/CityBasicDataObjStatusEnum.java | 32 + .../CountryRegionBasicDataObjStatusEnum.java | 32 + ...gionSubdivisionBasicDataObjStatusEnum.java | 32 + ...eateProbationAssessmentUserIdTypeEnum.java | 34 + .../enums/CurrencyBasicDataObjStatusEnum.java | 32 + ...artmentChangeDepartmentChangeTypeEnum.java | 34 + .../enums/DistrictBasicDataObjStatusEnum.java | 32 + ...GetByDepartmentBpDepartmentIdTypeEnum.java | 33 + .../GetByDepartmentBpUserIdTypeEnum.java | 34 + .../v2/enums/GetProcessUserIdTypeEnum.java | 33 + .../enums/JobChangeJobChangeStatusEnum.java | 36 + .../v2/enums/ListBpDepartmentIdTypeEnum.java | 33 + .../corehr/v2/enums/ListBpUserIdTypeEnum.java | 34 + .../NationalityBasicDataObjStatusEnum.java | 32 + .../enums/OnboardingTaskTaskStatusEnum.java | 41 + ...ParentsDepartmentDepartmentIdTypeEnum.java | 33 + ...obationAssessmentAssessmentResultEnum.java | 32 + ...obationAssessmentAssessmentStatusEnum.java | 34 + .../PreHireEmploymentInfoRehireEnum.java | 33 + .../ProcessDoneItemApproverStatusEnum.java | 33 + .../ProcessDoneItemApproverTypeEnum.java | 32 + .../ProcessTodoItemApproverTypeEnum.java | 32 + ...yEmployeesJobDataDepartmentIdTypeEnum.java | 33 + .../QueryEmployeesJobDataUserIdTypeEnum.java | 34 + .../enums/SearchContractUserIdTypeEnum.java | 34 + .../SearchDepartmentDepartmentIdTypeEnum.java | 33 + .../enums/SearchDepartmentUserIdTypeEnum.java | 34 + .../SearchEmployeeDepartmentIdTypeEnum.java | 33 + .../SearchEmployeeEmploymentStatusEnum.java | 32 + .../enums/SearchEmployeeUserIdTypeEnum.java | 34 + .../SearchJobChangeDepartmentIdTypeEnum.java | 33 + .../enums/SearchJobChangeUserIdTypeEnum.java | 34 + .../SearchProbationDepartmentIdTypeEnum.java | 33 + ...rchProbationFinalAssessmentResultEnum.java | 32 + .../SearchProbationProbationStatusEnum.java | 36 + .../enums/SearchProbationUserIdTypeEnum.java | 34 + .../corehr/v2/model/AbnormalReason.java | 148 + .../v2/model/AbnormalReasonElement.java | 148 + .../v2/model/AbnormalReasonI18nElement.java | 111 + .../oapi/service/corehr/v2/model/Address.java | 740 ++ .../corehr/v2/model/ApprovalGroup.java | 468 ++ .../service/corehr/v2/model/Assessment.java | 333 + .../corehr/v2/model/AssessmentForCreate.java | 320 + .../oapi/service/corehr/v2/model/Bank.java | 234 + .../service/corehr/v2/model/BankAccount.java | 407 + .../service/corehr/v2/model/BankBranch.java | 271 + .../corehr/v2/model/BasicDepartment.java | 111 + .../corehr/v2/model/BasicEmployee.java | 185 + .../service/corehr/v2/model/BasicInfo.java | 444 ++ .../service/corehr/v2/model/BasicJobData.java | 111 + .../corehr/v2/model/BasicPersonInfo.java | 185 + .../corehr/v2/model/BatchGetCompanyReq.java | 65 + .../v2/model/BatchGetCompanyReqBody.java | 74 + .../corehr/v2/model/BatchGetCompanyResp.java | 19 + .../v2/model/BatchGetCompanyRespBody.java | 34 + .../corehr/v2/model/BatchGetEmployeeReq.java | 156 + .../v2/model/BatchGetEmployeeReqBody.java | 185 + .../corehr/v2/model/BatchGetEmployeeResp.java | 19 + .../v2/model/BatchGetEmployeeRespBody.java | 34 + .../v2/model/BatchGetEmployeesBpReq.java | 111 + .../v2/model/BatchGetEmployeesBpReqBody.java | 111 + .../v2/model/BatchGetEmployeesBpResp.java | 19 + .../v2/model/BatchGetEmployeesBpRespBody.java | 48 + .../v2/model/BatchGetEmployeesJobDataReq.java | 156 + .../BatchGetEmployeesJobDataReqBody.java | 222 + .../model/BatchGetEmployeesJobDataResp.java | 19 + .../BatchGetEmployeesJobDataRespBody.java | 34 + .../corehr/v2/model/BatchGetJobFamilyReq.java | 65 + .../v2/model/BatchGetJobFamilyReqBody.java | 74 + .../v2/model/BatchGetJobFamilyResp.java | 19 + .../v2/model/BatchGetJobFamilyRespBody.java | 34 + .../corehr/v2/model/BatchGetJobLevelReq.java | 65 + .../v2/model/BatchGetJobLevelReqBody.java | 74 + .../corehr/v2/model/BatchGetJobLevelResp.java | 19 + .../v2/model/BatchGetJobLevelRespBody.java | 34 + .../corehr/v2/model/BatchGetLocationReq.java | 65 + .../v2/model/BatchGetLocationReqBody.java | 74 + .../corehr/v2/model/BatchGetLocationResp.java | 19 + .../v2/model/BatchGetLocationRespBody.java | 34 + .../lark/oapi/service/corehr/v2/model/Bp.java | 111 + .../corehr/v2/model/CalculateParam.java | 333 + .../corehr/v2/model/ChangeFieldPair.java | 111 + .../oapi/service/corehr/v2/model/City.java | 234 + .../oapi/service/corehr/v2/model/Company.java | 666 ++ .../corehr/v2/model/CompanyIdAndName.java | 111 + .../service/corehr/v2/model/Contract.java | 444 ++ .../service/corehr/v2/model/CostCenter.java | 407 + .../corehr/v2/model/CostCenterVersion.java | 444 ++ .../corehr/v2/model/CountryRegion.java | 308 + .../v2/model/CountryRegionSubdivision.java | 271 + .../corehr/v2/model/CreatePersonReq.java | 99 + .../corehr/v2/model/CreatePersonResp.java | 19 + .../corehr/v2/model/CreatePersonRespBody.java | 33 + .../corehr/v2/model/CreatePreHireReq.java | 65 + .../corehr/v2/model/CreatePreHireResp.java | 19 + .../v2/model/CreatePreHireRespBody.java | 34 + .../model/CreateProbationAssessmentReq.java | 144 + .../CreateProbationAssessmentReqBody.java | 111 + .../model/CreateProbationAssessmentResp.java | 19 + .../CreateProbationAssessmentRespBody.java | 34 + .../service/corehr/v2/model/Currency.java | 271 + .../corehr/v2/model/CustomFieldData.java | 185 + .../service/corehr/v2/model/CustomName.java | 111 + .../service/corehr/v2/model/CustomValue.java | 111 + .../corehr/v2/model/DataengineI18n.java | 111 + .../model/DeleteProbationAssessmentReq.java | 72 + .../model/DeleteProbationAssessmentResp.java | 20 + .../service/corehr/v2/model/Department.java | 629 ++ .../corehr/v2/model/DepartmentChange.java | 197 + .../corehr/v2/model/DepartmentHrbp.java | 111 + .../service/corehr/v2/model/DepartmentId.java | 105 + .../corehr/v2/model/DepartmentParentInfo.java | 222 + .../corehr/v2/model/DepartmentParents.java | 111 + .../service/corehr/v2/model/Dependent.java | 592 ++ .../service/corehr/v2/model/Dimension.java | 222 + .../corehr/v2/model/DimensionInfo.java | 111 + .../corehr/v2/model/DimensionValue.java | 111 + .../service/corehr/v2/model/District.java | 197 + .../service/corehr/v2/model/Education.java | 444 ++ .../corehr/v2/model/EducationInfo.java | 222 + .../oapi/service/corehr/v2/model/Email.java | 185 + .../corehr/v2/model/EmergencyContact.java | 259 + .../service/corehr/v2/model/Employee.java | 1924 +++++ .../EmployeeInternationalAssignment.java | 111 + .../corehr/v2/model/EmployeeJobData.java | 111 + .../service/corehr/v2/model/Employment.java | 1073 +++ .../service/corehr/v2/model/EmploymentBp.java | 148 + .../EnableDisableAssessmentProbationReq.java | 65 + ...ableDisableAssessmentProbationReqBody.java | 111 + .../EnableDisableAssessmentProbationResp.java | 20 + .../oapi/service/corehr/v2/model/Enum.java | 111 + .../oapi/service/corehr/v2/model/File.java | 74 + .../corehr/v2/model/GetByDepartmentBpReq.java | 156 + .../v2/model/GetByDepartmentBpReqBody.java | 74 + .../v2/model/GetByDepartmentBpResp.java | 19 + .../v2/model/GetByDepartmentBpRespBody.java | 34 + .../service/corehr/v2/model/GetJobReq.java | 72 + .../service/corehr/v2/model/GetJobResp.java | 19 + .../corehr/v2/model/GetJobRespBody.java | 34 + .../corehr/v2/model/GetProcessReq.java | 117 + .../corehr/v2/model/GetProcessResp.java | 19 + .../corehr/v2/model/GetProcessRespBody.java | 230 + .../corehr/v2/model/HiberarchyCommon.java | 444 ++ .../oapi/service/corehr/v2/model/I18n.java | 111 + .../oapi/service/corehr/v2/model/I18nV2.java | 111 + .../v2/model/InternationalAssignment.java | 444 ++ .../v2/model/InternationalAssignmentV2.java | 703 ++ .../InternationalAssignmentV2ForCreate.java | 481 ++ .../InternationalAssignmentV2ForPatch.java | 444 ++ .../oapi/service/corehr/v2/model/Job.java | 481 ++ .../service/corehr/v2/model/JobChange.java | 419 + .../oapi/service/corehr/v2/model/JobData.java | 925 +++ .../corehr/v2/model/JobDataCostCenter.java | 111 + .../service/corehr/v2/model/JobFamily.java | 333 + .../service/corehr/v2/model/JobLevel.java | 296 + .../service/corehr/v2/model/ListBpReq.java | 198 + .../service/corehr/v2/model/ListBpResp.java | 19 + .../corehr/v2/model/ListBpRespBody.java | 62 + .../service/corehr/v2/model/ListJobReq.java | 174 + .../service/corehr/v2/model/ListJobResp.java | 19 + .../corehr/v2/model/ListJobRespBody.java | 62 + .../corehr/v2/model/ListProcessReq.java | 242 + .../corehr/v2/model/ListProcessResp.java | 19 + .../corehr/v2/model/ListProcessRespBody.java | 62 + .../service/corehr/v2/model/Location.java | 444 ++ .../service/corehr/v2/model/LocationV2.java | 555 ++ .../oapi/service/corehr/v2/model/Name.java | 296 + .../service/corehr/v2/model/NationalId.java | 296 + .../service/corehr/v2/model/Nationality.java | 308 + .../corehr/v2/model/ObjectFieldData.java | 111 + .../service/corehr/v2/model/OfferInfo.java | 1110 +++ .../corehr/v2/model/OnboardingTask.java | 160 + .../corehr/v2/model/P2ProbationUpdatedV2.java | 34 + .../v2/model/P2ProbationUpdatedV2Data.java | 62 + .../v2/model/P2ProcessApproverUpdatedV2.java | 34 + .../model/P2ProcessApproverUpdatedV2Data.java | 76 + .../corehr/v2/model/P2ProcessCcUpdatedV2.java | 34 + .../v2/model/P2ProcessCcUpdatedV2Data.java | 62 + .../corehr/v2/model/P2ProcessUpdatedV2.java | 34 + .../v2/model/P2ProcessUpdatedV2Data.java | 48 + .../corehr/v2/model/ParentsDepartmentReq.java | 111 + .../v2/model/ParentsDepartmentReqBody.java | 74 + .../v2/model/ParentsDepartmentResp.java | 19 + .../v2/model/ParentsDepartmentRespBody.java | 34 + .../corehr/v2/model/PatchPersonReq.java | 133 + .../corehr/v2/model/PatchPersonResp.java | 19 + .../corehr/v2/model/PatchPersonRespBody.java | 33 + .../v2/model/PatchProbationAssessmentReq.java | 133 + .../model/PatchProbationAssessmentResp.java | 20 + .../service/corehr/v2/model/PersonInfo.java | 1739 +++++ .../corehr/v2/model/PersonInfoChn.java | 222 + .../service/corehr/v2/model/PersonName.java | 888 +++ .../corehr/v2/model/PersonalProfile.java | 148 + .../oapi/service/corehr/v2/model/Phone.java | 296 + .../v2/model/PhoneNumberAndAreaCode.java | 111 + .../oapi/service/corehr/v2/model/PreHire.java | 259 + .../corehr/v2/model/PreHireContractInfo.java | 222 + .../v2/model/PreHireEmploymentInfo.java | 937 +++ .../v2/model/PreHireOnboardingInfo.java | 407 + .../corehr/v2/model/PreHireProbationInfo.java | 148 + .../corehr/v2/model/PrehireCreate.java | 222 + .../corehr/v2/model/ProbationInfo.java | 814 ++ .../v2/model/ProbationInfoForSubmit.java | 777 ++ .../corehr/v2/model/ProcessAbstractItem.java | 111 + .../corehr/v2/model/ProcessCcItem.java | 259 + .../corehr/v2/model/ProcessDoneItem.java | 394 + .../service/corehr/v2/model/ProcessLink.java | 148 + .../corehr/v2/model/ProcessTodoItem.java | 308 + .../v2/model/QueryEmployeesJobDataReq.java | 222 + .../model/QueryEmployeesJobDataReqBody.java | 185 + .../v2/model/QueryEmployeesJobDataResp.java | 19 + .../model/QueryEmployeesJobDataRespBody.java | 62 + .../corehr/v2/model/ReorganizationInfo.java | 740 ++ .../service/corehr/v2/model/ResidentTax.java | 185 + .../corehr/v2/model/SearchContractReq.java | 177 + .../v2/model/SearchContractReqBody.java | 111 + .../corehr/v2/model/SearchContractResp.java | 19 + .../v2/model/SearchContractRespBody.java | 62 + .../corehr/v2/model/SearchDepartmentReq.java | 222 + .../v2/model/SearchDepartmentReqBody.java | 333 + .../corehr/v2/model/SearchDepartmentResp.java | 19 + .../v2/model/SearchDepartmentRespBody.java | 62 + .../corehr/v2/model/SearchEmployeeReq.java | 222 + .../v2/model/SearchEmployeeReqBody.java | 863 +++ .../corehr/v2/model/SearchEmployeeResp.java | 19 + .../v2/model/SearchEmployeeRespBody.java | 62 + .../corehr/v2/model/SearchJobChangeReq.java | 222 + .../v2/model/SearchJobChangeReqBody.java | 148 + .../corehr/v2/model/SearchJobChangeResp.java | 19 + .../v2/model/SearchJobChangeRespBody.java | 62 + .../corehr/v2/model/SearchProbationReq.java | 222 + .../v2/model/SearchProbationReqBody.java | 542 ++ .../corehr/v2/model/SearchProbationResp.java | 19 + .../v2/model/SearchProbationRespBody.java | 62 + .../corehr/v2/model/SignatureFile.java | 296 + .../v2/model/TranferEmploymentInfo.java | 185 + .../service/corehr/v2/model/TransferInfo.java | 1887 +++++ .../service/corehr/v2/model/UserContact.java | 111 + .../service/corehr/v2/model/UserInfo.java | 407 + .../service/corehr/v2/model/WorkEmail.java | 111 + .../corehr/v2/model/WorkExperience.java | 222 + .../corehr/v2/model/WorkExperienceInfo.java | 296 + .../corehr/v2/model/WorkforcePlan.java | 222 + .../corehr/v2/model/WorkforcePlanDetail.java | 407 + .../v2/model/WorkforcePlanEaiDetail.java | 111 + .../oapi/service/corehr/v2/resource/Bp.java | 173 + .../service/corehr/v2/resource/Company.java | 105 + .../service/corehr/v2/resource/Contract.java | 105 + .../corehr/v2/resource/Department.java | 173 + .../service/corehr/v2/resource/Employee.java | 173 + .../corehr/v2/resource/EmployeesBp.java | 105 + .../corehr/v2/resource/EmployeesJobData.java | 173 + .../oapi/service/corehr/v2/resource/Job.java | 173 + .../service/corehr/v2/resource/JobChange.java | 105 + .../service/corehr/v2/resource/JobFamily.java | 105 + .../service/corehr/v2/resource/JobLevel.java | 105 + .../service/corehr/v2/resource/Location.java | 105 + .../service/corehr/v2/resource/Person.java | 173 + .../service/corehr/v2/resource/PreHire.java | 105 + .../service/corehr/v2/resource/Probation.java | 173 + .../v2/resource/ProbationAssessment.java | 236 + .../service/corehr/v2/resource/Process.java | 173 + .../corehr/v2/resource/ProcessApprover.java | 29 + .../service/corehr/v2/resource/ProcessCc.java | 29 + .../document_ai/DocumentAiService.java | 119 + .../document_ai/v1/DocumentAiService.java | 1341 ---- .../lark/oapi/service/document_ai/v1/V1.java | 113 + .../document_ai/v1/resource/BankCard.java | 107 + .../document_ai/v1/resource/BusinessCard.java | 107 + .../v1/resource/BusinessLicense.java | 107 + .../v1/resource/ChinesePassport.java | 107 + .../document_ai/v1/resource/Contract.java | 107 + .../v1/resource/DrivingLicense.java | 107 + .../v1/resource/FoodManageLicense.java | 107 + .../v1/resource/FoodProduceLicense.java | 107 + .../v1/resource/HkmMainlandTravelPermit.java | 107 + .../document_ai/v1/resource/IdCard.java | 107 + .../document_ai/v1/resource/TaxiInvoice.java | 107 + .../document_ai/v1/resource/TrainInvoice.java | 107 + .../v1/resource/TwMainlandTravelPermit.java | 107 + .../document_ai/v1/resource/VatInvoice.java | 107 + .../v1/resource/VehicleLicense.java | 107 + .../lark/oapi/service/docx/DocxService.java | 49 + .../oapi/service/docx/v1/DocxService.java | 793 -- .../com/lark/oapi/service/docx/v1/V1.java | 43 + .../docx/v1/enums/BlockBlockTypeEnum.java | 1 + .../service/docx/v1/enums/BoardAlignEnum.java | 33 + .../oapi/service/docx/v1/model/Block.java | 37 + .../oapi/service/docx/v1/model/Board.java | 197 + .../oapi/service/docx/v1/model/Document.java | 37 + .../docx/v1/model/DocumentDisplaySetting.java | 296 + .../lark/oapi/service/docx/v1/model/Task.java | 45 +- .../docx/v1/model/UpdateBlockRequest.java | 37 + .../docx/v1/model/UpdateDocumentRequest.java | 74 + .../docx/v1/model/UpdateTaskRequest.java | 111 + .../service/docx/v1/resource/Document.java | 248 + .../docx/v1/resource/DocumentBlock.java | 318 + .../v1/resource/DocumentBlockChildren.java | 248 + .../lark/oapi/service/drive/DriveService.java | 190 + .../oapi/service/drive/v1/DriveService.java | 4102 ---------- .../com/lark/oapi/service/drive/v1/V1.java | 107 + .../enums/AuthPermissionMemberPermEnum.java | 1 + .../enums/CreateFileVersionObjTypeEnum.java | 1 + .../CreateFileVersionParentTypeEnum.java | 1 + .../enums/DeleteFileVersionObjTypeEnum.java | 1 + .../v1/enums/GetFileVersionObjTypeEnum.java | 1 + .../v1/enums/ListFileVersionObjTypeEnum.java | 1 + .../drive/v1/enums/VersionObjTypeEnum.java | 1 + .../drive/v1/enums/VersionParentTypeEnum.java | 1 + .../v1/model/DeleteFileCommentReplyReq.java | 2 + .../drive/v1/model/FileBlockChangeInfo.java | 148 + .../drive/v1/model/FileChangeInfo.java | 111 + .../drive/v1/model/FileStatistics.java | 111 + .../drive/v1/model/PatchFileCommentReq.java | 1 + .../v1/model/UpdateFileCommentReplyReq.java | 1 + .../service/drive/v1/resource/ExportTask.java | 258 + .../oapi/service/drive/v1/resource/File.java | 1076 +++ .../drive/v1/resource/FileComment.java | 368 + .../drive/v1/resource/FileCommentReply.java | 236 + .../drive/v1/resource/FileStatistics.java | 105 + .../drive/v1/resource/FileSubscription.java | 236 + .../drive/v1/resource/FileVersion.java | 302 + .../drive/v1/resource/FileViewRecord.java | 105 + .../service/drive/v1/resource/ImportTask.java | 173 + .../oapi/service/drive/v1/resource/Media.java | 476 ++ .../oapi/service/drive/v1/resource/Meta.java | 105 + .../drive/v1/resource/PermissionMember.java | 438 ++ .../drive/v1/resource/PermissionPublic.java | 173 + .../v1/resource/PermissionPublicPassword.java | 236 + .../com/lark/oapi/service/drive/v2/V2.java | 29 + .../GetPermissionPublicTokenTypeEnum.java | 39 + .../drive/v2/enums/MyLikeFileTypeEnum.java | 33 + ...atchPermissionPublicCommentEntityEnum.java | 32 + .../PatchPermissionPublicCopyEntityEnum.java | 33 + ...missionPublicExternalAccessEntityEnum.java | 33 + ...chPermissionPublicLinkShareEntityEnum.java | 37 + ...ionPublicManageCollaboratorEntityEnum.java | 33 + ...tchPermissionPublicSecurityEntityEnum.java | 33 + .../PatchPermissionPublicShareEntityEnum.java | 32 + .../PatchPermissionPublicTokenTypeEnum.java | 39 + .../PermissionPublicCommentEntityEnum.java | 32 + .../enums/PermissionPublicCopyEntityEnum.java | 33 + ...missionPublicExternalAccessEntityEnum.java | 33 + .../PermissionPublicLinkShareEntityEnum.java | 37 + ...ionPublicManageCollaboratorEntityEnum.java | 33 + .../PermissionPublicSecurityEntityEnum.java | 33 + .../PermissionPublicShareEntityEnum.java | 32 + .../service/drive/v2/model/DepartmentId.java | 105 + .../oapi/service/drive/v2/model/FileLike.java | 259 + .../v2/model/GetPermissionPublicReq.java | 117 + .../v2/model/GetPermissionPublicResp.java | 19 + .../v2/model/GetPermissionPublicRespBody.java | 34 + .../oapi/service/drive/v2/model/MyLike.java | 271 + .../v2/model/PatchPermissionPublicReq.java | 145 + .../v2/model/PatchPermissionPublicResp.java | 19 + .../model/PatchPermissionPublicRespBody.java | 34 + .../drive/v2/model/PermissionPublic.java | 417 + .../service/drive/v2/model/SecureLabel.java | 111 + .../drive/v2/resource/PermissionPublic.java | 173 + .../com/lark/oapi/service/ehr/EhrService.java | 42 + .../lark/oapi/service/ehr/v1/EhrService.java | 233 - .../java/com/lark/oapi/service/ehr/v1/V1.java | 36 + .../service/ehr/v1/resource/Attachment.java | 129 + .../service/ehr/v1/resource/Employee.java | 105 + .../lark/oapi/service/event/EventService.java | 28 + .../oapi/service/event/v1/EventService.java | 124 - .../com/lark/oapi/service/event/v1/V1.java | 29 + .../service/event/v1/resource/OutboundIp.java | 107 + .../GrayTestOpenSgService.java | 35 + .../v1/GrayTestOpenSgService.java | 253 - .../oapi/service/gray_test_open_sg/v1/V1.java | 29 + .../gray_test_open_sg/v1/resource/Moto.java | 236 + .../service/helpdesk/HelpdeskService.java | 140 + .../service/helpdesk/v1/HelpdeskService.java | 3648 --------- .../com/lark/oapi/service/helpdesk/v1/V1.java | 101 + .../service/helpdesk/v1/resource/Agent.java | 170 + .../helpdesk/v1/resource/AgentSchedule.java | 173 + .../helpdesk/v1/resource/AgentSchedules.java | 236 + .../helpdesk/v1/resource/AgentSkill.java | 366 + .../helpdesk/v1/resource/AgentSkillRule.java | 102 + .../helpdesk/v1/resource/BotMessage.java | 105 + .../helpdesk/v1/resource/Category.java | 368 + .../service/helpdesk/v1/resource/Event.java | 173 + .../service/helpdesk/v1/resource/Faq.java | 522 ++ .../helpdesk/v1/resource/Notification.java | 566 ++ .../service/helpdesk/v1/resource/Ticket.java | 522 ++ .../v1/resource/TicketCustomizedField.java | 368 + .../helpdesk/v1/resource/TicketMessage.java | 173 + .../lark/oapi/service/hire/HireService.java | 345 + .../oapi/service/hire/v1/HireService.java | 5948 --------------- .../com/lark/oapi/service/hire/v1/V1.java | 245 + .../oapi/service/hire/v1/model/Agency.java | 37 + .../hire/v1/model/AgencyProtection.java | 333 + .../v1/model/ApplicationOfferBasicInfo.java | 37 + .../hire/v1/model/CombinedCreateJobReq.java | 66 + .../hire/v1/model/CombinedUpdateJobReq.java | 66 + .../v1/model/CreateJobRequirementReq.java | 99 + .../service/hire/v1/model/CreateOfferReq.java | 99 + .../hire/v1/model/GetApplicationReq.java | 35 +- .../v1/model/GetByApplicationEmployeeReq.java | 102 + .../service/hire/v1/model/GetEmployeeReq.java | 99 + .../hire/v1/model/GetJobManagerReq.java | 1 + .../oapi/service/hire/v1/model/GetJobReq.java | 66 + .../service/hire/v1/model/GetOfferReq.java | 99 + .../model/GetReferralWebsiteJobPostReq.java | 33 + .../v1/model/ListApplicationInterviewReq.java | 33 + .../v1/model/ListByIdJobRequirementReq.java | 99 + .../hire/v1/model/ListInterviewReq.java | 34 + .../hire/v1/model/ListJobRequirementReq.java | 102 + .../service/hire/v1/model/ListOfferReq.java | 34 + .../model/ListReferralWebsiteJobPostReq.java | 34 + .../v1/model/MasterLocationAddressInfo.java | 111 + .../hire/v1/model/MasterLocationInfo.java | 148 + .../hire/v1/model/OfferApplicationReq.java | 99 + .../hire/v1/model/PatchEmployeeReq.java | 99 + .../service/hire/v1/model/ReferralInfo.java | 185 + .../model/TransferOnboardApplicationReq.java | 99 + .../v1/model/TripartiteAgreementInfo.java | 222 + .../v1/model/UpdateJobRequirementReq.java | 99 + .../service/hire/v1/model/UpdateOfferReq.java | 99 + .../service/hire/v1/resource/Application.java | 434 ++ .../v1/resource/ApplicationInterview.java | 105 + .../service/hire/v1/resource/Attachment.java | 173 + .../service/hire/v1/resource/EcoAccount.java | 29 + .../v1/resource/EcoAccountCustomField.java | 236 + .../hire/v1/resource/EcoBackgroundCheck.java | 236 + .../EcoBackgroundCheckCustomField.java | 236 + .../resource/EcoBackgroundCheckPackage.java | 236 + .../service/hire/v1/resource/EcoExam.java | 173 + .../hire/v1/resource/EcoExamPaper.java | 236 + .../hire/v1/resource/EhrImportTask.java | 105 + .../EhrImportTaskForInternshipOffer.java | 29 + .../service/hire/v1/resource/Employee.java | 236 + .../service/hire/v1/resource/Evaluation.java | 105 + .../hire/v1/resource/ExternalApplication.java | 236 + .../v1/resource/ExternalBackgroundCheck.java | 105 + .../hire/v1/resource/ExternalInterview.java | 105 + .../resource/ExternalInterviewAssessment.java | 105 + .../service/hire/v1/resource/Interview.java | 105 + .../oapi/service/hire/v1/resource/Job.java | 368 + .../service/hire/v1/resource/JobManager.java | 105 + .../service/hire/v1/resource/JobProcess.java | 105 + .../hire/v1/resource/JobRequirement.java | 368 + .../v1/resource/JobRequirementSchema.java | 105 + .../service/hire/v1/resource/JobType.java | 105 + .../oapi/service/hire/v1/resource/Note.java | 302 + .../oapi/service/hire/v1/resource/Offer.java | 434 ++ .../service/hire/v1/resource/OfferSchema.java | 105 + .../hire/v1/resource/Questionnaire.java | 105 + .../service/hire/v1/resource/Referral.java | 105 + .../hire/v1/resource/ReferralAccount.java | 302 + .../v1/resource/ReferralWebsiteJobPost.java | 173 + .../hire/v1/resource/RegistrationSchema.java | 105 + .../hire/v1/resource/ResumeSource.java | 105 + .../oapi/service/hire/v1/resource/Talent.java | 236 + .../hire/v1/resource/TalentFolder.java | 105 + .../hire/v1/resource/TalentObject.java | 102 + .../HumanAuthenticationService.java | 35 + .../v1/HumanAuthenticationService.java | 124 - .../service/human_authentication/v1/V1.java | 29 + .../v1/resource/Identity.java | 107 + .../com/lark/oapi/service/im/ImService.java | 263 + .../lark/oapi/service/im/v1/ImService.java | 4432 ----------- .../java/com/lark/oapi/service/im/v1/V1.java | 131 + .../im/v1/model/GetMessageResourceReq.java | 1 + .../service/im/v1/resource/BatchMessage.java | 242 + .../oapi/service/im/v1/resource/Chat.java | 514 ++ .../im/v1/resource/ChatAnnouncement.java | 177 + .../service/im/v1/resource/ChatManagers.java | 177 + .../service/im/v1/resource/ChatMemberBot.java | 29 + .../im/v1/resource/ChatMemberUser.java | 29 + .../service/im/v1/resource/ChatMembers.java | 378 + .../service/im/v1/resource/ChatMenuItem.java | 107 + .../service/im/v1/resource/ChatMenuTree.java | 310 + .../im/v1/resource/ChatModeration.java | 177 + .../oapi/service/im/v1/resource/ChatTab.java | 378 + .../service/im/v1/resource/ChatTopNotice.java | 177 + .../oapi/service/im/v1/resource/File.java | 201 + .../oapi/service/im/v1/resource/Image.java | 201 + .../oapi/service/im/v1/resource/Message.java | 924 +++ .../im/v1/resource/MessageReaction.java | 242 + .../im/v1/resource/MessageResource.java | 129 + .../lark/oapi/service/im/v1/resource/Pin.java | 242 + .../lark/oapi/service/lingo/LingoService.java | 59 + .../oapi/service/lingo/v1/LingoService.java | 1011 --- .../com/lark/oapi/service/lingo/v1/V1.java | 53 + .../lingo/v1/model/DeleteEntityReq.java | 138 + .../lingo/v1/model/DeleteEntityResp.java | 20 + .../lingo/v1/resource/Classification.java | 105 + .../oapi/service/lingo/v1/resource/Draft.java | 173 + .../service/lingo/v1/resource/Entity.java | 566 ++ .../oapi/service/lingo/v1/resource/File.java | 197 + .../oapi/service/lingo/v1/resource/Repo.java | 102 + .../lark/oapi/service/mail/MailService.java | 95 + .../oapi/service/mail/v1/MailService.java | 3215 -------- .../com/lark/oapi/service/mail/v1/V1.java | 89 + .../v1/model/GetPublicMailboxMemberReq.java | 1 + .../service/mail/v1/resource/Mailgroup.java | 434 ++ .../mail/v1/resource/MailgroupAlias.java | 236 + .../mail/v1/resource/MailgroupManager.java | 236 + .../mail/v1/resource/MailgroupMember.java | 434 ++ .../resource/MailgroupPermissionMember.java | 434 ++ .../mail/v1/resource/PublicMailbox.java | 434 ++ .../mail/v1/resource/PublicMailboxAlias.java | 236 + .../mail/v1/resource/PublicMailboxMember.java | 500 ++ .../oapi/service/mail/v1/resource/User.java | 105 + .../service/mail/v1/resource/UserMailbox.java | 105 + .../mail/v1/resource/UserMailboxAlias.java | 236 + .../com/lark/oapi/service/mdm/MdmService.java | 35 + .../lark/oapi/service/mdm/v1/MdmService.java | 190 - .../java/com/lark/oapi/service/mdm/v1/V1.java | 29 + .../mdm/v1/resource/UserAuthDataRelation.java | 173 + .../{v1 => }/MeetingRoomService.java | 27 +- .../lark/oapi/service/meeting_room/v1/V1.java | 29 + .../meeting_room/v1/resource/MeetingRoom.java | 29 + .../com/lark/oapi/service/okr/OkrService.java | 59 + .../lark/oapi/service/okr/v1/OkrService.java | 667 -- .../java/com/lark/oapi/service/okr/v1/V1.java | 53 + .../oapi/service/okr/v1/resource/Image.java | 107 + .../oapi/service/okr/v1/resource/Okr.java | 107 + .../oapi/service/okr/v1/resource/Period.java | 107 + .../okr/v1/resource/ProgressRecord.java | 302 + .../oapi/service/okr/v1/resource/UserOkr.java | 107 + .../OpticalCharRecognitionService.java | 35 + .../v1/OpticalCharRecognitionService.java | 124 - .../optical_char_recognition/v1/V1.java | 29 + .../v1/resource/Image.java | 107 + .../service/passport/PassportService.java | 35 + .../service/passport/v1/PassportService.java | 122 - .../com/lark/oapi/service/passport/v1/V1.java | 29 + .../service/passport/v1/resource/Session.java | 105 + .../PersonalSettingsService.java | 35 + .../v1/PersonalSettingsService.java | 457 -- .../oapi/service/personal_settings/v1/V1.java | 29 + .../v1/resource/SystemStatus.java | 440 ++ .../oapi/service/search/SearchService.java | 59 + .../oapi/service/search/v2/SearchService.java | 1055 --- .../com/lark/oapi/service/search/v2/V2.java | 53 + .../search/v2/model/SeperatePassage.java | 185 + .../oapi/service/search/v2/resource/App.java | 105 + .../search/v2/resource/DataSource.java | 368 + .../search/v2/resource/DataSourceItem.java | 236 + .../service/search/v2/resource/Message.java | 105 + .../service/search/v2/resource/Schema.java | 302 + .../SecurityAndComplianceService.java | 35 + .../v1/SecurityAndComplianceService.java | 122 - .../security_and_compliance/v1/V1.java | 29 + .../CreateMigrationEntityLocationEnum.java | 33 + .../CreateMigrationItemsTaskStatusEnum.java | 33 + ...serStructDataArchivingChatterTypeEnum.java | 35 + .../DirectoryItemsEntityLocationEnum.java | 33 + .../enums/DirectoryItemsEntityTypeEnum.java | 42 + .../enums/MigrationEntityCreatorTypeEnum.java | 32 + .../v1/enums/MigrationEntityLocationEnum.java | 33 + .../v1/enums/MigrationEntityTypeEnum.java | 42 + .../enums/MigrationItemsTaskStatusEnum.java | 33 + .../v1/model/CreateMigrationEntity.java | 197 + .../v1/model/CreateMigrationItems.java | 160 + .../v1/model/DataArchivingMessage.java | 111 + .../v1/model/DataArchivingMessageStruct.java | 555 ++ .../v1/model/DataArchivingUser.java | 74 + .../v1/model/DataArchivingUserStruct.java | 160 + .../v1/model/DirectoryItems.java | 246 + .../v1/model/GwResponse.java | 8 +- .../v1/model/MigrationEntity.java | 332 + .../v1/model/MigrationItems.java | 197 + .../v1/resource/OpenapiLog.java | 105 + .../oapi/service/sheets/SheetsService.java | 65 + .../oapi/service/sheets/v3/SheetsService.java | 1956 ----- .../com/lark/oapi/service/sheets/v3/V3.java | 59 + .../sheets/v3/resource/Spreadsheet.java | 236 + .../sheets/v3/resource/SpreadsheetSheet.java | 368 + .../v3/resource/SpreadsheetSheetFilter.java | 306 + .../resource/SpreadsheetSheetFilterView.java | 372 + .../SpreadsheetSheetFilterViewCondition.java | 376 + .../resource/SpreadsheetSheetFloatImage.java | 376 + .../speech_to_text/SpeechToTextService.java | 35 + .../v1/SpeechToTextService.java | 194 - .../oapi/service/speech_to_text/v1/V1.java | 29 + .../speech_to_text/v1/resource/Speech.java | 177 + .../lark/oapi/service/task/TaskService.java | 91 + .../oapi/service/task/v1/TaskService.java | 1670 ---- .../com/lark/oapi/service/task/v1/V1.java | 53 + .../v1/model/DeleteTaskCollaboratorReq.java | 1 + .../task/v1/model/DeleteTaskFollowerReq.java | 1 + .../task/v1/model/GetTaskCommentReq.java | 1 + .../task/v1/model/UpdateTaskCommentReq.java | 1 + .../oapi/service/task/v1/resource/Task.java | 632 ++ .../task/v1/resource/TaskCollaborator.java | 236 + .../service/task/v1/resource/TaskComment.java | 368 + .../task/v1/resource/TaskFollower.java | 236 + .../task/v1/resource/TaskReminder.java | 236 + .../com/lark/oapi/service/task/v2/V2.java | 77 + .../v2/enums/CreateCustomFieldTypeEnum.java | 36 + .../CreateCustomFieldUserIdTypeEnum.java | 33 + ...istActivitySubscriptionUserIdTypeEnum.java | 33 + .../enums/GetCustomFieldUserIdTypeEnum.java | 33 + ...istActivitySubscriptionUserIdTypeEnum.java | 33 + .../v2/enums/InputCustomFieldTypeEnum.java | 36 + .../v2/enums/ListCommentDirectionEnum.java | 32 + .../enums/ListCustomFieldUserIdTypeEnum.java | 33 + ...istActivitySubscriptionUserIdTypeEnum.java | 33 + ...NumberSettingCustomSymbolPositionEnum.java | 32 + .../v2/enums/NumberSettingFormatEnum.java | 35 + .../v2/enums/NumberSettingSeparatorEnum.java | 32 + .../enums/PatchCustomFieldUserIdTypeEnum.java | 33 + ...istActivitySubscriptionUserIdTypeEnum.java | 33 + .../PatchTasklistOriginOwnerToRoleEnum.java | 33 + .../TaskDependencyDependencyTypeEnum.java | 32 + .../service/task/v2/enums/TaskSourceEnum.java | 36 + .../enums/UploadAttachmentUserIdTypeEnum.java | 33 + .../service/task/v2/model/ActivityRecord.java | 296 + .../task/v2/model/AddCustomFieldReq.java | 100 + .../task/v2/model/AddCustomFieldReqBody.java | 111 + .../task/v2/model/AddCustomFieldResp.java | 20 + .../task/v2/model/AddDependenciesTaskReq.java | 100 + .../v2/model/AddDependenciesTaskReqBody.java | 74 + .../v2/model/AddDependenciesTaskResp.java | 19 + .../v2/model/AddDependenciesTaskRespBody.java | 34 + .../task/v2/model/AddMembersTaskReq.java | 133 + .../task/v2/model/AddMembersTaskReqBody.java | 111 + .../task/v2/model/AddMembersTaskResp.java | 19 + .../task/v2/model/AddMembersTaskRespBody.java | 34 + .../task/v2/model/AddMembersTasklistReq.java | 133 + .../v2/model/AddMembersTasklistReqBody.java | 74 + .../task/v2/model/AddMembersTasklistResp.java | 19 + .../v2/model/AddMembersTasklistRespBody.java | 34 + .../task/v2/model/AddRemindersTaskReq.java | 133 + .../v2/model/AddRemindersTaskReqBody.java | 74 + .../task/v2/model/AddRemindersTaskResp.java | 19 + .../v2/model/AddRemindersTaskRespBody.java | 34 + .../task/v2/model/AddTasklistTaskReq.java | 133 + .../task/v2/model/AddTasklistTaskReqBody.java | 111 + .../task/v2/model/AddTasklistTaskResp.java | 19 + .../v2/model/AddTasklistTaskRespBody.java | 34 + .../service/task/v2/model/Attachment.java | 370 + .../oapi/service/task/v2/model/Comment.java | 333 + .../task/v2/model/CreateCommentReq.java | 99 + .../task/v2/model/CreateCommentResp.java | 19 + .../task/v2/model/CreateCommentRespBody.java | 34 + .../v2/model/CreateCustomFieldOptionReq.java | 100 + .../v2/model/CreateCustomFieldOptionResp.java | 19 + .../CreateCustomFieldOptionRespBody.java | 34 + .../task/v2/model/CreateCustomFieldReq.java | 111 + .../task/v2/model/CreateCustomFieldResp.java | 19 + .../v2/model/CreateCustomFieldRespBody.java | 34 + .../task/v2/model/CreateSectionReq.java | 99 + .../task/v2/model/CreateSectionResp.java | 19 + .../task/v2/model/CreateSectionRespBody.java | 34 + .../service/task/v2/model/CreateTaskReq.java | 99 + .../service/task/v2/model/CreateTaskResp.java | 19 + .../task/v2/model/CreateTaskRespBody.java | 34 + .../task/v2/model/CreateTaskSubtaskReq.java | 133 + .../task/v2/model/CreateTaskSubtaskResp.java | 19 + .../v2/model/CreateTaskSubtaskRespBody.java | 34 + ...CreateTasklistActivitySubscriptionReq.java | 145 + ...reateTasklistActivitySubscriptionResp.java | 19 + ...eTasklistActivitySubscriptionRespBody.java | 34 + .../task/v2/model/CreateTasklistReq.java | 99 + .../task/v2/model/CreateTasklistResp.java | 19 + .../task/v2/model/CreateTasklistRespBody.java | 34 + .../service/task/v2/model/CustomComplete.java | 148 + .../task/v2/model/CustomCompleteItem.java | 111 + .../service/task/v2/model/CustomField.java | 481 ++ .../task/v2/model/CustomFieldValue.java | 370 + .../task/v2/model/DatetimeSetting.java | 74 + .../task/v2/model/DeleteAttachmentReq.java | 72 + .../task/v2/model/DeleteAttachmentResp.java | 20 + .../task/v2/model/DeleteCommentReq.java | 72 + .../task/v2/model/DeleteCommentResp.java | 20 + .../task/v2/model/DeleteSectionReq.java | 72 + .../task/v2/model/DeleteSectionResp.java | 20 + .../service/task/v2/model/DeleteTaskReq.java | 72 + .../service/task/v2/model/DeleteTaskResp.java | 20 + ...DeleteTasklistActivitySubscriptionReq.java | 106 + ...eleteTasklistActivitySubscriptionResp.java | 20 + .../task/v2/model/DeleteTasklistReq.java | 72 + .../task/v2/model/DeleteTasklistResp.java | 20 + .../service/task/v2/model/DepartmentId.java | 105 + .../service/task/v2/model/DocxSource.java | 111 + .../lark/oapi/service/task/v2/model/Due.java | 111 + .../oapi/service/task/v2/model/Dummy.java | 74 + .../task/v2/model/GetAttachmentReq.java | 105 + .../task/v2/model/GetAttachmentResp.java | 19 + .../task/v2/model/GetAttachmentRespBody.java | 34 + .../service/task/v2/model/GetCommentReq.java | 105 + .../service/task/v2/model/GetCommentResp.java | 19 + .../task/v2/model/GetCommentRespBody.java | 34 + .../task/v2/model/GetCustomFieldReq.java | 117 + .../task/v2/model/GetCustomFieldResp.java | 19 + .../task/v2/model/GetCustomFieldRespBody.java | 34 + .../service/task/v2/model/GetSectionReq.java | 105 + .../service/task/v2/model/GetSectionResp.java | 19 + .../task/v2/model/GetSectionRespBody.java | 34 + .../service/task/v2/model/GetTaskReq.java | 105 + .../service/task/v2/model/GetTaskResp.java | 19 + .../task/v2/model/GetTaskRespBody.java | 34 + .../GetTasklistActivitySubscriptionReq.java | 151 + .../GetTasklistActivitySubscriptionResp.java | 19 + ...tTasklistActivitySubscriptionRespBody.java | 34 + .../service/task/v2/model/GetTasklistReq.java | 105 + .../task/v2/model/GetTasklistResp.java | 19 + .../task/v2/model/GetTasklistRespBody.java | 34 + .../lark/oapi/service/task/v2/model/Href.java | 111 + .../oapi/service/task/v2/model/I18nText.java | 481 ++ .../task/v2/model/InputAttachment.java | 148 + .../service/task/v2/model/InputComment.java | 185 + .../task/v2/model/InputCustomField.java | 419 + .../task/v2/model/InputCustomFieldValue.java | 296 + .../service/task/v2/model/InputOption.java | 222 + .../service/task/v2/model/InputSection.java | 222 + .../oapi/service/task/v2/model/InputTask.java | 666 ++ .../service/task/v2/model/InputTasklist.java | 185 + .../task/v2/model/ListAttachmentReq.java | 208 + .../task/v2/model/ListAttachmentResp.java | 19 + .../task/v2/model/ListAttachmentRespBody.java | 62 + .../service/task/v2/model/ListCommentReq.java | 254 + .../task/v2/model/ListCommentResp.java | 19 + .../task/v2/model/ListCommentRespBody.java | 62 + .../task/v2/model/ListCustomFieldReq.java | 220 + .../task/v2/model/ListCustomFieldResp.java | 19 + .../v2/model/ListCustomFieldRespBody.java | 62 + .../service/task/v2/model/ListSectionReq.java | 208 + .../task/v2/model/ListSectionResp.java | 19 + .../task/v2/model/ListSectionRespBody.java | 62 + .../service/task/v2/model/ListTaskReq.java | 208 + .../service/task/v2/model/ListTaskResp.java | 19 + .../task/v2/model/ListTaskRespBody.java | 62 + .../task/v2/model/ListTaskSubtaskReq.java | 171 + .../task/v2/model/ListTaskSubtaskResp.java | 19 + .../v2/model/ListTaskSubtaskRespBody.java | 62 + .../ListTasklistActivitySubscriptionReq.java | 150 + .../ListTasklistActivitySubscriptionResp.java | 19 + ...tTasklistActivitySubscriptionRespBody.java | 34 + .../task/v2/model/ListTasklistReq.java | 140 + .../task/v2/model/ListTasklistResp.java | 19 + .../task/v2/model/ListTasklistRespBody.java | 62 + .../oapi/service/task/v2/model/Member.java | 185 + .../service/task/v2/model/MemberSetting.java | 74 + .../service/task/v2/model/NumberSetting.java | 258 + .../oapi/service/task/v2/model/Option.java | 185 + .../oapi/service/task/v2/model/Origin.java | 111 + .../task/v2/model/PatchCommentReq.java | 133 + .../task/v2/model/PatchCommentReqBody.java | 111 + .../task/v2/model/PatchCommentResp.java | 19 + .../task/v2/model/PatchCommentRespBody.java | 34 + .../v2/model/PatchCustomFieldOptionReq.java | 133 + .../model/PatchCustomFieldOptionReqBody.java | 111 + .../v2/model/PatchCustomFieldOptionResp.java | 19 + .../model/PatchCustomFieldOptionRespBody.java | 34 + .../task/v2/model/PatchCustomFieldReq.java | 145 + .../v2/model/PatchCustomFieldReqBody.java | 111 + .../task/v2/model/PatchCustomFieldResp.java | 19 + .../v2/model/PatchCustomFieldRespBody.java | 34 + .../task/v2/model/PatchSectionReq.java | 133 + .../task/v2/model/PatchSectionReqBody.java | 111 + .../task/v2/model/PatchSectionResp.java | 19 + .../task/v2/model/PatchSectionRespBody.java | 34 + .../service/task/v2/model/PatchTaskReq.java | 133 + .../task/v2/model/PatchTaskReqBody.java | 111 + .../service/task/v2/model/PatchTaskResp.java | 19 + .../task/v2/model/PatchTaskRespBody.java | 34 + .../PatchTasklistActivitySubscriptionReq.java | 178 + ...chTasklistActivitySubscriptionReqBody.java | 111 + ...PatchTasklistActivitySubscriptionResp.java | 19 + ...hTasklistActivitySubscriptionRespBody.java | 34 + .../task/v2/model/PatchTasklistReq.java | 133 + .../task/v2/model/PatchTasklistReqBody.java | 160 + .../task/v2/model/PatchTasklistResp.java | 19 + .../task/v2/model/PatchTasklistRespBody.java | 34 + .../oapi/service/task/v2/model/Reminder.java | 111 + .../task/v2/model/RemoveCustomFieldReq.java | 100 + .../v2/model/RemoveCustomFieldReqBody.java | 111 + .../task/v2/model/RemoveCustomFieldResp.java | 20 + .../v2/model/RemoveDependenciesTaskReq.java | 100 + .../model/RemoveDependenciesTaskReqBody.java | 74 + .../v2/model/RemoveDependenciesTaskResp.java | 19 + .../model/RemoveDependenciesTaskRespBody.java | 34 + .../task/v2/model/RemoveMembersTaskReq.java | 133 + .../v2/model/RemoveMembersTaskReqBody.java | 74 + .../task/v2/model/RemoveMembersTaskResp.java | 19 + .../v2/model/RemoveMembersTaskRespBody.java | 34 + .../v2/model/RemoveMembersTasklistReq.java | 133 + .../model/RemoveMembersTasklistReqBody.java | 74 + .../v2/model/RemoveMembersTasklistResp.java | 19 + .../model/RemoveMembersTasklistRespBody.java | 34 + .../task/v2/model/RemoveRemindersTaskReq.java | 133 + .../v2/model/RemoveRemindersTaskReqBody.java | 74 + .../v2/model/RemoveRemindersTaskResp.java | 19 + .../v2/model/RemoveRemindersTaskRespBody.java | 34 + .../task/v2/model/RemoveTasklistTaskReq.java | 133 + .../v2/model/RemoveTasklistTaskReqBody.java | 74 + .../task/v2/model/RemoveTasklistTaskResp.java | 19 + .../v2/model/RemoveTasklistTaskRespBody.java | 34 + .../oapi/service/task/v2/model/Resource.java | 111 + .../oapi/service/task/v2/model/Section.java | 333 + .../service/task/v2/model/SectionSummary.java | 148 + .../service/task/v2/model/SelectSetting.java | 74 + .../oapi/service/task/v2/model/Start.java | 111 + .../lark/oapi/service/task/v2/model/Task.java | 1048 +++ .../service/task/v2/model/TaskDependency.java | 123 + .../task/v2/model/TaskInTasklistInfo.java | 111 + .../service/task/v2/model/TaskStatistics.java | 148 + .../service/task/v2/model/TaskSubtask.java | 35 + .../service/task/v2/model/TaskSummary.java | 296 + .../oapi/service/task/v2/model/Tasklist.java | 333 + .../model/TasklistActivitySubscription.java | 222 + .../task/v2/model/TasklistSummary.java | 111 + .../task/v2/model/TasklistsTaskReq.java | 72 + .../task/v2/model/TasklistsTaskResp.java | 19 + .../task/v2/model/TasklistsTaskRespBody.java | 34 + .../task/v2/model/TasksSectionReq.java | 270 + .../task/v2/model/TasksSectionResp.java | 19 + .../task/v2/model/TasksSectionRespBody.java | 62 + .../task/v2/model/TasksTasklistReq.java | 270 + .../task/v2/model/TasksTasklistResp.java | 19 + .../task/v2/model/TasksTasklistRespBody.java | 62 + .../service/task/v2/model/TextSetting.java | 35 + .../task/v2/model/UploadAttachmentReq.java | 111 + .../task/v2/model/UploadAttachmentResp.java | 19 + .../v2/model/UploadAttachmentRespBody.java | 34 + .../service/task/v2/resource/Attachment.java | 304 + .../service/task/v2/resource/Comment.java | 368 + .../service/task/v2/resource/CustomField.java | 434 ++ .../task/v2/resource/CustomFieldOption.java | 173 + .../service/task/v2/resource/Section.java | 434 ++ .../oapi/service/task/v2/resource/Task.java | 962 +++ .../service/task/v2/resource/TaskSubtask.java | 173 + .../service/task/v2/resource/Tasklist.java | 566 ++ .../TasklistActivitySubscription.java | 368 + .../oapi/service/tenant/TenantService.java | 42 + .../oapi/service/tenant/v2/TenantService.java | 205 - .../com/lark/oapi/service/tenant/v2/V2.java | 36 + .../service/tenant/v2/resource/Tenant.java | 104 + .../v2/resource/TenantProductAssignInfo.java | 102 + .../translation/TranslationService.java | 35 + .../translation/v1/TranslationService.java | 194 - .../lark/oapi/service/translation/v1/V1.java | 29 + .../service/translation/v1/resource/Text.java | 177 + .../com/lark/oapi/service/vc/VcService.java | 274 + .../java/com/lark/oapi/service/vc/v1/V1.java | 131 + .../lark/oapi/service/vc/v1/VcService.java | 4252 ----------- .../GetMeetingListMeetingStatusTypeEnum.java | 32 + ...tParticipantListMeetingStatusTypeEnum.java | 32 + ...eetingListExportMeetingStatusTypeEnum.java | 32 + ...cipantListExportMeetingStatusTypeEnum.java | 32 + .../vc/v1/model/GetMeetingListReq.java | 46 + .../vc/v1/model/GetParticipantListReq.java | 54 +- .../vc/v1/model/MeetingListExportReqBody.java | 49 + .../vc/v1/model/MyAiRoomOpenapiResponse.java | 37 + .../model/ParticipantListExportReqBody.java | 49 + .../oapi/service/vc/v1/resource/Alert.java | 105 + .../oapi/service/vc/v1/resource/Export.java | 456 ++ .../oapi/service/vc/v1/resource/Meeting.java | 442 ++ .../service/vc/v1/resource/MeetingList.java | 105 + .../vc/v1/resource/MeetingRecording.java | 310 + .../vc/v1/resource/ParticipantList.java | 105 + .../v1/resource/ParticipantQualityList.java | 105 + .../oapi/service/vc/v1/resource/Report.java | 177 + .../oapi/service/vc/v1/resource/Reserve.java | 378 + .../service/vc/v1/resource/ReserveConfig.java | 173 + .../vc/v1/resource/ReserveConfigAdmin.java | 173 + .../resource/ReserveConfigDisableInform.java | 173 + .../vc/v1/resource/ReserveConfigForm.java | 173 + .../v1/resource/ResourceReservationList.java | 105 + .../oapi/service/vc/v1/resource/Room.java | 500 ++ .../service/vc/v1/resource/RoomConfig.java | 302 + .../service/vc/v1/resource/RoomLevel.java | 500 ++ .../service/vc/v1/resource/ScopeConfig.java | 173 + .../lark/oapi/service/wiki/WikiService.java | 59 + .../com/lark/oapi/service/wiki/v2/V2.java | 53 + .../oapi/service/wiki/v2/WikiService.java | 1083 --- .../v2/enums/CreateSpaceNodeObjTypeEnum.java | 1 + ...ikiSpaceNodeMoveDocsToWikiObjTypeEnum.java | 1 + .../wiki/v2/enums/NodeObjTypeEnum.java | 1 + .../MoveDocsToWikiSpaceNodeRespBody.java | 4 +- .../oapi/service/wiki/v2/resource/Space.java | 310 + .../service/wiki/v2/resource/SpaceMember.java | 177 + .../service/wiki/v2/resource/SpaceNode.java | 446 ++ .../wiki/v2/resource/SpaceSetting.java | 107 + .../oapi/service/wiki/v2/resource/Task.java | 107 + .../service/workplace/WorkplaceService.java | 49 + .../lark/oapi/service/workplace/v1/V1.java | 43 + .../workplace/v1/WorkplaceService.java | 291 - .../resource/CustomWorkplaceAccessData.java | 105 + .../v1/resource/WorkplaceAccessData.java | 105 + .../v1/resource/WorkplaceBlockAccessData.java | 105 + .../lark/oapi/event/TestEventDispatcher.java | 4 +- sample/pom.xml | 2 +- .../GetAccessRecordAccessPhotoSample.java | 2 +- .../apiall/acsv1/GetUserFaceSample.java | 2 +- .../sample/apiall/acsv1/GetUserSample.java | 2 +- .../apiall/acsv1/ListAccessRecordSample.java | 2 +- .../sample/apiall/acsv1/ListUserSample.java | 2 +- .../sample/apiall/acsv1/PatchUserSample.java | 2 +- .../apiall/acsv1/UpdateUserFaceSample.java | 2 +- .../adminv1/CreateBadgeGrantSample.java | 2 +- .../adminv1/CreateBadgeImageSample.java | 2 +- .../apiall/adminv1/CreateBadgeSample.java | 2 +- .../adminv1/DeleteBadgeGrantSample.java | 2 +- .../apiall/adminv1/GetBadgeGrantSample.java | 2 +- .../sample/apiall/adminv1/GetBadgeSample.java | 2 +- .../adminv1/ListAdminDeptStatSample.java | 2 +- .../adminv1/ListAdminUserStatSample.java | 2 +- .../apiall/adminv1/ListAuditInfoSample.java | 41 + .../apiall/adminv1/ListBadgeGrantSample.java | 2 +- .../apiall/adminv1/ListBadgeSample.java | 2 +- .../apiall/adminv1/ResetPasswordSample.java | 2 +- .../adminv1/UpdateBadgeGrantSample.java | 2 +- .../apiall/adminv1/UpdateBadgeSample.java | 2 +- ...eBlackListApplicationVisibilitySample.java | 2 +- ...tsRangeConfigurationApplicationSample.java | 2 +- ...ngeSuggestApplicationAppVersionSample.java | 2 +- ...mentOverviewApplicationAppUsageSample.java | 2 +- .../GetApplicationAppVersionSample.java | 2 +- .../applicationv6/GetApplicationSample.java | 2 +- .../ListAppRecommendRuleSample.java | 2 +- .../ListApplicationAppVersionSample.java | 2 +- .../ListApplicationFeedbackSample.java | 2 +- .../OverviewApplicationAppUsageSample.java | 2 +- .../PatchApplicationAppVersionSample.java | 2 +- .../PatchApplicationContactsRangeSample.java | 2 +- .../PatchApplicationFeedbackSample.java | 2 +- .../applicationv6/PatchApplicationSample.java | 2 +- .../PatchApplicationVisibilitySample.java | 2 +- .../applicationv6/SetAppBadgeSample.java | 2 +- .../UnderauditlistApplicationSample.java | 2 +- .../approvalv4/AddSignInstanceSample.java | 2 +- .../apiall/approvalv4/ApproveTaskSample.java | 2 +- .../approvalv4/CancelInstanceSample.java | 2 +- .../apiall/approvalv4/CcInstanceSample.java | 2 +- .../CheckExternalInstanceSample.java | 2 +- .../approvalv4/CreateApprovalSample.java | 2 +- .../CreateExternalApprovalSample.java | 2 +- .../CreateExternalInstanceSample.java | 2 +- .../CreateInstanceCommentSample.java | 2 +- .../approvalv4/CreateInstanceSample.java | 2 +- .../DeleteInstanceCommentSample.java | 2 +- .../apiall/approvalv4/GetApprovalSample.java | 2 +- .../approvalv4/GetExternalApprovalSample.java | 2 +- .../apiall/approvalv4/GetInstanceSample.java | 2 +- .../approvalv4/ListExternalTaskSample.java | 2 +- .../approvalv4/ListInstanceCommentSample.java | 2 +- .../apiall/approvalv4/ListInstanceSample.java | 2 +- .../approvalv4/PreviewInstanceSample.java | 2 +- .../approvalv4/QueryInstanceSample.java | 2 +- .../apiall/approvalv4/QueryTaskSample.java | 2 +- .../apiall/approvalv4/RejectTaskSample.java | 2 +- .../RemoveInstanceCommentSample.java | 2 +- .../apiall/approvalv4/ResubmitTaskSample.java | 2 +- .../approvalv4/SearchCcInstanceSample.java | 2 +- .../apiall/approvalv4/SearchTaskSample.java | 2 +- .../SpecifiedRollbackInstanceSample.java | 2 +- .../approvalv4/SubscribeApprovalSample.java | 2 +- .../apiall/approvalv4/TransferTaskSample.java | 2 +- .../approvalv4/UnsubscribeApprovalSample.java | 2 +- .../BatchCreateUserDailyShiftSample.java | 2 +- .../BatchCreateUserFlowSample.java | 2 +- .../attendancev1/CreateGroupSample.java | 2 +- .../attendancev1/CreateShiftSample.java | 2 +- .../CreateUserApprovalSample.java | 2 +- .../CreateUserTaskRemedySample.java | 2 +- .../attendancev1/DeleteGroupSample.java | 2 +- .../attendancev1/DeleteShiftSample.java | 2 +- .../attendancev1/DownloadFileSample.java | 2 +- .../apiall/attendancev1/GetGroupSample.java | 2 +- .../GetLeaveEmployExpireRecordSample.java | 2 +- .../apiall/attendancev1/GetShiftSample.java | 2 +- .../attendancev1/GetUserFlowSample.java | 2 +- .../apiall/attendancev1/ListGroupSample.java | 2 +- .../apiall/attendancev1/ListShiftSample.java | 2 +- .../attendancev1/ModifyUserSettingSample.java | 2 +- .../PatchLeaveAccrualRecordSample.java | 2 +- .../ProcessApprovalInfoSample.java | 2 +- .../apiall/attendancev1/QueryShiftSample.java | 2 +- ...serAllowedRemedysUserTaskRemedySample.java | 2 +- .../attendancev1/QueryUserApprovalSample.java | 2 +- .../QueryUserDailyShiftSample.java | 2 +- .../attendancev1/QueryUserFlowSample.java | 2 +- .../attendancev1/QueryUserSettingSample.java | 2 +- .../QueryUserStatsDataSample.java | 2 +- .../QueryUserStatsFieldSample.java | 2 +- .../QueryUserStatsViewSample.java | 2 +- .../QueryUserTaskRemedySample.java | 2 +- .../attendancev1/QueryUserTaskSample.java | 2 +- .../attendancev1/SearchGroupSample.java | 2 +- .../UpdateUserStatsViewSample.java | 2 +- .../apiall/attendancev1/UploadFileSample.java | 2 +- .../authenv1/CreateAccessTokenSample.java | 2 +- .../authenv1/CreateOidcAccessTokenSample.java | 2 +- .../CreateOidcRefreshAccessTokenSample.java | 2 +- .../CreateRefreshAccessTokenSample.java | 2 +- .../authv3/CreateAppAccessTokenSample.java | 2 +- .../authv3/CreateTenantAccessTokenSample.java | 2 +- .../authv3/InternalAppAccessTokenSample.java | 2 +- .../InternalTenantAccessTokenSample.java | 2 +- .../apiall/authv3/ResendAppTicketSample.java | 2 +- .../apiall/baikev1/CreateDraftSample.java | 2 +- .../apiall/baikev1/CreateEntitySample.java | 2 +- .../apiall/baikev1/DownloadFileSample.java | 2 +- .../apiall/baikev1/ExtractEntitySample.java | 2 +- .../apiall/baikev1/GetEntitySample.java | 2 +- .../apiall/baikev1/HighlightEntitySample.java | 2 +- .../baikev1/ListClassificationSample.java | 2 +- .../apiall/baikev1/ListEntitySample.java | 2 +- .../apiall/baikev1/MatchEntitySample.java | 2 +- .../apiall/baikev1/SearchEntitySample.java | 2 +- .../apiall/baikev1/UpdateDraftSample.java | 2 +- .../apiall/baikev1/UpdateEntitySample.java | 2 +- .../apiall/baikev1/UploadFileSample.java | 2 +- .../BatchCreateAppRoleMemberSample.java | 2 +- .../BatchCreateAppTableRecordSample.java | 2 +- .../bitablev1/BatchCreateAppTableSample.java | 2 +- .../BatchDeleteAppRoleMemberSample.java | 2 +- .../BatchDeleteAppTableRecordSample.java | 2 +- .../bitablev1/BatchDeleteAppTableSample.java | 2 +- .../BatchUpdateAppTableRecordSample.java | 2 +- .../bitablev1/CopyAppDashboardSample.java | 2 +- .../apiall/bitablev1/CopyAppSample.java | 2 +- .../bitablev1/CreateAppRoleMemberSample.java | 2 +- .../apiall/bitablev1/CreateAppRoleSample.java | 2 +- .../apiall/bitablev1/CreateAppSample.java | 2 +- .../bitablev1/CreateAppTableFieldSample.java | 2 +- .../bitablev1/CreateAppTableRecordSample.java | 2 +- .../bitablev1/CreateAppTableSample.java | 2 +- .../bitablev1/CreateAppTableViewSample.java | 2 +- .../bitablev1/DeleteAppRoleMemberSample.java | 2 +- .../apiall/bitablev1/DeleteAppRoleSample.java | 2 +- .../bitablev1/DeleteAppTableFieldSample.java | 2 +- .../bitablev1/DeleteAppTableRecordSample.java | 2 +- .../bitablev1/DeleteAppTableSample.java | 2 +- .../bitablev1/DeleteAppTableViewSample.java | 2 +- .../sample/apiall/bitablev1/GetAppSample.java | 2 +- .../bitablev1/GetAppTableFormSample.java | 2 +- .../bitablev1/GetAppTableRecordSample.java | 2 +- .../bitablev1/GetAppTableViewSample.java | 2 +- .../bitablev1/ListAppDashboardSample.java | 2 +- .../bitablev1/ListAppRoleMemberSample.java | 2 +- .../apiall/bitablev1/ListAppRoleSample.java | 2 +- .../bitablev1/ListAppTableFieldSample.java | 2 +- .../ListAppTableFormFieldSample.java | 2 +- .../bitablev1/ListAppTableRecordSample.java | 2 +- .../apiall/bitablev1/ListAppTableSample.java | 2 +- .../bitablev1/ListAppTableViewSample.java | 2 +- .../PatchAppTableFormFieldSample.java | 2 +- .../bitablev1/PatchAppTableFormSample.java | 2 +- .../apiall/bitablev1/PatchAppTableSample.java | 2 +- .../bitablev1/PatchAppTableViewSample.java | 2 +- .../apiall/bitablev1/UpdateAppRoleSample.java | 2 +- .../apiall/bitablev1/UpdateAppSample.java | 2 +- .../bitablev1/UpdateAppTableFieldSample.java | 2 +- .../bitablev1/UpdateAppTableRecordSample.java | 2 +- .../apiall/blockv2/CreateEntitySample.java | 2 +- .../apiall/blockv2/CreateMessageSample.java | 2 +- .../apiall/blockv2/UpdateEntitySample.java | 2 +- ...atchDeleteCalendarEventAttendeeSample.java | 2 +- .../calendarv4/CreateCalendarAclSample.java | 2 +- .../CreateCalendarEventAttendeeSample.java | 2 +- .../CreateCalendarEventMeetingChatSample.java | 2 +- .../calendarv4/CreateCalendarEventSample.java | 2 +- .../calendarv4/CreateCalendarSample.java | 2 +- .../CreateExchangeBindingSample.java | 2 +- .../calendarv4/CreateTimeoffEventSample.java | 2 +- .../calendarv4/DeleteCalendarAclSample.java | 2 +- .../DeleteCalendarEventMeetingChatSample.java | 2 +- .../calendarv4/DeleteCalendarEventSample.java | 2 +- .../calendarv4/DeleteCalendarSample.java | 2 +- .../DeleteExchangeBindingSample.java | 2 +- .../calendarv4/DeleteTimeoffEventSample.java | 2 +- .../GenerateCaldavConfSettingSample.java | 2 +- .../calendarv4/GetCalendarEventSample.java | 2 +- .../apiall/calendarv4/GetCalendarSample.java | 2 +- .../calendarv4/GetExchangeBindingSample.java | 2 +- .../calendarv4/ListCalendarAclSample.java | 2 +- ...CalendarEventAttendeeChatMemberSample.java | 2 +- .../ListCalendarEventAttendeeSample.java | 2 +- .../calendarv4/ListCalendarEventSample.java | 3 +- .../apiall/calendarv4/ListCalendarSample.java | 2 +- .../apiall/calendarv4/ListFreebusySample.java | 4 +- .../calendarv4/PatchCalendarEventSample.java | 2 +- .../calendarv4/PatchCalendarSample.java | 2 +- .../calendarv4/PrimaryCalendarSample.java | 2 +- .../calendarv4/SearchCalendarEventSample.java | 2 +- .../calendarv4/SearchCalendarSample.java | 2 +- .../calendarv4/SubscribeCalendarSample.java | 2 +- .../SubscriptionCalendarAclSample.java | 2 +- .../SubscriptionCalendarEventSample.java | 2 +- .../calendarv4/UnsubscribeCalendarSample.java | 2 +- .../UnsubscriptionCalendarAclSample.java | 2 +- .../UnsubscriptionCalendarEventSample.java | 2 +- .../contactv3/AddGroupMemberSample.java | 2 +- .../contactv3/BatchAddGroupMemberSample.java | 2 +- ...BatchCreateFunctionalRoleMemberSample.java | 2 +- ...BatchDeleteFunctionalRoleMemberSample.java | 2 +- .../contactv3/BatchDepartmentSample.java | 2 +- .../contactv3/BatchGetIdUserSample.java | 2 +- .../BatchRemoveGroupMemberSample.java | 2 +- .../apiall/contactv3/BatchUserSample.java | 2 +- .../contactv3/BindDepartmentUnitSample.java | 2 +- .../contactv3/ChildrenDepartmentSample.java | 2 +- .../contactv3/CreateDepartmentSample.java | 2 +- .../CreateEmployeeTypeEnumSample.java | 2 +- .../contactv3/CreateFunctionalRoleSample.java | 2 +- .../apiall/contactv3/CreateGroupSample.java | 2 +- .../contactv3/CreateJobFamilySample.java | 2 +- .../contactv3/CreateJobLevelSample.java | 2 +- .../apiall/contactv3/CreateUnitSample.java | 2 +- .../apiall/contactv3/CreateUserSample.java | 2 +- .../contactv3/DeleteDepartmentSample.java | 2 +- .../DeleteEmployeeTypeEnumSample.java | 2 +- .../contactv3/DeleteFunctionalRoleSample.java | 2 +- .../apiall/contactv3/DeleteGroupSample.java | 2 +- .../contactv3/DeleteJobFamilySample.java | 2 +- .../contactv3/DeleteJobLevelSample.java | 2 +- .../apiall/contactv3/DeleteUnitSample.java | 2 +- .../apiall/contactv3/DeleteUserSample.java | 2 +- .../contactv3/FindByDepartmentUserSample.java | 2 +- .../apiall/contactv3/GetDepartmentSample.java | 2 +- .../GetFunctionalRoleMemberSample.java | 2 +- .../apiall/contactv3/GetGroupSample.java | 2 +- .../apiall/contactv3/GetJobFamilySample.java | 2 +- .../apiall/contactv3/GetJobLevelSample.java | 2 +- .../apiall/contactv3/GetJobTitleSample.java | 2 +- .../apiall/contactv3/GetUnitSample.java | 2 +- .../apiall/contactv3/GetUserSample.java | 2 +- .../apiall/contactv3/GetWorkCitySample.java | 2 +- .../contactv3/ListCustomAttrSample.java | 2 +- .../contactv3/ListDepartmentSample.java | 2 +- .../contactv3/ListDepartmentUnitSample.java | 2 +- .../contactv3/ListEmployeeTypeEnumSample.java | 2 +- .../ListFunctionalRoleMemberSample.java | 2 +- .../apiall/contactv3/ListJobFamilySample.java | 2 +- .../apiall/contactv3/ListJobLevelSample.java | 2 +- .../apiall/contactv3/ListJobTitleSample.java | 2 +- .../apiall/contactv3/ListScopeSample.java | 2 +- .../apiall/contactv3/ListUnitSample.java | 2 +- .../apiall/contactv3/ListUserSample.java | 2 +- .../apiall/contactv3/ListWorkCitySample.java | 2 +- .../contactv3/MemberBelongGroupSample.java | 2 +- .../contactv3/ParentDepartmentSample.java | 2 +- .../contactv3/PatchDepartmentSample.java | 2 +- .../apiall/contactv3/PatchGroupSample.java | 2 +- .../apiall/contactv3/PatchUnitSample.java | 2 +- .../apiall/contactv3/PatchUserSample.java | 2 +- .../contactv3/RemoveGroupMemberSample.java | 2 +- .../apiall/contactv3/ResurrectUserSample.java | 2 +- .../ScopesFunctionalRoleMemberSample.java | 2 +- .../contactv3/SearchDepartmentSample.java | 2 +- .../SimplelistGroupMemberSample.java | 2 +- .../contactv3/SimplelistGroupSample.java | 2 +- .../UnbindDepartmentChatDepartmentSample.java | 2 +- .../contactv3/UnbindDepartmentUnitSample.java | 2 +- .../UpdateDepartmentIdDepartmentSample.java | 2 +- .../contactv3/UpdateDepartmentSample.java | 2 +- .../UpdateEmployeeTypeEnumSample.java | 2 +- .../contactv3/UpdateFunctionalRoleSample.java | 2 +- .../contactv3/UpdateJobFamilySample.java | 2 +- .../contactv3/UpdateJobLevelSample.java | 2 +- .../contactv3/UpdateUserIdUserSample.java | 2 +- .../apiall/contactv3/UpdateUserSample.java | 2 +- .../apiall/corehrv1/CreateCompanySample.java | 7 +- .../apiall/corehrv1/CreateContractSample.java | 3 +- .../corehrv1/CreateDepartmentSample.java | 4 +- .../corehrv1/CreateEmployeeTypeSample.java | 2 +- .../corehrv1/CreateEmploymentSample.java | 4 +- .../corehrv1/CreateJobChangeSample.java | 2 +- .../apiall/corehrv1/CreateJobDataSample.java | 4 +- .../corehrv1/CreateJobFamilySample.java | 2 +- .../apiall/corehrv1/CreateJobLevelSample.java | 2 +- .../apiall/corehrv1/CreateJobSample.java | 2 +- .../CreateLeaveGrantingRecordSample.java | 2 +- .../apiall/corehrv1/CreateLocationSample.java | 4 +- .../corehrv1/CreateNationalIdTypeSample.java | 4 +- .../CreateWorkingHoursTypeSample.java | 2 +- .../apiall/corehrv1/DeleteCompanySample.java | 2 +- .../apiall/corehrv1/DeleteContractSample.java | 2 +- .../corehrv1/DeleteDepartmentSample.java | 2 +- .../corehrv1/DeleteEmployeeTypeSample.java | 2 +- .../corehrv1/DeleteEmploymentSample.java | 2 +- .../apiall/corehrv1/DeleteJobDataSample.java | 2 +- .../corehrv1/DeleteJobFamilySample.java | 2 +- .../apiall/corehrv1/DeleteJobLevelSample.java | 2 +- .../apiall/corehrv1/DeleteJobSample.java | 2 +- .../DeleteLeaveGrantingRecordSample.java | 2 +- .../apiall/corehrv1/DeleteLocationSample.java | 2 +- .../corehrv1/DeleteNationalIdTypeSample.java | 2 +- .../apiall/corehrv1/DeletePersonSample.java | 2 +- .../apiall/corehrv1/DeletePreHireSample.java | 2 +- .../DeleteWorkingHoursTypeSample.java | 2 +- .../corehrv1/GetByParamCustomFieldSample.java | 2 +- .../apiall/corehrv1/GetCompanySample.java | 2 +- .../apiall/corehrv1/GetContractSample.java | 2 +- .../corehrv1/GetCountryRegionSample.java | 2 +- .../apiall/corehrv1/GetCurrencySample.java | 2 +- .../apiall/corehrv1/GetDepartmentSample.java | 2 +- .../corehrv1/GetEmployeeTypeSample.java | 2 +- .../sample/apiall/corehrv1/GetFileSample.java | 2 +- .../apiall/corehrv1/GetJobDataSample.java | 2 +- .../apiall/corehrv1/GetJobFamilySample.java | 2 +- .../apiall/corehrv1/GetJobLevelSample.java | 2 +- .../sample/apiall/corehrv1/GetJobSample.java | 2 +- .../apiall/corehrv1/GetLocationSample.java | 2 +- .../corehrv1/GetNationalIdTypeSample.java | 2 +- .../apiall/corehrv1/GetPersonSample.java | 2 +- .../apiall/corehrv1/GetPreHireSample.java | 2 +- .../GetProcessFormVariableDataSample.java | 2 +- .../apiall/corehrv1/GetSubdivisionSample.java | 2 +- .../apiall/corehrv1/GetSubregionSample.java | 2 +- .../corehrv1/GetWorkingHoursTypeSample.java | 2 +- .../corehrv1/LeaveBalancesLeaveSample.java | 2 +- .../LeaveRequestHistoryLeaveSample.java | 2 +- .../corehrv1/LeaveTypesLeaveSample.java | 2 +- .../apiall/corehrv1/ListCompanySample.java | 2 +- .../apiall/corehrv1/ListContractSample.java | 2 +- .../corehrv1/ListCountryRegionSample.java | 2 +- .../apiall/corehrv1/ListCurrencySample.java | 2 +- .../apiall/corehrv1/ListDepartmentSample.java | 2 +- .../corehrv1/ListEmployeeTypeSample.java | 2 +- .../apiall/corehrv1/ListJobDataSample.java | 2 +- .../apiall/corehrv1/ListJobFamilySample.java | 2 +- .../apiall/corehrv1/ListJobLevelSample.java | 2 +- .../sample/apiall/corehrv1/ListJobSample.java | 2 +- .../apiall/corehrv1/ListLocationSample.java | 2 +- .../corehrv1/ListNationalIdTypeSample.java | 2 +- .../ListObjectApiNameCustomFieldSample.java | 2 +- .../apiall/corehrv1/ListPreHireSample.java | 2 +- .../corehrv1/ListSecurityGroupSample.java | 2 +- .../corehrv1/ListSubdivisionSample.java | 2 +- .../apiall/corehrv1/ListSubregionSample.java | 2 +- .../corehrv1/ListWorkingHoursTypeSample.java | 2 +- .../MatchCompensationStandardSample.java | 2 +- .../apiall/corehrv1/PatchCompanySample.java | 50 + .../apiall/corehrv1/PatchContractSample.java | 8 +- .../corehrv1/PatchDepartmentSample.java | 4 +- .../corehrv1/PatchEmployeeTypeSample.java | 2 +- .../corehrv1/PatchEmploymentSample.java | 4 +- .../apiall/corehrv1/PatchJobDataSample.java | 4 +- .../apiall/corehrv1/PatchJobFamilySample.java | 2 +- .../apiall/corehrv1/PatchJobLevelSample.java | 2 +- .../apiall/corehrv1/PatchJobSample.java | 2 +- .../corehrv1/PatchNationalIdTypeSample.java | 4 +- .../apiall/corehrv1/PatchPreHireSample.java | 4 +- .../corehrv1/PatchWorkingHoursTypeSample.java | 2 +- .../corehrv1/QueryCustomFieldSample.java | 2 +- .../corehrv1/QueryOffboardingSample.java | 2 +- .../corehrv1/QuerySecurityGroupSample.java | 2 +- .../corehrv1/QueryTransferReasonSample.java | 2 +- .../corehrv1/QueryTransferTypeSample.java | 2 +- .../corehrv1/SearchAssignedUserSample.java | 2 +- .../corehrv1/SearchOffboardingSample.java | 2 +- .../corehrv1/SubmitOffboardingSample.java | 2 +- .../apiall/corehrv1/UploadPersonSample.java | 2 +- .../corehrv2/BatchGetCompanySample.java | 36 + .../corehrv2/BatchGetEmployeeSample.java | 41 + .../corehrv2/BatchGetEmployeesBpSample.java | 38 + .../BatchGetEmployeesJobDataSample.java | 42 + .../corehrv2/BatchGetJobFamilySample.java | 36 + .../corehrv2/BatchGetJobLevelSample.java | 36 + .../corehrv2/BatchGetLocationSample.java | 36 + .../apiall/corehrv2/CreatePersonSample.java | 66 + .../apiall/corehrv2/CreatePreHireSample.java | 38 + .../CreateProbationAssessmentSample.java | 40 + .../DeleteProbationAssessmentSample.java} | 19 +- ...nableDisableAssessmentProbationSample.java | 37 + .../corehrv2/GetByDepartmentBpSample.java | 38 + .../sample/apiall/corehrv2/GetJobSample.java | 33 + .../apiall/corehrv2/GetProcessSample.java | 34 + .../sample/apiall/corehrv2/ListBpSample.java | 36 + .../sample/apiall/corehrv2/ListJobSample.java | 36 + .../apiall/corehrv2/ListProcessSample.java | 38 + .../corehrv2/ParentsDepartmentSample.java | 37 + .../apiall/corehrv2/PatchPersonSample.java | 67 + .../PatchProbationAssessmentSample.java | 44 + .../corehrv2/QueryEmployeesJobDataSample.java | 43 + .../apiall/corehrv2/SearchContractSample.java | 40 + .../corehrv2/SearchDepartmentSample.java | 47 + .../apiall/corehrv2/SearchEmployeeSample.java | 61 + .../corehrv2/SearchJobChangeSample.java | 42 + .../corehrv2/SearchProbationSample.java | 52 + .../FieldExtractionContractSample.java | 2 +- .../RecognizeBankCardSample.java | 2 +- .../RecognizeBusinessCardSample.java | 2 +- .../RecognizeBusinessLicenseSample.java | 2 +- .../RecognizeChinesePassportSample.java | 2 +- .../RecognizeDrivingLicenseSample.java | 2 +- .../RecognizeFoodManageLicenseSample.java | 2 +- .../RecognizeFoodProduceLicenseSample.java | 2 +- ...ecognizeHkmMainlandTravelPermitSample.java | 2 +- .../document_aiv1/RecognizeIdCardSample.java | 2 +- .../RecognizeTaxiInvoiceSample.java | 2 +- .../RecognizeTrainInvoiceSample.java | 2 +- ...RecognizeTwMainlandTravelPermitSample.java | 2 +- .../RecognizeVatInvoiceSample.java | 2 +- .../RecognizeVehicleLicenseSample.java | 2 +- ...atchDeleteDocumentBlockChildrenSample.java | 2 +- .../BatchUpdateDocumentBlockSample.java | 2 +- .../CreateDocumentBlockChildrenSample.java | 2 +- .../apiall/docxv1/CreateDocumentSample.java | 2 +- .../GetDocumentBlockChildrenSample.java | 2 +- .../apiall/docxv1/GetDocumentBlockSample.java | 2 +- .../apiall/docxv1/GetDocumentSample.java | 2 +- .../docxv1/ListDocumentBlockSample.java | 2 +- .../docxv1/PatchDocumentBlockSample.java | 3 +- .../docxv1/RawContentDocumentSample.java | 2 +- .../drivev1/AuthPermissionMemberSample.java | 2 +- .../BatchGetTmpDownloadUrlMediaSample.java | 2 +- .../drivev1/BatchQueryFileCommentSample.java | 2 +- .../apiall/drivev1/BatchQueryMetaSample.java | 2 +- .../sample/apiall/drivev1/CopyFileSample.java | 2 +- .../drivev1/CreateExportTaskSample.java | 2 +- .../drivev1/CreateFileCommentSample.java | 2 +- .../drivev1/CreateFileSubscriptionSample.java | 2 +- .../drivev1/CreateFileVersionSample.java | 2 +- .../drivev1/CreateFolderFileSample.java | 2 +- .../drivev1/CreateImportTaskSample.java | 2 +- .../drivev1/CreatePermissionMemberSample.java | 2 +- .../CreatePermissionPublicPasswordSample.java | 2 +- .../drivev1/CreateShortcutFileSample.java | 2 +- .../drivev1/DeleteFileCommentReplySample.java | 2 +- .../apiall/drivev1/DeleteFileSample.java | 2 +- .../drivev1/DeleteFileVersionSample.java | 2 +- .../drivev1/DeletePermissionMemberSample.java | 2 +- .../DeletePermissionPublicPasswordSample.java | 2 +- .../drivev1/DeleteSubscribeFileSample.java | 2 +- .../drivev1/DownloadExportTaskSample.java | 2 +- .../apiall/drivev1/DownloadFileSample.java | 2 +- .../apiall/drivev1/DownloadMediaSample.java | 2 +- .../apiall/drivev1/GetExportTaskSample.java | 2 +- .../apiall/drivev1/GetFileCommentSample.java | 2 +- .../drivev1/GetFileStatisticsSample.java | 2 +- .../drivev1/GetFileSubscriptionSample.java | 2 +- .../apiall/drivev1/GetFileVersionSample.java | 2 +- .../apiall/drivev1/GetImportTaskSample.java | 2 +- .../drivev1/GetPermissionPublicSample.java | 2 +- .../drivev1/GetSubscribeFileSample.java | 2 +- .../drivev1/ListFileCommentReplySample.java | 2 +- .../apiall/drivev1/ListFileCommentSample.java | 2 +- .../sample/apiall/drivev1/ListFileSample.java | 2 +- .../apiall/drivev1/ListFileVersionSample.java | 2 +- .../drivev1/ListFileViewRecordSample.java | 2 +- .../drivev1/ListPermissionMemberSample.java | 2 +- .../sample/apiall/drivev1/MoveFileSample.java | 2 +- .../drivev1/PatchFileCommentSample.java | 2 +- .../drivev1/PatchFileSubscriptionSample.java | 2 +- .../drivev1/PatchPermissionPublicSample.java | 2 +- .../apiall/drivev1/SubscribeFileSample.java | 2 +- .../apiall/drivev1/TaskCheckFileSample.java | 2 +- .../TransferOwnerPermissionMemberSample.java | 2 +- .../drivev1/UpdateFileCommentReplySample.java | 2 +- .../drivev1/UpdatePermissionMemberSample.java | 2 +- .../UpdatePermissionPublicPasswordSample.java | 2 +- .../apiall/drivev1/UploadAllFileSample.java | 2 +- .../apiall/drivev1/UploadAllMediaSample.java | 2 +- .../drivev1/UploadFinishFileSample.java | 2 +- .../drivev1/UploadFinishMediaSample.java | 2 +- .../apiall/drivev1/UploadPartFileSample.java | 2 +- .../apiall/drivev1/UploadPartMediaSample.java | 2 +- .../drivev1/UploadPrepareFileSample.java | 2 +- .../drivev1/UploadPrepareMediaSample.java | 2 +- .../drivev2/GetPermissionPublicSample.java | 34 + .../drivev2/PatchPermissionPublicSample.java | 44 + .../apiall/ehrv1/GetAttachmentSample.java | 2 +- .../apiall/ehrv1/ListEmployeeSample.java | 2 +- .../apiall/eventv1/ListOutboundIpSample.java | 2 +- .../gray_test_open_sgv1/CreateMotoSample.java | 2 +- .../gray_test_open_sgv1/GetMotoSample.java | 2 +- .../gray_test_open_sgv1/ListMotoSample.java | 2 +- .../AnswerUserQueryTicketSample.java | 2 +- .../CancelApproveNotificationSample.java | 2 +- .../CancelSendNotificationSample.java | 2 +- .../helpdeskv1/CreateAgentScheduleSample.java | 2 +- .../helpdeskv1/CreateAgentSkillSample.java | 2 +- .../helpdeskv1/CreateBotMessageSample.java | 2 +- .../helpdeskv1/CreateCategorySample.java | 2 +- .../apiall/helpdeskv1/CreateFaqSample.java | 2 +- .../helpdeskv1/CreateNotificationSample.java | 2 +- .../CreateTicketCustomizedFieldSample.java | 2 +- .../helpdeskv1/CreateTicketMessageSample.java | 2 +- .../CustomizedFieldsTicketSample.java | 2 +- .../DeleteAgentSchedulesSample.java | 2 +- .../helpdeskv1/DeleteAgentSkillSample.java | 2 +- .../helpdeskv1/DeleteCategorySample.java | 2 +- .../apiall/helpdeskv1/DeleteFaqSample.java | 2 +- .../DeleteTicketCustomizedFieldSample.java | 2 +- .../ExecuteSendNotificationSample.java | 2 +- .../apiall/helpdeskv1/FaqImageFaqSample.java | 2 +- .../helpdeskv1/GetAgentSchedulesSample.java | 2 +- .../helpdeskv1/GetAgentSkillSample.java | 2 +- .../apiall/helpdeskv1/GetCategorySample.java | 2 +- .../apiall/helpdeskv1/GetFaqSample.java | 2 +- .../helpdeskv1/GetNotificationSample.java | 2 +- .../GetTicketCustomizedFieldSample.java | 2 +- .../apiall/helpdeskv1/GetTicketSample.java | 2 +- .../helpdeskv1/ListAgentScheduleSample.java | 2 +- .../apiall/helpdeskv1/ListCategorySample.java | 2 +- .../apiall/helpdeskv1/ListFaqSample.java | 2 +- .../ListTicketCustomizedFieldSample.java | 2 +- .../helpdeskv1/ListTicketMessageSample.java | 2 +- .../apiall/helpdeskv1/ListTicketSample.java | 2 +- .../apiall/helpdeskv1/PatchAgentSample.java | 2 +- .../helpdeskv1/PatchAgentSchedulesSample.java | 2 +- .../helpdeskv1/PatchAgentSkillSample.java | 2 +- .../helpdeskv1/PatchCategorySample.java | 2 +- .../apiall/helpdeskv1/PatchFaqSample.java | 2 +- .../helpdeskv1/PatchNotificationSample.java | 2 +- .../PatchTicketCustomizedFieldSample.java | 2 +- .../helpdeskv1/PreviewNotificationSample.java | 2 +- .../apiall/helpdeskv1/SearchFaqSample.java | 2 +- .../helpdeskv1/StartServiceTicketSample.java | 2 +- .../SubmitApproveNotificationSample.java | 2 +- .../helpdeskv1/SubscribeEventSample.java | 2 +- .../helpdeskv1/TicketImageTicketSample.java | 2 +- .../helpdeskv1/UnsubscribeEventSample.java | 2 +- .../apiall/helpdeskv1/UpdateTicketSample.java | 2 +- .../hirev1/AddToFolderTalentSample.java | 2 +- ...atchDeleteEcoAccountCustomFieldSample.java | 2 +- ...teEcoBackgroundCheckCustomFieldSample.java | 2 +- ...DeleteEcoBackgroundCheckPackageSample.java | 2 +- .../hirev1/BatchDeleteEcoExamPaperSample.java | 2 +- .../apiall/hirev1/BatchGetIdTalentSample.java | 2 +- ...atchUpdateEcoAccountCustomFieldSample.java | 2 +- ...teEcoBackgroundCheckCustomFieldSample.java | 2 +- ...UpdateEcoBackgroundCheckPackageSample.java | 2 +- .../hirev1/BatchUpdateEcoExamPaperSample.java | 2 +- .../CancelEcoBackgroundCheckSample.java | 2 +- .../hirev1/CombinedCreateJobSample.java | 4 +- .../hirev1/CombinedUpdateJobSample.java | 4 +- .../sample/apiall/hirev1/ConfigJobSample.java | 2 +- .../hirev1/CreateApplicationSample.java | 2 +- .../CreateEcoAccountCustomFieldSample.java | 2 +- ...teEcoBackgroundCheckCustomFieldSample.java | 2 +- ...CreateEcoBackgroundCheckPackageSample.java | 2 +- .../hirev1/CreateEcoExamPaperSample.java | 2 +- .../CreateExternalApplicationSample.java | 2 +- .../CreateExternalBackgroundCheckSample.java | 2 +- ...eateExternalInterviewAssessmentSample.java | 2 +- .../hirev1/CreateExternalInterviewSample.java | 2 +- .../hirev1/CreateJobRequirementSample.java | 5 +- .../apiall/hirev1/CreateNoteSample.java | 2 +- .../apiall/hirev1/CreateOfferSample.java | 5 +- .../hirev1/CreateReferralAccountSample.java | 2 +- .../DeactivateReferralAccountSample.java | 2 +- .../DeleteExternalApplicationSample.java | 2 +- .../hirev1/DeleteJobRequirementSample.java | 2 +- .../apiall/hirev1/GetApplicationSample.java | 3 +- .../apiall/hirev1/GetAttachmentSample.java | 2 +- .../GetByApplicationEmployeeSample.java | 5 +- .../GetByApplicationReferralSample.java | 2 +- .../apiall/hirev1/GetEmployeeSample.java | 5 +- .../apiall/hirev1/GetJobManagerSample.java | 2 +- .../sample/apiall/hirev1/GetJobSample.java | 4 +- .../sample/apiall/hirev1/GetNoteSample.java | 2 +- .../sample/apiall/hirev1/GetOfferSample.java | 5 +- .../apiall/hirev1/GetOfferSchemaSample.java | 2 +- .../GetReferralWebsiteJobPostSample.java | 3 +- .../sample/apiall/hirev1/GetTalentSample.java | 2 +- .../hirev1/InternOfferStatusOfferSample.java | 2 +- .../ListApplicationInterviewSample.java | 3 +- .../apiall/hirev1/ListApplicationSample.java | 2 +- .../hirev1/ListByIdJobRequirementSample.java | 5 +- .../apiall/hirev1/ListEvaluationSample.java | 2 +- .../apiall/hirev1/ListInterviewSample.java | 3 +- .../apiall/hirev1/ListJobProcessSample.java | 2 +- .../hirev1/ListJobRequirementSample.java | 5 +- .../ListJobRequirementSchemaSample.java | 2 +- .../apiall/hirev1/ListJobTypeSample.java | 2 +- .../sample/apiall/hirev1/ListNoteSample.java | 2 +- .../sample/apiall/hirev1/ListOfferSample.java | 3 +- .../hirev1/ListQuestionnaireSample.java | 2 +- .../ListReferralWebsiteJobPostSample.java | 3 +- .../hirev1/ListRegistrationSchemaSample.java | 2 +- .../apiall/hirev1/ListResumeSourceSample.java | 2 +- .../apiall/hirev1/ListTalentFolderSample.java | 2 +- .../apiall/hirev1/LoginInfoEcoExamSample.java | 2 +- .../apiall/hirev1/OfferApplicationSample.java | 5 +- .../apiall/hirev1/OfferStatusOfferSample.java | 2 +- .../hirev1/PatchEhrImportTaskSample.java | 2 +- .../apiall/hirev1/PatchEmployeeSample.java | 5 +- .../sample/apiall/hirev1/PatchNoteSample.java | 2 +- .../hirev1/PreviewAttachmentSample.java | 2 +- .../ReconciliationReferralAccountSample.java | 2 +- .../hirev1/TerminateApplicationSample.java | 2 +- .../TransferOnboardApplicationSample.java | 5 +- .../apiall/hirev1/UpdateConfigJobSample.java | 2 +- .../UpdateExternalApplicationSample.java | 2 +- .../hirev1/UpdateJobRequirementSample.java | 5 +- .../apiall/hirev1/UpdateOfferSample.java | 5 +- ...pdateProgressEcoBackgroundCheckSample.java | 2 +- .../UpdateResultEcoBackgroundCheckSample.java | 2 +- .../hirev1/UpdateResultEcoExamSample.java | 2 +- .../hirev1/WithdrawReferralAccountSample.java | 2 +- .../CreateIdentitySample.java | 2 +- .../imv1/AddManagersChatManagersSample.java | 2 +- .../apiall/imv1/CreateChatMembersSample.java | 2 +- .../apiall/imv1/CreateChatMenuTreeSample.java | 2 +- .../sample/apiall/imv1/CreateChatSample.java | 2 +- .../apiall/imv1/CreateChatTabSample.java | 2 +- .../sample/apiall/imv1/CreateFileSample.java | 2 +- .../sample/apiall/imv1/CreateImageSample.java | 2 +- .../imv1/CreateMessageReactionSample.java | 2 +- .../apiall/imv1/CreateMessageSample.java | 2 +- .../sample/apiall/imv1/CreatePinSample.java | 2 +- .../apiall/imv1/DeleteBatchMessageSample.java | 2 +- .../apiall/imv1/DeleteChatMembersSample.java | 2 +- .../apiall/imv1/DeleteChatMenuTreeSample.java | 2 +- .../sample/apiall/imv1/DeleteChatSample.java | 2 +- .../DeleteManagersChatManagersSample.java | 2 +- .../imv1/DeleteMessageReactionSample.java | 2 +- .../apiall/imv1/DeleteMessageSample.java | 2 +- .../sample/apiall/imv1/DeletePinSample.java | 2 +- .../apiall/imv1/DeleteTabsChatTabSample.java | 2 +- .../DeleteTopNoticeChatTopNoticeSample.java | 2 +- .../apiall/imv1/ForwardMessageSample.java | 2 +- .../imv1/GetChatAnnouncementSample.java | 2 +- .../apiall/imv1/GetChatMembersSample.java | 2 +- .../apiall/imv1/GetChatMenuTreeSample.java | 2 +- .../apiall/imv1/GetChatModerationSample.java | 2 +- .../sample/apiall/imv1/GetChatSample.java | 2 +- .../sample/apiall/imv1/GetFileSample.java | 2 +- .../sample/apiall/imv1/GetImageSample.java | 2 +- .../apiall/imv1/GetMessageResourceSample.java | 2 +- .../sample/apiall/imv1/GetMessageSample.java | 2 +- .../imv1/GetProgressBatchMessageSample.java | 2 +- .../imv1/IsInChatChatMembersSample.java | 2 +- .../sample/apiall/imv1/LinkChatSample.java | 2 +- .../sample/apiall/imv1/ListChatSample.java | 2 +- .../imv1/ListMessageReactionSample.java | 2 +- .../sample/apiall/imv1/ListMessageSample.java | 2 +- .../sample/apiall/imv1/ListPinSample.java | 2 +- .../apiall/imv1/ListTabsChatTabSample.java | 2 +- .../apiall/imv1/MeJoinChatMembersSample.java | 2 +- .../imv1/MergeForwardMessageSample.java | 2 +- .../imv1/PatchChatAnnouncementSample.java | 2 +- .../apiall/imv1/PatchChatMenuItemSample.java | 2 +- .../apiall/imv1/PatchMessageSample.java | 2 +- .../imv1/PutTopNoticeChatTopNoticeSample.java | 2 +- .../imv1/ReadUserBatchMessageSample.java | 2 +- .../apiall/imv1/ReadUsersMessageSample.java | 2 +- .../apiall/imv1/ReplyMessageSample.java | 2 +- .../sample/apiall/imv1/SearchChatSample.java | 2 +- .../apiall/imv1/SortChatMenuTreeSample.java | 2 +- .../apiall/imv1/SortTabsChatTabSample.java | 2 +- .../imv1/UpdateChatModerationSample.java | 2 +- .../sample/apiall/imv1/UpdateChatSample.java | 2 +- .../apiall/imv1/UpdateMessageSample.java | 2 +- .../apiall/imv1/UpdateTabsChatTabSample.java | 2 +- .../apiall/imv1/UrgentAppMessageSample.java | 2 +- .../apiall/imv1/UrgentPhoneMessageSample.java | 2 +- .../apiall/imv1/UrgentSmsMessageSample.java | 2 +- .../apiall/lingov1/CreateDraftSample.java | 2 +- .../apiall/lingov1/CreateEntitySample.java | 2 +- .../apiall/lingov1/DeleteEntitySample.java | 35 + .../apiall/lingov1/DownloadFileSample.java | 2 +- .../apiall/lingov1/GetEntitySample.java | 2 +- .../apiall/lingov1/HighlightEntitySample.java | 2 +- .../lingov1/ListClassificationSample.java | 2 +- .../apiall/lingov1/ListEntitySample.java | 2 +- .../apiall/lingov1/MatchEntitySample.java | 2 +- .../apiall/lingov1/SearchEntitySample.java | 2 +- .../apiall/lingov1/UpdateDraftSample.java | 2 +- .../apiall/lingov1/UpdateEntitySample.java | 2 +- .../apiall/lingov1/UploadFileSample.java | 2 +- .../BatchCreateMailgroupManagerSample.java | 2 +- .../BatchCreateMailgroupMemberSample.java | 2 +- ...CreateMailgroupPermissionMemberSample.java | 2 +- .../BatchCreatePublicMailboxMemberSample.java | 2 +- .../BatchDeleteMailgroupManagerSample.java | 2 +- .../BatchDeleteMailgroupMemberSample.java | 2 +- ...DeleteMailgroupPermissionMemberSample.java | 2 +- .../BatchDeletePublicMailboxMemberSample.java | 2 +- .../ClearPublicMailboxMemberSample.java | 2 +- .../mailv1/CreateMailgroupAliasSample.java | 2 +- .../mailv1/CreateMailgroupMemberSample.java | 2 +- ...CreateMailgroupPermissionMemberSample.java | 2 +- .../apiall/mailv1/CreateMailgroupSample.java | 2 +- .../CreatePublicMailboxAliasSample.java | 2 +- .../CreatePublicMailboxMemberSample.java | 2 +- .../mailv1/CreatePublicMailboxSample.java | 2 +- .../mailv1/CreateUserMailboxAliasSample.java | 2 +- .../mailv1/DeleteMailgroupAliasSample.java | 2 +- .../mailv1/DeleteMailgroupMemberSample.java | 2 +- ...DeleteMailgroupPermissionMemberSample.java | 2 +- .../apiall/mailv1/DeleteMailgroupSample.java | 2 +- .../DeletePublicMailboxAliasSample.java | 2 +- .../DeletePublicMailboxMemberSample.java | 2 +- .../mailv1/DeletePublicMailboxSample.java | 2 +- .../mailv1/DeleteUserMailboxAliasSample.java | 2 +- .../mailv1/DeleteUserMailboxSample.java | 2 +- .../mailv1/GetMailgroupMemberSample.java | 2 +- .../GetMailgroupPermissionMemberSample.java | 2 +- .../apiall/mailv1/GetMailgroupSample.java | 2 +- .../mailv1/GetPublicMailboxMemberSample.java | 2 +- .../apiall/mailv1/GetPublicMailboxSample.java | 2 +- .../mailv1/ListMailgroupAliasSample.java | 2 +- .../mailv1/ListMailgroupManagerSample.java | 2 +- .../mailv1/ListMailgroupMemberSample.java | 2 +- .../ListMailgroupPermissionMemberSample.java | 2 +- .../apiall/mailv1/ListMailgroupSample.java | 2 +- .../mailv1/ListPublicMailboxAliasSample.java | 2 +- .../mailv1/ListPublicMailboxMemberSample.java | 2 +- .../mailv1/ListPublicMailboxSample.java | 2 +- .../mailv1/ListUserMailboxAliasSample.java | 2 +- .../apiall/mailv1/PatchMailgroupSample.java | 2 +- .../mailv1/PatchPublicMailboxSample.java | 2 +- .../sample/apiall/mailv1/QueryUserSample.java | 2 +- .../apiall/mailv1/UpdateMailgroupSample.java | 2 +- .../mailv1/UpdatePublicMailboxSample.java | 2 +- .../mdmv1/BindUserAuthDataRelationSample.java | 2 +- .../UnbindUserAuthDataRelationSample.java | 2 +- .../apiall/okrv1/BatchGetOkrSample.java | 2 +- .../okrv1/CreateProgressRecordSample.java | 2 +- .../okrv1/DeleteProgressRecordSample.java | 2 +- .../apiall/okrv1/GetProgressRecordSample.java | 2 +- .../sample/apiall/okrv1/ListPeriodSample.java | 2 +- .../apiall/okrv1/ListUserOkrSample.java | 2 +- .../okrv1/UpdateProgressRecordSample.java | 2 +- .../apiall/okrv1/UploadImageSample.java | 2 +- .../BasicRecognizeImageSample.java | 2 +- .../apiall/passportv1/QuerySessionSample.java | 2 +- .../BatchCloseSystemStatusSample.java | 2 +- .../BatchOpenSystemStatusSample.java | 2 +- .../CreateSystemStatusSample.java | 2 +- .../DeleteSystemStatusSample.java | 2 +- .../ListSystemStatusSample.java | 2 +- .../PatchSystemStatusSample.java | 2 +- .../apiall/searchv2/CreateAppSample.java | 2 +- .../searchv2/CreateDataSourceItemSample.java | 2 +- .../searchv2/CreateDataSourceSample.java | 2 +- .../apiall/searchv2/CreateMessageSample.java | 2 +- .../apiall/searchv2/CreateSchemaSample.java | 2 +- .../searchv2/DeleteDataSourceItemSample.java | 2 +- .../searchv2/DeleteDataSourceSample.java | 2 +- .../apiall/searchv2/DeleteSchemaSample.java | 2 +- .../searchv2/GetDataSourceItemSample.java | 2 +- .../apiall/searchv2/GetDataSourceSample.java | 2 +- .../apiall/searchv2/GetSchemaSample.java | 2 +- .../apiall/searchv2/ListDataSourceSample.java | 2 +- .../searchv2/PatchDataSourceSample.java | 2 +- .../apiall/searchv2/PatchSchemaSample.java | 2 +- .../ListDataOpenapiLogSample.java | 2 +- .../sheetsv3/CreateSpreadsheetSample.java | 2 +- .../CreateSpreadsheetSheetFilterSample.java | 2 +- ...adsheetSheetFilterViewConditionSample.java | 2 +- ...reateSpreadsheetSheetFilterViewSample.java | 2 +- ...reateSpreadsheetSheetFloatImageSample.java | 2 +- .../DeleteSpreadsheetSheetFilterSample.java | 2 +- ...adsheetSheetFilterViewConditionSample.java | 2 +- ...eleteSpreadsheetSheetFilterViewSample.java | 2 +- ...eleteSpreadsheetSheetFloatImageSample.java | 2 +- .../sheetsv3/FindSpreadsheetSheetSample.java | 2 +- .../apiall/sheetsv3/GetSpreadsheetSample.java | 2 +- .../GetSpreadsheetSheetFilterSample.java | 2 +- ...adsheetSheetFilterViewConditionSample.java | 2 +- .../GetSpreadsheetSheetFilterViewSample.java | 2 +- .../GetSpreadsheetSheetFloatImageSample.java | 2 +- .../sheetsv3/GetSpreadsheetSheetSample.java | 2 +- .../MoveDimensionSpreadsheetSheetSample.java | 2 +- .../sheetsv3/PatchSpreadsheetSample.java | 2 +- ...PatchSpreadsheetSheetFilterViewSample.java | 2 +- ...PatchSpreadsheetSheetFloatImageSample.java | 2 +- ...adsheetSheetFilterViewConditionSample.java | 2 +- ...QuerySpreadsheetSheetFilterViewSample.java | 2 +- ...QuerySpreadsheetSheetFloatImageSample.java | 2 +- .../sheetsv3/QuerySpreadsheetSheetSample.java | 2 +- .../ReplaceSpreadsheetSheetSample.java | 2 +- .../UpdateSpreadsheetSheetFilterSample.java | 2 +- ...adsheetSheetFilterViewConditionSample.java | 2 +- .../FileRecognizeSpeechSample.java | 2 +- .../StreamRecognizeSpeechSample.java | 2 +- .../BatchDeleteCollaboratorTaskSample.java | 2 +- .../taskv1/BatchDeleteFollowerTaskSample.java | 2 +- .../apiall/taskv1/CompleteTaskSample.java | 2 +- .../taskv1/CreateTaskCollaboratorSample.java | 2 +- .../taskv1/CreateTaskCommentSample.java | 2 +- .../taskv1/CreateTaskFollowerSample.java | 2 +- .../taskv1/CreateTaskReminderSample.java | 2 +- .../apiall/taskv1/CreateTaskSample.java | 2 +- .../taskv1/DeleteTaskCollaboratorSample.java | 2 +- .../taskv1/DeleteTaskCommentSample.java | 2 +- .../taskv1/DeleteTaskFollowerSample.java | 2 +- .../taskv1/DeleteTaskReminderSample.java | 2 +- .../apiall/taskv1/DeleteTaskSample.java | 2 +- .../apiall/taskv1/GetTaskCommentSample.java | 2 +- .../sample/apiall/taskv1/GetTaskSample.java | 2 +- .../taskv1/ListTaskCollaboratorSample.java | 2 +- .../apiall/taskv1/ListTaskCommentSample.java | 2 +- .../apiall/taskv1/ListTaskFollowerSample.java | 2 +- .../apiall/taskv1/ListTaskReminderSample.java | 2 +- .../sample/apiall/taskv1/ListTaskSample.java | 2 +- .../sample/apiall/taskv1/PatchTaskSample.java | 2 +- .../apiall/taskv1/UncompleteTaskSample.java | 2 +- .../taskv1/UpdateTaskCommentSample.java | 2 +- .../apiall/taskv2/AddCustomFieldSample.java | 38 + .../taskv2/AddDependenciesTaskSample.java | 38 + .../apiall/taskv2/AddMembersTaskSample.java | 40 + .../taskv2/AddMembersTasklistSample.java | 39 + .../apiall/taskv2/AddRemindersTaskSample.java | 39 + .../apiall/taskv2/AddTasklistTaskSample.java | 39 + .../apiall/taskv2/CreateCommentSample.java | 40 + .../taskv2/CreateCustomFieldOptionSample.java | 41 + .../taskv2/CreateCustomFieldSample.java | 44 + .../apiall/taskv2/CreateSectionSample.java | 41 + .../apiall/taskv2/CreateTaskSample.java | 51 + .../taskv2/CreateTaskSubtaskSample.java | 52 + ...ateTasklistActivitySubscriptionSample.java | 42 + .../apiall/taskv2/CreateTasklistSample.java | 39 + .../apiall/taskv2/DeleteAttachmentSample.java | 33 + .../apiall/taskv2/DeleteCommentSample.java | 33 + .../apiall/taskv2/DeleteSectionSample.java | 33 + .../apiall/taskv2/DeleteTaskSample.java | 33 + ...eteTasklistActivitySubscriptionSample.java | 34 + .../apiall/taskv2/DeleteTasklistSample.java | 33 + .../apiall/taskv2/GetAttachmentSample.java | 34 + .../apiall/taskv2/GetCommentSample.java | 34 + .../apiall/taskv2/GetCustomFieldSample.java | 34 + .../apiall/taskv2/GetSectionSample.java | 34 + .../sample/apiall/taskv2/GetTaskSample.java | 34 + ...GetTasklistActivitySubscriptionSample.java | 35 + .../apiall/taskv2/GetTasklistSample.java | 34 + .../apiall/taskv2/ListAttachmentSample.java | 37 + .../apiall/taskv2/ListCommentSample.java | 38 + .../apiall/taskv2/ListCustomFieldSample.java | 37 + .../apiall/taskv2/ListSectionSample.java | 37 + .../sample/apiall/taskv2/ListTaskSample.java | 37 + .../apiall/taskv2/ListTaskSubtaskSample.java | 36 + ...istTasklistActivitySubscriptionSample.java | 35 + .../apiall/taskv2/ListTasklistSample.java | 35 + .../apiall/taskv2/PatchCommentSample.java | 40 + .../taskv2/PatchCustomFieldOptionSample.java | 40 + .../apiall/taskv2/PatchCustomFieldSample.java | 40 + .../apiall/taskv2/PatchSectionSample.java | 40 + .../sample/apiall/taskv2/PatchTaskSample.java | 40 + ...tchTasklistActivitySubscriptionSample.java | 41 + .../apiall/taskv2/PatchTasklistSample.java | 41 + .../taskv2/RemoveCustomFieldSample.java | 38 + .../taskv2/RemoveDependenciesTaskSample.java | 38 + .../taskv2/RemoveMembersTaskSample.java | 39 + .../taskv2/RemoveMembersTasklistSample.java | 39 + .../taskv2/RemoveRemindersTaskSample.java | 38 + .../taskv2/RemoveTasklistTaskSample.java | 38 + .../apiall/taskv2/TasklistsTaskSample.java | 33 + .../apiall/taskv2/TasksSectionSample.java | 39 + .../apiall/taskv2/TasksTasklistSample.java | 39 + .../apiall/taskv2/UploadAttachmentSample.java | 42 + .../translationv1/DetectTextSample.java | 2 +- .../translationv1/TranslateTextSample.java | 2 +- .../apiall/vcv1/ApplyReserveSample.java | 2 +- .../apiall/vcv1/CreateRoomLevelSample.java | 2 +- .../sample/apiall/vcv1/CreateRoomSample.java | 2 +- .../apiall/vcv1/CreateScopeConfigSample.java | 2 +- .../apiall/vcv1/DelRoomLevelSample.java | 2 +- .../apiall/vcv1/DeleteReserveSample.java | 2 +- .../sample/apiall/vcv1/DeleteRoomSample.java | 2 +- .../apiall/vcv1/DownloadExportSample.java | 2 +- .../sample/apiall/vcv1/EndMeetingSample.java | 2 +- .../vcv1/GetActiveMeetingReserveSample.java | 2 +- .../apiall/vcv1/GetDailyReportSample.java | 2 +- .../sample/apiall/vcv1/GetExportSample.java | 2 +- .../apiall/vcv1/GetMeetingListSample.java | 3 +- .../vcv1/GetMeetingRecordingSample.java | 2 +- .../sample/apiall/vcv1/GetMeetingSample.java | 2 +- .../apiall/vcv1/GetParticipantListSample.java | 3 +- .../vcv1/GetParticipantQualityListSample.java | 2 +- .../vcv1/GetReserveConfigAdminSample.java | 2 +- .../GetReserveConfigDisableInformSample.java | 2 +- .../vcv1/GetReserveConfigFormSample.java | 2 +- .../sample/apiall/vcv1/GetReserveSample.java | 2 +- .../GetResourceReservationListSample.java | 2 +- .../apiall/vcv1/GetRoomLevelSample.java | 2 +- .../sample/apiall/vcv1/GetRoomSample.java | 2 +- .../apiall/vcv1/GetScopeConfigSample.java | 2 +- .../apiall/vcv1/GetTopUserReportSample.java | 2 +- .../apiall/vcv1/InviteMeetingSample.java | 2 +- .../apiall/vcv1/KickoutMeetingSample.java | 2 +- .../sample/apiall/vcv1/ListAlertSample.java | 2 +- .../apiall/vcv1/ListByNoMeetingSample.java | 2 +- .../apiall/vcv1/ListRoomLevelSample.java | 2 +- .../sample/apiall/vcv1/ListRoomSample.java | 2 +- .../apiall/vcv1/MeetingListExportSample.java | 3 +- .../apiall/vcv1/MgetRoomLevelSample.java | 2 +- .../sample/apiall/vcv1/MgetRoomSample.java | 2 +- .../vcv1/ParticipantListExportSample.java | 3 +- .../ParticipantQualityListExportSample.java | 2 +- .../vcv1/PatchReserveConfigAdminSample.java | 2 +- ...PatchReserveConfigDisableInformSample.java | 2 +- .../vcv1/PatchReserveConfigFormSample.java | 2 +- .../apiall/vcv1/PatchReserveConfigSample.java | 2 +- .../apiall/vcv1/PatchRoomLevelSample.java | 2 +- .../sample/apiall/vcv1/PatchRoomSample.java | 2 +- .../apiall/vcv1/QueryRoomConfigSample.java | 2 +- .../vcv1/ReserveScopeReserveConfigSample.java | 2 +- .../ResourceReservationListExportSample.java | 2 +- .../apiall/vcv1/SearchRoomLevelSample.java | 2 +- .../sample/apiall/vcv1/SearchRoomSample.java | 2 +- ...tCheckboardAccessCodeRoomConfigSample.java | 2 +- .../apiall/vcv1/SetHostMeetingSample.java | 2 +- .../SetPermissionMeetingRecordingSample.java | 2 +- .../SetRoomAccessCodeRoomConfigSample.java | 2 +- .../apiall/vcv1/SetRoomConfigSample.java | 2 +- .../vcv1/StartMeetingRecordingSample.java | 2 +- .../vcv1/StopMeetingRecordingSample.java | 2 +- .../apiall/vcv1/UpdateReserveSample.java | 2 +- .../apiall/wikiv2/CopySpaceNodeSample.java | 2 +- .../wikiv2/CreateSpaceMemberSample.java | 2 +- .../apiall/wikiv2/CreateSpaceNodeSample.java | 8 +- .../apiall/wikiv2/CreateSpaceSample.java | 2 +- .../wikiv2/DeleteSpaceMemberSample.java | 2 +- .../apiall/wikiv2/GetNodeSpaceSample.java | 2 +- .../sample/apiall/wikiv2/GetSpaceSample.java | 2 +- .../sample/apiall/wikiv2/GetTaskSample.java | 2 +- .../apiall/wikiv2/ListSpaceNodeSample.java | 2 +- .../sample/apiall/wikiv2/ListSpaceSample.java | 2 +- .../wikiv2/MoveDocsToWikiSpaceNodeSample.java | 2 +- .../apiall/wikiv2/MoveSpaceNodeSample.java | 2 +- .../wikiv2/UpdateSpaceSettingSample.java | 2 +- .../wikiv2/UpdateTitleSpaceNodeSample.java | 2 +- ...SearchCustomWorkplaceAccessDataSample.java | 2 +- .../SearchWorkplaceAccessDataSample.java | 2 +- .../SearchWorkplaceBlockAccessDataSample.java | 2 +- .../oapi/sample/event/EventController.java | 16 +- 2073 files changed, 173138 insertions(+), 66816 deletions(-) create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/acs/AcsService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/AcsService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/enums/PropertyOnlineStatusEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/enums/UserExternalUserTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/DeviceExternal.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/OpeningTimeExternal.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/OpeningTimePeriodExternal.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/OpeningTimeValidDayExternal.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/Property.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/Rule.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/UserExternal.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/resource/AccessRecord.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/resource/AccessRecordAccessPhoto.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/resource/Device.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/resource/User.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/resource/UserFace.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/admin/AdminService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/AdminService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/enums/ListAuditInfoOperatorTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/enums/ListAuditInfoUserIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/model/ListAuditInfoReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/model/ListAuditInfoResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/model/ListAuditInfoRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/AdminDeptStat.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/AdminUserStat.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/AuditInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/Badge.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/BadgeGrant.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/BadgeImage.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/Password.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/application/ApplicationService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/ApplicationService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/V6.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/AppBadge.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/AppRecommendRule.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/Application.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/ApplicationAppUsage.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/ApplicationAppVersion.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/ApplicationContactsRange.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/ApplicationFeedback.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/ApplicationVisibility.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/Bot.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/approval/ApprovalService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/ApprovalService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/V4.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/Approval.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/ExternalApproval.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/ExternalInstance.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/ExternalTask.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/Instance.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/InstanceComment.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/Task.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/AttendanceService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/AttendanceService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/OpenApplyTimeRange.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/ShiftGroupUser.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/UserShiftGroupsList.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/ApprovalInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/File.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/Group.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/LeaveAccrualRecord.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/LeaveEmployExpireRecord.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/Shift.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserApproval.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserDailyShift.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserFlow.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserSetting.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserStatsData.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserStatsField.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserStatsView.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserTask.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserTaskRemedy.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/auth/AuthService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/auth/v3/AuthService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/auth/v3/V3.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/auth/v3/resource/AppAccessToken.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/auth/v3/resource/AppTicket.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/auth/v3/resource/TenantAccessToken.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/authen/AuthenService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/AuthenService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/resource/AccessToken.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/resource/OidcAccessToken.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/resource/OidcRefreshAccessToken.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/resource/RefreshAccessToken.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/resource/UserInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/baike/BaikeService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/baike/v1/BaikeService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/baike/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/baike/v1/resource/Classification.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/baike/v1/resource/Draft.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/baike/v1/resource/Entity.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/baike/v1/resource/File.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/BitableService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/BitableService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/enums/ChildrenFilterConjunctionEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/enums/ConditionOperatorEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/enums/FilterInfoConjunctionEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/AppWorkflow.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/ChildrenFilter.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/Condition.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/FilterInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/Sort.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/App.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppDashboard.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppRole.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppRoleMember.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppTable.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppTableField.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppTableForm.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppTableFormField.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppTableRecord.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppTableView.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/block/BlockService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/block/v2/BlockService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/block/v2/V2.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/block/v2/resource/Entity.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/block/v2/resource/Message.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/CalendarService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/CalendarService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/V4.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/enums/InstanceEventStatusEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/enums/ListCalendarEventUserIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/CalendarPrimaryBatchReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/CalendarUnderstandExtra.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/CalendarUnderstandScenarioContext.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/EventOrganizer.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/FreeTimeAi.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/FreeTimeSlot.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/Instance.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/UserFreebusy.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/UserMeta.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/Workhour.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/WorkhourSetting.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/Calendar.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/CalendarAcl.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/CalendarEvent.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/CalendarEventAttendee.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/CalendarEventAttendeeChatMember.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/CalendarEventMeetingChat.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/ExchangeBinding.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/Freebusy.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/Setting.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/TimeoffEvent.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/contact/ContactService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/ContactService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/V3.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/CustomAttr.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/CustomAttrEvent.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/Department.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/EmployeeTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/FunctionalRole.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/FunctionalRoleMember.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/Group.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/GroupMember.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/JobFamily.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/JobLevel.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/JobTitle.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/Scope.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/Unit.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/User.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/WorkCity.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/CorehrService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/CorehrService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/P2JobCreatedV1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/P2JobCreatedV1Data.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/P2JobDeletedV1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/P2JobDeletedV1Data.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/P2JobUpdatedV1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/P2JobUpdatedV1Data.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/PatchCompanyReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/PatchCompanyResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/PatchCompanyRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/PhoneNumberAndAreaCode.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/AssignedUser.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Company.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/CompensationStandard.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Contract.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/CountryRegion.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Currency.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/CustomField.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Department.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/EmployeeType.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Employment.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/File.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Job.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/JobChange.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/JobData.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/JobFamily.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/JobLevel.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Leave.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/LeaveGrantingRecord.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Location.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/NationalIdType.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Offboarding.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/OrgRoleAuthorization.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Person.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/PreHire.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/ProcessFormVariableData.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/SecurityGroup.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Subdivision.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Subregion.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/TransferReason.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/TransferType.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/WorkingHoursType.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/V2.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ApprovalGroupApprovalGroupStatusEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ApprovalGroupDraftStatusEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/AssessmentForCreateAssessmentResultEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/AssessmentForCreateAssessmentStatusEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BankBasicDataObjStatusEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BankBranchBasicDataObjStatusEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BatchGetEmployeeDepartmentIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BatchGetEmployeeUserIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BatchGetEmployeesBpUserIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BatchGetEmployeesJobDataDepartmentIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BatchGetEmployeesJobDataUserIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/CityBasicDataObjStatusEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/CountryRegionBasicDataObjStatusEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/CountryRegionSubdivisionBasicDataObjStatusEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/CreateProbationAssessmentUserIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/CurrencyBasicDataObjStatusEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/DepartmentChangeDepartmentChangeTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/DistrictBasicDataObjStatusEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/GetByDepartmentBpDepartmentIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/GetByDepartmentBpUserIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/GetProcessUserIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/JobChangeJobChangeStatusEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ListBpDepartmentIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ListBpUserIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/NationalityBasicDataObjStatusEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/OnboardingTaskTaskStatusEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ParentsDepartmentDepartmentIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/PatchProbationAssessmentAssessmentResultEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/PatchProbationAssessmentAssessmentStatusEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/PreHireEmploymentInfoRehireEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ProcessDoneItemApproverStatusEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ProcessDoneItemApproverTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ProcessTodoItemApproverTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/QueryEmployeesJobDataDepartmentIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/QueryEmployeesJobDataUserIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchContractUserIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchDepartmentDepartmentIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchDepartmentUserIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchEmployeeDepartmentIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchEmployeeEmploymentStatusEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchEmployeeUserIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchJobChangeDepartmentIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchJobChangeUserIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchProbationDepartmentIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchProbationFinalAssessmentResultEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchProbationProbationStatusEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchProbationUserIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/AbnormalReason.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/AbnormalReasonElement.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/AbnormalReasonI18nElement.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Address.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ApprovalGroup.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Assessment.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/AssessmentForCreate.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Bank.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BankAccount.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BankBranch.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BasicDepartment.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BasicEmployee.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BasicInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BasicJobData.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BasicPersonInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetCompanyReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetCompanyReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetCompanyResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetCompanyRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeeReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeeReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeeResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeeRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesBpReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesBpReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesBpResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesBpRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesJobDataReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesJobDataReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesJobDataResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesJobDataRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobFamilyReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobFamilyReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobFamilyResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobFamilyRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobLevelReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobLevelReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobLevelResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobLevelRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetLocationReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetLocationReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetLocationResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetLocationRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Bp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CalculateParam.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ChangeFieldPair.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/City.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Company.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CompanyIdAndName.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Contract.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CostCenter.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CostCenterVersion.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CountryRegion.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CountryRegionSubdivision.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreatePersonReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreatePersonResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreatePersonRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreatePreHireReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreatePreHireResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreatePreHireRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreateProbationAssessmentReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreateProbationAssessmentReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreateProbationAssessmentResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreateProbationAssessmentRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Currency.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CustomFieldData.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CustomName.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CustomValue.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DataengineI18n.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DeleteProbationAssessmentReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DeleteProbationAssessmentResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Department.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DepartmentChange.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DepartmentHrbp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DepartmentId.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DepartmentParentInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DepartmentParents.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Dependent.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Dimension.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DimensionInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DimensionValue.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/District.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Education.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EducationInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Email.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EmergencyContact.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Employee.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EmployeeInternationalAssignment.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EmployeeJobData.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Employment.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EmploymentBp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EnableDisableAssessmentProbationReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EnableDisableAssessmentProbationReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EnableDisableAssessmentProbationResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Enum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/File.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetByDepartmentBpReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetByDepartmentBpReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetByDepartmentBpResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetByDepartmentBpRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetJobReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetJobResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetJobRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetProcessReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetProcessResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetProcessRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/HiberarchyCommon.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/I18n.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/I18nV2.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/InternationalAssignment.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/InternationalAssignmentV2.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/InternationalAssignmentV2ForCreate.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/InternationalAssignmentV2ForPatch.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Job.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/JobChange.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/JobData.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/JobDataCostCenter.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/JobFamily.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/JobLevel.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListBpReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListBpResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListBpRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListJobReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListJobResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListJobRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListProcessReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListProcessResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListProcessRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Location.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/LocationV2.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Name.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/NationalId.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Nationality.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ObjectFieldData.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/OfferInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/OnboardingTask.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProbationUpdatedV2.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProbationUpdatedV2Data.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProcessApproverUpdatedV2.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProcessApproverUpdatedV2Data.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProcessCcUpdatedV2.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProcessCcUpdatedV2Data.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProcessUpdatedV2.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProcessUpdatedV2Data.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ParentsDepartmentReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ParentsDepartmentReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ParentsDepartmentResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ParentsDepartmentRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PatchPersonReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PatchPersonResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PatchPersonRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PatchProbationAssessmentReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PatchProbationAssessmentResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PersonInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PersonInfoChn.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PersonName.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PersonalProfile.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Phone.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PhoneNumberAndAreaCode.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PreHire.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PreHireContractInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PreHireEmploymentInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PreHireOnboardingInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PreHireProbationInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PrehireCreate.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProbationInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProbationInfoForSubmit.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProcessAbstractItem.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProcessCcItem.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProcessDoneItem.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProcessLink.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProcessTodoItem.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/QueryEmployeesJobDataReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/QueryEmployeesJobDataReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/QueryEmployeesJobDataResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/QueryEmployeesJobDataRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ReorganizationInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ResidentTax.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchContractReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchContractReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchContractResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchContractRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchDepartmentReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchDepartmentReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchDepartmentResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchDepartmentRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchEmployeeReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchEmployeeReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchEmployeeResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchEmployeeRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchJobChangeReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchJobChangeReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchJobChangeResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchJobChangeRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchProbationReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchProbationReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchProbationResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchProbationRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SignatureFile.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/TranferEmploymentInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/TransferInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/UserContact.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/UserInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/WorkEmail.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/WorkExperience.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/WorkExperienceInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/WorkforcePlan.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/WorkforcePlanDetail.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/WorkforcePlanEaiDetail.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Bp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Company.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Contract.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Department.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Employee.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/EmployeesBp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/EmployeesJobData.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Job.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/JobChange.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/JobFamily.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/JobLevel.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Location.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Person.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/PreHire.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Probation.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/ProbationAssessment.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Process.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/ProcessApprover.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/ProcessCc.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/DocumentAiService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/DocumentAiService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/BankCard.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/BusinessCard.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/BusinessLicense.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/ChinesePassport.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/Contract.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/DrivingLicense.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/FoodManageLicense.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/FoodProduceLicense.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/HkmMainlandTravelPermit.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/IdCard.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/TaxiInvoice.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/TrainInvoice.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/TwMainlandTravelPermit.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/VatInvoice.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/VehicleLicense.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/docx/DocxService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/DocxService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/enums/BoardAlignEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/Board.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/DocumentDisplaySetting.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/UpdateDocumentRequest.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/UpdateTaskRequest.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/resource/Document.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/resource/DocumentBlock.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/resource/DocumentBlockChildren.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/DriveService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/DriveService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/model/FileBlockChangeInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/model/FileChangeInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/ExportTask.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/File.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/FileComment.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/FileCommentReply.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/FileStatistics.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/FileSubscription.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/FileVersion.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/FileViewRecord.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/ImportTask.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/Media.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/Meta.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/PermissionMember.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/PermissionPublic.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/PermissionPublicPassword.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/V2.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/GetPermissionPublicTokenTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/MyLikeFileTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicCommentEntityEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicCopyEntityEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicExternalAccessEntityEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicLinkShareEntityEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicManageCollaboratorEntityEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicSecurityEntityEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicShareEntityEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicTokenTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicCommentEntityEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicCopyEntityEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicExternalAccessEntityEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicLinkShareEntityEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicManageCollaboratorEntityEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicSecurityEntityEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicShareEntityEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/DepartmentId.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/FileLike.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/GetPermissionPublicReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/GetPermissionPublicResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/GetPermissionPublicRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/MyLike.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/PatchPermissionPublicReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/PatchPermissionPublicResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/PatchPermissionPublicRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/PermissionPublic.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/SecureLabel.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/resource/PermissionPublic.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/ehr/EhrService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/ehr/v1/EhrService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/ehr/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/ehr/v1/resource/Attachment.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/ehr/v1/resource/Employee.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/event/EventService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/event/v1/EventService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/event/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/event/v1/resource/OutboundIp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/gray_test_open_sg/GrayTestOpenSgService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/gray_test_open_sg/v1/GrayTestOpenSgService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/gray_test_open_sg/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/gray_test_open_sg/v1/resource/Moto.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/HelpdeskService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/HelpdeskService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/Agent.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/AgentSchedule.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/AgentSchedules.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/AgentSkill.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/AgentSkillRule.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/BotMessage.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/Category.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/Event.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/Faq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/Notification.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/Ticket.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/TicketCustomizedField.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/TicketMessage.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/HireService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/HireService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/AgencyProtection.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/MasterLocationAddressInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/MasterLocationInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ReferralInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/TripartiteAgreementInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Application.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ApplicationInterview.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Attachment.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoAccount.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoAccountCustomField.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoBackgroundCheck.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoBackgroundCheckCustomField.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoBackgroundCheckPackage.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoExam.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoExamPaper.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EhrImportTask.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EhrImportTaskForInternshipOffer.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Employee.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Evaluation.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ExternalApplication.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ExternalBackgroundCheck.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ExternalInterview.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ExternalInterviewAssessment.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Interview.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Job.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/JobManager.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/JobProcess.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/JobRequirement.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/JobRequirementSchema.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/JobType.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Note.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Offer.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/OfferSchema.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Questionnaire.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Referral.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ReferralAccount.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ReferralWebsiteJobPost.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/RegistrationSchema.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ResumeSource.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Talent.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/TalentFolder.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/TalentObject.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/human_authentication/HumanAuthenticationService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/human_authentication/v1/HumanAuthenticationService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/human_authentication/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/human_authentication/v1/resource/Identity.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/im/ImService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/ImService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/BatchMessage.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/Chat.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatAnnouncement.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatManagers.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatMemberBot.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatMemberUser.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatMembers.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatMenuItem.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatMenuTree.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatModeration.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatTab.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatTopNotice.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/File.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/Image.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/Message.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/MessageReaction.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/MessageResource.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/Pin.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/LingoService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/LingoService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/model/DeleteEntityReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/model/DeleteEntityResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/resource/Classification.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/resource/Draft.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/resource/Entity.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/resource/File.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/resource/Repo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/mail/MailService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/MailService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/Mailgroup.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/MailgroupAlias.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/MailgroupManager.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/MailgroupMember.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/MailgroupPermissionMember.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/PublicMailbox.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/PublicMailboxAlias.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/PublicMailboxMember.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/User.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/UserMailbox.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/UserMailboxAlias.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/mdm/MdmService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/mdm/v1/MdmService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/mdm/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/mdm/v1/resource/UserAuthDataRelation.java rename larksuite-oapi/src/main/java/com/lark/oapi/service/meeting_room/{v1 => }/MeetingRoomService.java (87%) create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/meeting_room/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/meeting_room/v1/resource/MeetingRoom.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/okr/OkrService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/OkrService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/resource/Image.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/resource/Okr.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/resource/Period.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/resource/ProgressRecord.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/resource/UserOkr.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/optical_char_recognition/OpticalCharRecognitionService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/optical_char_recognition/v1/OpticalCharRecognitionService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/optical_char_recognition/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/optical_char_recognition/v1/resource/Image.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/passport/PassportService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/passport/v1/PassportService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/passport/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/passport/v1/resource/Session.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/personal_settings/PersonalSettingsService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/personal_settings/v1/PersonalSettingsService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/personal_settings/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/personal_settings/v1/resource/SystemStatus.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/search/SearchService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/SearchService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/V2.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/model/SeperatePassage.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/resource/App.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/resource/DataSource.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/resource/DataSourceItem.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/resource/Message.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/resource/Schema.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/SecurityAndComplianceService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/SecurityAndComplianceService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/CreateMigrationEntityLocationEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/CreateMigrationItemsTaskStatusEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/DataArchivingUserStructDataArchivingChatterTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/DirectoryItemsEntityLocationEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/DirectoryItemsEntityTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/MigrationEntityCreatorTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/MigrationEntityLocationEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/MigrationEntityTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/MigrationItemsTaskStatusEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/CreateMigrationEntity.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/CreateMigrationItems.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/DataArchivingMessage.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/DataArchivingMessageStruct.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/DataArchivingUser.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/DataArchivingUserStruct.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/DirectoryItems.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/MigrationEntity.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/MigrationItems.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/resource/OpenapiLog.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/SheetsService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/SheetsService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/V3.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/resource/Spreadsheet.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/resource/SpreadsheetSheet.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/resource/SpreadsheetSheetFilter.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/resource/SpreadsheetSheetFilterView.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/resource/SpreadsheetSheetFilterViewCondition.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/resource/SpreadsheetSheetFloatImage.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/speech_to_text/SpeechToTextService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/speech_to_text/v1/SpeechToTextService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/speech_to_text/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/speech_to_text/v1/resource/Speech.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/TaskService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/TaskService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/resource/Task.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/resource/TaskCollaborator.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/resource/TaskComment.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/resource/TaskFollower.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/resource/TaskReminder.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/V2.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/CreateCustomFieldTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/CreateCustomFieldUserIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/CreateTasklistActivitySubscriptionUserIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/GetCustomFieldUserIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/GetTasklistActivitySubscriptionUserIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/InputCustomFieldTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/ListCommentDirectionEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/ListCustomFieldUserIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/ListTasklistActivitySubscriptionUserIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/NumberSettingCustomSymbolPositionEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/NumberSettingFormatEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/NumberSettingSeparatorEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/PatchCustomFieldUserIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/PatchTasklistActivitySubscriptionUserIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/PatchTasklistOriginOwnerToRoleEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/TaskDependencyDependencyTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/TaskSourceEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/UploadAttachmentUserIdTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ActivityRecord.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddCustomFieldReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddCustomFieldReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddCustomFieldResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddDependenciesTaskReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddDependenciesTaskReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddDependenciesTaskResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddDependenciesTaskRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTaskReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTaskReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTaskResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTaskRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTasklistReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTasklistReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTasklistResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTasklistRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddRemindersTaskReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddRemindersTaskReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddRemindersTaskResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddRemindersTaskRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddTasklistTaskReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddTasklistTaskReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddTasklistTaskResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddTasklistTaskRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Attachment.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Comment.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCommentReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCommentResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCommentRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCustomFieldOptionReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCustomFieldOptionResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCustomFieldOptionRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCustomFieldReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCustomFieldResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCustomFieldRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateSectionReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateSectionResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateSectionRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTaskReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTaskResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTaskRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTaskSubtaskReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTaskSubtaskResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTaskSubtaskRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTasklistActivitySubscriptionReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTasklistActivitySubscriptionResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTasklistActivitySubscriptionRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTasklistReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTasklistResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTasklistRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CustomComplete.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CustomCompleteItem.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CustomField.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CustomFieldValue.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DatetimeSetting.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteAttachmentReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteAttachmentResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteCommentReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteCommentResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteSectionReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteSectionResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteTaskReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteTaskResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteTasklistActivitySubscriptionReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteTasklistActivitySubscriptionResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteTasklistReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteTasklistResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DepartmentId.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DocxSource.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Due.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Dummy.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetAttachmentReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetAttachmentResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetAttachmentRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetCommentReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetCommentResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetCommentRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetCustomFieldReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetCustomFieldResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetCustomFieldRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetSectionReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetSectionResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetSectionRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTaskReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTaskResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTaskRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTasklistActivitySubscriptionReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTasklistActivitySubscriptionResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTasklistActivitySubscriptionRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTasklistReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTasklistResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTasklistRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Href.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/I18nText.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputAttachment.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputComment.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputCustomField.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputCustomFieldValue.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputOption.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputSection.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputTask.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputTasklist.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListAttachmentReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListAttachmentResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListAttachmentRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListCommentReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListCommentResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListCommentRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListCustomFieldReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListCustomFieldResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListCustomFieldRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListSectionReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListSectionResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListSectionRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTaskReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTaskResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTaskRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTaskSubtaskReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTaskSubtaskResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTaskSubtaskRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTasklistActivitySubscriptionReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTasklistActivitySubscriptionResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTasklistActivitySubscriptionRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTasklistReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTasklistResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTasklistRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Member.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/MemberSetting.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/NumberSetting.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Option.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Origin.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCommentReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCommentReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCommentResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCommentRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldOptionReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldOptionReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldOptionResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldOptionRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchSectionReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchSectionReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchSectionResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchSectionRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTaskReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTaskReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTaskResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTaskRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistActivitySubscriptionReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistActivitySubscriptionReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistActivitySubscriptionResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistActivitySubscriptionRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Reminder.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveCustomFieldReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveCustomFieldReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveCustomFieldResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveDependenciesTaskReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveDependenciesTaskReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveDependenciesTaskResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveDependenciesTaskRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTaskReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTaskReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTaskResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTaskRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTasklistReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTasklistReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTasklistResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTasklistRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveRemindersTaskReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveRemindersTaskReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveRemindersTaskResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveRemindersTaskRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveTasklistTaskReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveTasklistTaskReqBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveTasklistTaskResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveTasklistTaskRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Resource.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Section.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/SectionSummary.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/SelectSetting.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Start.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Task.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TaskDependency.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TaskInTasklistInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TaskStatistics.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TaskSubtask.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TaskSummary.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Tasklist.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasklistActivitySubscription.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasklistSummary.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasklistsTaskReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasklistsTaskResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasklistsTaskRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasksSectionReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasksSectionResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasksSectionRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasksTasklistReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasksTasklistResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasksTasklistRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TextSetting.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/UploadAttachmentReq.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/UploadAttachmentResp.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/UploadAttachmentRespBody.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/Attachment.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/Comment.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/CustomField.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/CustomFieldOption.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/Section.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/Task.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/TaskSubtask.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/Tasklist.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/TasklistActivitySubscription.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/tenant/TenantService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/tenant/v2/TenantService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/tenant/v2/V2.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/tenant/v2/resource/Tenant.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/tenant/v2/resource/TenantProductAssignInfo.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/translation/TranslationService.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/translation/v1/TranslationService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/translation/v1/V1.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/translation/v1/resource/Text.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/vc/VcService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/V1.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/VcService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/enums/GetMeetingListMeetingStatusTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/enums/GetParticipantListMeetingStatusTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/enums/MeetingListExportMeetingStatusTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/enums/ParticipantListExportMeetingStatusTypeEnum.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/Alert.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/Export.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/Meeting.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/MeetingList.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/MeetingRecording.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ParticipantList.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ParticipantQualityList.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/Report.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/Reserve.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ReserveConfig.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ReserveConfigAdmin.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ReserveConfigDisableInform.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ReserveConfigForm.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ResourceReservationList.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/Room.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/RoomConfig.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/RoomLevel.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ScopeConfig.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/WikiService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/V2.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/WikiService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/resource/Space.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/resource/SpaceMember.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/resource/SpaceNode.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/resource/SpaceSetting.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/resource/Task.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/workplace/WorkplaceService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/workplace/v1/V1.java delete mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/workplace/v1/WorkplaceService.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/workplace/v1/resource/CustomWorkplaceAccessData.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/workplace/v1/resource/WorkplaceAccessData.java create mode 100644 larksuite-oapi/src/main/java/com/lark/oapi/service/workplace/v1/resource/WorkplaceBlockAccessData.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListAuditInfoSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchCompanySample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetCompanySample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetEmployeeSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetEmployeesBpSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetEmployeesJobDataSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetJobFamilySample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetJobLevelSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetLocationSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/CreatePersonSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/CreatePreHireSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/CreateProbationAssessmentSample.java rename sample/src/main/java/com/lark/oapi/sample/apiall/{authenv1/GetAuthorizeSample.java => corehrv2/DeleteProbationAssessmentSample.java} (53%) create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/EnableDisableAssessmentProbationSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/GetByDepartmentBpSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/GetJobSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/GetProcessSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/ListBpSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/ListJobSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/ListProcessSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/ParentsDepartmentSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/PatchPersonSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/PatchProbationAssessmentSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/QueryEmployeesJobDataSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchContractSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchDepartmentSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchEmployeeSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchJobChangeSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchProbationSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/drivev2/GetPermissionPublicSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/drivev2/PatchPermissionPublicSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/DeleteEntitySample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddCustomFieldSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddDependenciesTaskSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddMembersTaskSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddMembersTasklistSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddRemindersTaskSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddTasklistTaskSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateCommentSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateCustomFieldOptionSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateCustomFieldSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateSectionSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateTaskSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateTaskSubtaskSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateTasklistActivitySubscriptionSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateTasklistSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteAttachmentSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteCommentSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteSectionSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteTaskSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteTasklistActivitySubscriptionSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteTasklistSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetAttachmentSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetCommentSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetCustomFieldSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetSectionSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetTaskSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetTasklistActivitySubscriptionSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetTasklistSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListAttachmentSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListCommentSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListCustomFieldSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListSectionSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListTaskSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListTaskSubtaskSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListTasklistActivitySubscriptionSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListTasklistSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchCommentSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchCustomFieldOptionSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchCustomFieldSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchSectionSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchTaskSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchTasklistActivitySubscriptionSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchTasklistSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveCustomFieldSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveDependenciesTaskSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveMembersTaskSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveMembersTasklistSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveRemindersTaskSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveTasklistTaskSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/TasklistsTaskSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/TasksSectionSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/TasksTasklistSample.java create mode 100644 sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/UploadAttachmentSample.java diff --git a/README.md b/README.md index dc6c7ec69..82bda7789 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ com.larksuite.oapi oapi-sdk - 2.0.30 + 2.1.0 ``` - 如无法获取oapi-sdk依赖,请在 pom.xml 的 里增加 diff --git a/larksuite-oapi/pom.xml b/larksuite-oapi/pom.xml index 256e7b6bc..675fc3af2 100644 --- a/larksuite-oapi/pom.xml +++ b/larksuite-oapi/pom.xml @@ -242,5 +242,5 @@ https://github.com/larksuite/oapi-sdk-java - 2.0.30 + 2.1.0 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/Client.java b/larksuite-oapi/src/main/java/com/lark/oapi/Client.java index b3887ac4f..f04790b18 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/Client.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/Client.java @@ -27,48 +27,48 @@ import com.lark.oapi.core.utils.OKHttps; import com.lark.oapi.core.utils.Sets; import com.lark.oapi.core.utils.Strings; -import com.lark.oapi.service.acs.v1.AcsService; -import com.lark.oapi.service.admin.v1.AdminService; -import com.lark.oapi.service.application.v6.ApplicationService; -import com.lark.oapi.service.approval.v4.ApprovalService; -import com.lark.oapi.service.attendance.v1.AttendanceService; -import com.lark.oapi.service.auth.v3.AuthService; -import com.lark.oapi.service.authen.v1.AuthenService; -import com.lark.oapi.service.baike.v1.BaikeService; -import com.lark.oapi.service.bitable.v1.BitableService; -import com.lark.oapi.service.block.v2.BlockService; -import com.lark.oapi.service.calendar.v4.CalendarService; -import com.lark.oapi.service.contact.v3.ContactService; -import com.lark.oapi.service.corehr.v1.CorehrService; -import com.lark.oapi.service.document_ai.v1.DocumentAiService; -import com.lark.oapi.service.docx.v1.DocxService; -import com.lark.oapi.service.drive.v1.DriveService; -import com.lark.oapi.service.ehr.v1.EhrService; -import com.lark.oapi.service.event.v1.EventService; +import com.lark.oapi.service.acs.AcsService; +import com.lark.oapi.service.admin.AdminService; +import com.lark.oapi.service.application.ApplicationService; +import com.lark.oapi.service.approval.ApprovalService; +import com.lark.oapi.service.attendance.AttendanceService; +import com.lark.oapi.service.auth.AuthService; +import com.lark.oapi.service.authen.AuthenService; +import com.lark.oapi.service.baike.BaikeService; +import com.lark.oapi.service.bitable.BitableService; +import com.lark.oapi.service.block.BlockService; +import com.lark.oapi.service.calendar.CalendarService; +import com.lark.oapi.service.contact.ContactService; +import com.lark.oapi.service.corehr.CorehrService; +import com.lark.oapi.service.document_ai.DocumentAiService; +import com.lark.oapi.service.docx.DocxService; +import com.lark.oapi.service.drive.DriveService; +import com.lark.oapi.service.ehr.EhrService; +import com.lark.oapi.service.event.EventService; import com.lark.oapi.service.ext.ExtService; -import com.lark.oapi.service.gray_test_open_sg.v1.GrayTestOpenSgService; -import com.lark.oapi.service.helpdesk.v1.HelpdeskService; -import com.lark.oapi.service.hire.v1.HireService; -import com.lark.oapi.service.human_authentication.v1.HumanAuthenticationService; -import com.lark.oapi.service.im.v1.ImService; -import com.lark.oapi.service.lingo.v1.LingoService; -import com.lark.oapi.service.mail.v1.MailService; -import com.lark.oapi.service.mdm.v1.MdmService; -import com.lark.oapi.service.meeting_room.v1.MeetingRoomService; -import com.lark.oapi.service.okr.v1.OkrService; -import com.lark.oapi.service.optical_char_recognition.v1.OpticalCharRecognitionService; -import com.lark.oapi.service.passport.v1.PassportService; -import com.lark.oapi.service.personal_settings.v1.PersonalSettingsService; -import com.lark.oapi.service.search.v2.SearchService; -import com.lark.oapi.service.security_and_compliance.v1.SecurityAndComplianceService; -import com.lark.oapi.service.sheets.v3.SheetsService; -import com.lark.oapi.service.speech_to_text.v1.SpeechToTextService; -import com.lark.oapi.service.task.v1.TaskService; -import com.lark.oapi.service.tenant.v2.TenantService; -import com.lark.oapi.service.translation.v1.TranslationService; -import com.lark.oapi.service.vc.v1.VcService; -import com.lark.oapi.service.wiki.v2.WikiService; -import com.lark.oapi.service.workplace.v1.WorkplaceService; +import com.lark.oapi.service.gray_test_open_sg.GrayTestOpenSgService; +import com.lark.oapi.service.helpdesk.HelpdeskService; +import com.lark.oapi.service.hire.HireService; +import com.lark.oapi.service.human_authentication.HumanAuthenticationService; +import com.lark.oapi.service.im.ImService; +import com.lark.oapi.service.lingo.LingoService; +import com.lark.oapi.service.mail.MailService; +import com.lark.oapi.service.mdm.MdmService; +import com.lark.oapi.service.meeting_room.MeetingRoomService; +import com.lark.oapi.service.okr.OkrService; +import com.lark.oapi.service.optical_char_recognition.OpticalCharRecognitionService; +import com.lark.oapi.service.passport.PassportService; +import com.lark.oapi.service.personal_settings.PersonalSettingsService; +import com.lark.oapi.service.search.SearchService; +import com.lark.oapi.service.security_and_compliance.SecurityAndComplianceService; +import com.lark.oapi.service.sheets.SheetsService; +import com.lark.oapi.service.speech_to_text.SpeechToTextService; +import com.lark.oapi.service.task.TaskService; +import com.lark.oapi.service.tenant.TenantService; +import com.lark.oapi.service.translation.TranslationService; +import com.lark.oapi.service.vc.VcService; +import com.lark.oapi.service.wiki.WikiService; +import com.lark.oapi.service.workplace.WorkplaceService; import java.nio.charset.StandardCharsets; import java.util.concurrent.TimeUnit; @@ -76,47 +76,47 @@ public class Client { private Config config; - private AcsService acs; // 智能门禁 - private AdminService admin; // 管理后台-数据报表 - private ApplicationService application; // 应用信息 - private ApprovalService approval; // 审批 - private AttendanceService attendance; // 打卡 - private AuthService auth; // - private AuthenService authen; // - private BaikeService baike; // 企业百科 - private BitableService bitable; // 云文档-多维表格 - private BlockService block; // 小组件 - private CalendarService calendar; // 日历 - private ContactService contact; // 通讯录 - private CorehrService corehr; // CoreHR - private DocumentAiService documentAi; // - private DocxService docx; // 云文档-文档 - private DriveService drive; // 云文档-文件管理 - private EhrService ehr; // 智能人事 - private EventService event; // 事件订阅 - private GrayTestOpenSgService grayTestOpenSg; // - private HelpdeskService helpdesk; // 服务台 - private HireService hire; // 招聘 - private HumanAuthenticationService humanAuthentication; // 实名认证 - private ImService im; // 消息与群组 - private LingoService lingo; // - private MailService mail; // 邮箱 - private MdmService mdm; // 主数据 - private MeetingRoomService meetingRoom; // - private OkrService okr; // OKR - private OpticalCharRecognitionService opticalCharRecognition; // AI能力 - private PassportService passport; // 帐号 - private PersonalSettingsService personalSettings; // 个人设置 - private SearchService search; // 搜索 - private SecurityAndComplianceService securityAndCompliance; // - private SheetsService sheets; // 云文档-电子表格 - private SpeechToTextService speechToText; // AI能力 - private TaskService task; // 任务 - private TenantService tenant; // 企业信息 - private TranslationService translation; // AI能力 - private VcService vc; // 视频会议 - private WikiService wiki; // 云文档-知识库 - private WorkplaceService workplace; // + private ApplicationService application; + private LingoService lingo; + private PersonalSettingsService personalSettings; + private SearchService search; + private WikiService wiki; + private AttendanceService attendance; + private BaikeService baike; + private DocumentAiService documentAi; + private ImService im; + private WorkplaceService workplace; + private AuthenService authen; + private DriveService drive; + private HireService hire; + private EhrService ehr; + private HelpdeskService helpdesk; + private MdmService mdm; + private SecurityAndComplianceService securityAndCompliance; + private SheetsService sheets; + private BlockService block; + private ContactService contact; + private CorehrService corehr; + private SpeechToTextService speechToText; + private MeetingRoomService meetingRoom; + private TenantService tenant; + private TranslationService translation; + private AdminService admin; + private CalendarService calendar; + private MailService mail; + private PassportService passport; + private AcsService acs; + private ApprovalService approval; + private HumanAuthenticationService humanAuthentication; + private OkrService okr; + private VcService vc; + private AuthService auth; + private DocxService docx; + private GrayTestOpenSgService grayTestOpenSg; + private TaskService task; + private BitableService bitable; + private EventService event; + private OpticalCharRecognitionService opticalCharRecognition; private ExtService extService; @@ -132,357 +132,168 @@ public void setConfig(Config config) { this.config = config; } - /** - * 智能门禁 - * - * @return - */ - public AcsService acs() { - return acs; - } - - /** - * 管理后台-数据报表 - * - * @return - */ - public AdminService admin() { - return admin; - } - - /** - * 应用信息 - * - * @return - */ public ApplicationService application() { return application; } - /** - * 审批 - * - * @return - */ - public ApprovalService approval() { - return approval; + public LingoService lingo() { + return lingo; } - /** - * 打卡 - * - * @return - */ - public AttendanceService attendance() { - return attendance; + public PersonalSettingsService personalSettings() { + return personalSettings; } - /** - * @return - */ - public AuthService auth() { - return auth; + public SearchService search() { + return search; } - /** - * @return - */ - public AuthenService authen() { - return authen; + public WikiService wiki() { + return wiki; + } + + public AttendanceService attendance() { + return attendance; } - /** - * 企业百科 - * - * @return - */ public BaikeService baike() { return baike; } - /** - * 云文档-多维表格 - * - * @return - */ - public BitableService bitable() { - return bitable; + public DocumentAiService documentAi() { + return documentAi; } - /** - * 小组件 - * - * @return - */ - public BlockService block() { - return block; + public ImService im() { + return im; } - /** - * 日历 - * - * @return - */ - public CalendarService calendar() { - return calendar; + public WorkplaceService workplace() { + return workplace; } - /** - * 通讯录 - * - * @return - */ - public ContactService contact() { - return contact; + public AuthenService authen() { + return authen; } - /** - * CoreHR - * - * @return - */ - public CorehrService corehr() { - return corehr; + public DriveService drive() { + return drive; } - /** - * @return - */ - public DocumentAiService documentAi() { - return documentAi; + public HireService hire() { + return hire; } - /** - * 云文档-文档 - * - * @return - */ - public DocxService docx() { - return docx; + public EhrService ehr() { + return ehr; } - /** - * 云文档-文件管理 - * - * @return - */ - public DriveService drive() { - return drive; + public HelpdeskService helpdesk() { + return helpdesk; } - /** - * 智能人事 - * - * @return - */ - public EhrService ehr() { - return ehr; + public MdmService mdm() { + return mdm; } - /** - * 事件订阅 - * - * @return - */ - public EventService event() { - return event; + public SecurityAndComplianceService securityAndCompliance() { + return securityAndCompliance; } - /** - * @return - */ - public GrayTestOpenSgService grayTestOpenSg() { - return grayTestOpenSg; + public SheetsService sheets() { + return sheets; } - /** - * 服务台 - * - * @return - */ - public HelpdeskService helpdesk() { - return helpdesk; + public BlockService block() { + return block; } - /** - * 招聘 - * - * @return - */ - public HireService hire() { - return hire; + public ContactService contact() { + return contact; } - /** - * 实名认证 - * - * @return - */ - public HumanAuthenticationService humanAuthentication() { - return humanAuthentication; + public CorehrService corehr() { + return corehr; } - /** - * 消息与群组 - * - * @return - */ - public ImService im() { - return im; + public SpeechToTextService speechToText() { + return speechToText; } - /** - * @return - */ - public LingoService lingo() { - return lingo; + public MeetingRoomService meetingRoom() { + return meetingRoom; } - /** - * 邮箱 - * - * @return - */ - public MailService mail() { - return mail; + public TenantService tenant() { + return tenant; } - /** - * 主数据 - * - * @return - */ - public MdmService mdm() { - return mdm; + public TranslationService translation() { + return translation; } - /** - * @return - */ - public MeetingRoomService meetingRoom() { - return meetingRoom; + public AdminService admin() { + return admin; } - /** - * OKR - * - * @return - */ - public OkrService okr() { - return okr; + public CalendarService calendar() { + return calendar; } - /** - * AI能力 - * - * @return - */ - public OpticalCharRecognitionService opticalCharRecognition() { - return opticalCharRecognition; + public MailService mail() { + return mail; } - /** - * 帐号 - * - * @return - */ public PassportService passport() { return passport; } - /** - * 个人设置 - * - * @return - */ - public PersonalSettingsService personalSettings() { - return personalSettings; + public AcsService acs() { + return acs; } - /** - * 搜索 - * - * @return - */ - public SearchService search() { - return search; + public ApprovalService approval() { + return approval; } - /** - * @return - */ - public SecurityAndComplianceService securityAndCompliance() { - return securityAndCompliance; + public HumanAuthenticationService humanAuthentication() { + return humanAuthentication; } - /** - * 云文档-电子表格 - * - * @return - */ - public SheetsService sheets() { - return sheets; + public OkrService okr() { + return okr; } - /** - * AI能力 - * - * @return - */ - public SpeechToTextService speechToText() { - return speechToText; + public VcService vc() { + return vc; } - /** - * 任务 - * - * @return - */ - public TaskService task() { - return task; + public AuthService auth() { + return auth; } - /** - * 企业信息 - * - * @return - */ - public TenantService tenant() { - return tenant; + public DocxService docx() { + return docx; } - /** - * AI能力 - * - * @return - */ - public TranslationService translation() { - return translation; + public GrayTestOpenSgService grayTestOpenSg() { + return grayTestOpenSg; } - /** - * 视频会议 - * - * @return - */ - public VcService vc() { - return vc; + public TaskService task() { + return task; } - /** - * 云文档-知识库 - * - * @return - */ - public WikiService wiki() { - return wiki; + public BitableService bitable() { + return bitable; } - /** - * @return - */ - public WorkplaceService workplace() { - return workplace; + public EventService event() { + return event; + } + + public OpticalCharRecognitionService opticalCharRecognition() { + return opticalCharRecognition; } public RawResponse post(String httpPath @@ -656,47 +467,47 @@ public Client build() { initCache(config); initHttpTransport(config); client.extService = new ExtService(config); - client.acs = new AcsService(config); - client.admin = new AdminService(config); client.application = new ApplicationService(config); - client.approval = new ApprovalService(config); + client.lingo = new LingoService(config); + client.personalSettings = new PersonalSettingsService(config); + client.search = new SearchService(config); + client.wiki = new WikiService(config); client.attendance = new AttendanceService(config); - client.auth = new AuthService(config); - client.authen = new AuthenService(config); client.baike = new BaikeService(config); - client.bitable = new BitableService(config); - client.block = new BlockService(config); - client.calendar = new CalendarService(config); - client.contact = new ContactService(config); - client.corehr = new CorehrService(config); client.documentAi = new DocumentAiService(config); - client.docx = new DocxService(config); + client.im = new ImService(config); + client.workplace = new WorkplaceService(config); + client.authen = new AuthenService(config); client.drive = new DriveService(config); + client.hire = new HireService(config); client.ehr = new EhrService(config); - client.event = new EventService(config); - client.grayTestOpenSg = new GrayTestOpenSgService(config); client.helpdesk = new HelpdeskService(config); - client.hire = new HireService(config); - client.humanAuthentication = new HumanAuthenticationService(config); - client.im = new ImService(config); - client.lingo = new LingoService(config); - client.mail = new MailService(config); client.mdm = new MdmService(config); - client.meetingRoom = new MeetingRoomService(config); - client.okr = new OkrService(config); - client.opticalCharRecognition = new OpticalCharRecognitionService(config); - client.passport = new PassportService(config); - client.personalSettings = new PersonalSettingsService(config); - client.search = new SearchService(config); client.securityAndCompliance = new SecurityAndComplianceService(config); client.sheets = new SheetsService(config); + client.block = new BlockService(config); + client.contact = new ContactService(config); + client.corehr = new CorehrService(config); client.speechToText = new SpeechToTextService(config); - client.task = new TaskService(config); + client.meetingRoom = new MeetingRoomService(config); client.tenant = new TenantService(config); client.translation = new TranslationService(config); + client.admin = new AdminService(config); + client.calendar = new CalendarService(config); + client.mail = new MailService(config); + client.passport = new PassportService(config); + client.acs = new AcsService(config); + client.approval = new ApprovalService(config); + client.humanAuthentication = new HumanAuthenticationService(config); + client.okr = new OkrService(config); client.vc = new VcService(config); - client.wiki = new WikiService(config); - client.workplace = new WorkplaceService(config); + client.auth = new AuthService(config); + client.docx = new DocxService(config); + client.grayTestOpenSg = new GrayTestOpenSgService(config); + client.task = new TaskService(config); + client.bitable = new BitableService(config); + client.event = new EventService(config); + client.opticalCharRecognition = new OpticalCharRecognitionService(config); return client; } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/event/EventDispatcher.java b/larksuite-oapi/src/main/java/com/lark/oapi/event/EventDispatcher.java index 0192b8d88..562c2ee03 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/event/EventDispatcher.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/event/EventDispatcher.java @@ -28,19 +28,19 @@ import com.lark.oapi.event.model.BaseEvent; import com.lark.oapi.event.model.BaseEventV2; import com.lark.oapi.event.model.Fuzzy; -import com.lark.oapi.service.acs.v1.AcsService; -import com.lark.oapi.service.application.v6.ApplicationService; -import com.lark.oapi.service.approval.v4.ApprovalService; -import com.lark.oapi.service.calendar.v4.CalendarService; -import com.lark.oapi.service.contact.v3.ContactService; -import com.lark.oapi.service.corehr.v1.CorehrService; -import com.lark.oapi.service.drive.v1.DriveService; -import com.lark.oapi.service.helpdesk.v1.HelpdeskService; -import com.lark.oapi.service.hire.v1.HireService; -import com.lark.oapi.service.im.v1.ImService; -import com.lark.oapi.service.meeting_room.v1.MeetingRoomService; -import com.lark.oapi.service.task.v1.TaskService; -import com.lark.oapi.service.vc.v1.VcService; +import com.lark.oapi.service.acs.AcsService; +import com.lark.oapi.service.application.ApplicationService; +import com.lark.oapi.service.approval.ApprovalService; +import com.lark.oapi.service.calendar.CalendarService; +import com.lark.oapi.service.contact.ContactService; +import com.lark.oapi.service.corehr.CorehrService; +import com.lark.oapi.service.drive.DriveService; +import com.lark.oapi.service.helpdesk.HelpdeskService; +import com.lark.oapi.service.hire.HireService; +import com.lark.oapi.service.im.ImService; +import com.lark.oapi.service.meeting_room.MeetingRoomService; +import com.lark.oapi.service.task.TaskService; +import com.lark.oapi.service.vc.VcService; import org.apache.commons.codec.binary.Hex; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -831,6 +831,51 @@ public Builder onP2EmploymentUpdatedV1(CorehrService.P2EmploymentUpdatedV1Handle return this; } + /** + *

, + *

事件描述文档链接: + * + * @param handler + * @return + */ + public Builder onP2JobCreatedV1(CorehrService.P2JobCreatedV1Handler handler) { + if (eventType2EventHandler.containsKey("corehr.job.created_v1")) { + throw new EventTypeAlreadyHasHandlerException("corehr.job.created_v1"); + } + eventType2EventHandler.put("corehr.job.created_v1", handler); + return this; + } + + /** + *

, + *

事件描述文档链接: + * + * @param handler + * @return + */ + public Builder onP2JobDeletedV1(CorehrService.P2JobDeletedV1Handler handler) { + if (eventType2EventHandler.containsKey("corehr.job.deleted_v1")) { + throw new EventTypeAlreadyHasHandlerException("corehr.job.deleted_v1"); + } + eventType2EventHandler.put("corehr.job.deleted_v1", handler); + return this; + } + + /** + *

, + *

事件描述文档链接: + * + * @param handler + * @return + */ + public Builder onP2JobUpdatedV1(CorehrService.P2JobUpdatedV1Handler handler) { + if (eventType2EventHandler.containsKey("corehr.job.updated_v1")) { + throw new EventTypeAlreadyHasHandlerException("corehr.job.updated_v1"); + } + eventType2EventHandler.put("corehr.job.updated_v1", handler); + return this; + } + /** *

异动状态变更事件,在异动发起审批和产生审批结果时触发该事件,审批结果产生的场景包括撤销、审批通过、审批拒绝 *

事件描述文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_change/events/updated @@ -966,6 +1011,66 @@ public Builder onP2PreHireUpdatedV1(CorehrService.P2PreHireUpdatedV1Handler hand return this; } + /** + *

, + *

事件描述文档链接: + * + * @param handler + * @return + */ + public Builder onP2ProbationUpdatedV2(CorehrService.P2ProbationUpdatedV2Handler handler) { + if (eventType2EventHandler.containsKey("corehr.probation.updated_v2")) { + throw new EventTypeAlreadyHasHandlerException("corehr.probation.updated_v2"); + } + eventType2EventHandler.put("corehr.probation.updated_v2", handler); + return this; + } + + /** + *

, + *

事件描述文档链接: + * + * @param handler + * @return + */ + public Builder onP2ProcessUpdatedV2(CorehrService.P2ProcessUpdatedV2Handler handler) { + if (eventType2EventHandler.containsKey("corehr.process.updated_v2")) { + throw new EventTypeAlreadyHasHandlerException("corehr.process.updated_v2"); + } + eventType2EventHandler.put("corehr.process.updated_v2", handler); + return this; + } + + /** + *

, + *

事件描述文档链接: + * + * @param handler + * @return + */ + public Builder onP2ProcessApproverUpdatedV2(CorehrService.P2ProcessApproverUpdatedV2Handler handler) { + if (eventType2EventHandler.containsKey("corehr.process.approver.updated_v2")) { + throw new EventTypeAlreadyHasHandlerException("corehr.process.approver.updated_v2"); + } + eventType2EventHandler.put("corehr.process.approver.updated_v2", handler); + return this; + } + + /** + *

, + *

事件描述文档链接: + * + * @param handler + * @return + */ + public Builder onP2ProcessCcUpdatedV2(CorehrService.P2ProcessCcUpdatedV2Handler handler) { + if (eventType2EventHandler.containsKey("corehr.process.cc.updated_v2")) { + throw new EventTypeAlreadyHasHandlerException("corehr.process.cc.updated_v2"); + } + eventType2EventHandler.put("corehr.process.cc.updated_v2", handler); + return this; + } + /** *

多维表格字段变更,多维表格字段变更 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/AcsService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/AcsService.java new file mode 100644 index 000000000..ef00a589a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/AcsService.java @@ -0,0 +1,76 @@ +// Code generated by lark suite 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 com.lark.oapi.service.acs; + +import com.lark.oapi.core.Config; +import com.lark.oapi.event.IEventHandler; +import com.lark.oapi.service.acs.v1.V1; +import com.lark.oapi.service.acs.v1.model.P2AccessRecordCreatedV1; +import com.lark.oapi.service.acs.v1.model.P2UserUpdatedV1; +import com.lark.oapi.service.acs.v1.resource.*; + +public class AcsService { + private final V1 v1; + private final AccessRecord accessRecord; // 门禁记录 + private final AccessRecordAccessPhoto accessRecordAccessPhoto; // access_record.access_photo + private final Device device; // 门禁设备 + private final User user; // 用户管理 + private final UserFace userFace; // user.face + + public AcsService(Config config) { + this.v1 = new V1(config); + this.accessRecord = new AccessRecord(config); + this.accessRecordAccessPhoto = new AccessRecordAccessPhoto(config); + this.device = new Device(config); + this.user = new User(config); + this.userFace = new UserFace(config); + } + + public V1 v1() { + return v1; + } + + public AccessRecord accessRecord() { + return accessRecord; + } + + public AccessRecordAccessPhoto accessRecordAccessPhoto() { + return accessRecordAccessPhoto; + } + + public Device device() { + return device; + } + + public User user() { + return user; + } + + public UserFace userFace() { + return userFace; + } + + public abstract static class P2AccessRecordCreatedV1Handler implements IEventHandler { + @Override + public P2AccessRecordCreatedV1 getEvent() { + return new P2AccessRecordCreatedV1(); + } + } + + public abstract static class P2UserUpdatedV1Handler implements IEventHandler { + @Override + public P2UserUpdatedV1 getEvent() { + return new P2UserUpdatedV1(); + } + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/AcsService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/AcsService.java deleted file mode 100644 index 1b77aad46..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/AcsService.java +++ /dev/null @@ -1,720 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.acs.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.event.IEventHandler; -import com.lark.oapi.service.acs.v1.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.ByteArrayOutputStream; -import java.nio.charset.StandardCharsets; - -public class AcsService { - private static final Logger log = LoggerFactory.getLogger(AcsService.class); - private final AccessRecord accessRecord; // 门禁记录 - private final AccessRecordAccessPhoto accessRecordAccessPhoto; // access_record.access_photo - private final Device device; // 门禁设备 - private final User user; // 用户管理 - private final UserFace userFace; // user.face - - public AcsService(Config config) { - this.accessRecord = new AccessRecord(config); - this.accessRecordAccessPhoto = new AccessRecordAccessPhoto(config); - this.device = new Device(config); - this.user = new User(config); - this.userFace = new UserFace(config); - } - - /** - * 门禁记录 - * - * @return - */ - public AccessRecord accessRecord() { - return accessRecord; - } - - /** - * access_record.access_photo - * - * @return - */ - public AccessRecordAccessPhoto accessRecordAccessPhoto() { - return accessRecordAccessPhoto; - } - - /** - * 门禁设备 - * - * @return - */ - public Device device() { - return device; - } - - /** - * 用户管理 - * - * @return - */ - public User user() { - return user; - } - - /** - * user.face - * - * @return - */ - public UserFace userFace() { - return userFace; - } - - public static class AccessRecord { - private final Config config; - - public AccessRecord(Config config) { - this.config = config; - } - - /** - * 获取门禁记录列表,用户在门禁考勤机上成功开门或打卡后,智能门禁应用都会生成一条门禁记录。;;该接口返回满足查询参数的识别记录。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/access_record/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/ListAccessRecordSample.java ; - */ - public ListAccessRecordResp list(ListAccessRecordReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/acs/v1/access_records" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListAccessRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAccessRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/access_records" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取门禁记录列表,用户在门禁考勤机上成功开门或打卡后,智能门禁应用都会生成一条门禁记录。;;该接口返回满足查询参数的识别记录。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/access_record/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/ListAccessRecordSample.java ; - */ - public ListAccessRecordResp list(ListAccessRecordReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/acs/v1/access_records" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListAccessRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAccessRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/access_records" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class AccessRecordAccessPhoto { - private final Config config; - - public AccessRecordAccessPhoto(Config config) { - this.config = config; - } - - /** - * 下载开门时的人脸识别图片,用户在门禁考勤机上成功开门或打卡后,智能门禁应用都会生成一条门禁记录,对于使用人脸识别方式进行开门的识别记录,还会有抓拍图。;;可以用该接口下载开门时的人脸识别照片。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/access_record-access_photo/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/GetAccessRecordAccessPhotoSample.java ; - */ - public GetAccessRecordAccessPhotoResp get(GetAccessRecordAccessPhotoReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/acs/v1/access_records/:access_record_id/access_photo" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - if (httpResponse.getStatusCode() == 200) { - GetAccessRecordAccessPhotoResp resp = new GetAccessRecordAccessPhotoResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - GetAccessRecordAccessPhotoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAccessRecordAccessPhotoResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/access_records/:access_record_id/access_photo" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 下载开门时的人脸识别图片,用户在门禁考勤机上成功开门或打卡后,智能门禁应用都会生成一条门禁记录,对于使用人脸识别方式进行开门的识别记录,还会有抓拍图。;;可以用该接口下载开门时的人脸识别照片。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/access_record-access_photo/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/GetAccessRecordAccessPhotoSample.java ; - */ - public GetAccessRecordAccessPhotoResp get(GetAccessRecordAccessPhotoReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/acs/v1/access_records/:access_record_id/access_photo" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 下载请求,返回流 - if (httpResponse.getStatusCode() == 200) { - GetAccessRecordAccessPhotoResp resp = new GetAccessRecordAccessPhotoResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - GetAccessRecordAccessPhotoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAccessRecordAccessPhotoResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/access_records/:access_record_id/access_photo" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Device { - private final Config config; - - public Device(Config config) { - this.config = config; - } - - /** - * 获取门禁设备列表,使用该接口获取租户内所有门禁设备。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/device/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/ListDeviceSample.java ; - */ - public ListDeviceResp list(RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/acs/v1/devices" - , Sets.newHashSet(AccessTokenType.Tenant) - , null); - - // 反序列化 - ListDeviceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDeviceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/devices" - , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - return resp; - } - - /** - * 获取门禁设备列表,使用该接口获取租户内所有门禁设备。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/device/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/ListDeviceSample.java ; - */ - public ListDeviceResp list() throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/acs/v1/devices" - , Sets.newHashSet(AccessTokenType.Tenant) - , null); - - // 反序列化 - ListDeviceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDeviceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/devices" - , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - return resp; - } - } - - public static class User { - private final Config config; - - public User(Config config) { - this.config = config; - } - - /** - * 获取单个用户信息,该接口用于获取智能门禁中单个用户的信息。 - *

只能获取已加入智能门禁权限组的用户 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/GetUserSample.java ; - */ - public GetUserResp get(GetUserReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/acs/v1/users/:user_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/users/:user_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取单个用户信息,该接口用于获取智能门禁中单个用户的信息。 - *

只能获取已加入智能门禁权限组的用户 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/GetUserSample.java ; - */ - public GetUserResp get(GetUserReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/acs/v1/users/:user_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/users/:user_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取用户列表,使用该接口获取智能门禁中所有用户信息。 - *

只能获取已加入智能门禁权限组的用户。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/ListUserSample.java ; - */ - public ListUserResp list(ListUserReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/acs/v1/users" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/users" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取用户列表,使用该接口获取智能门禁中所有用户信息。 - *

只能获取已加入智能门禁权限组的用户。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/ListUserSample.java ; - */ - public ListUserResp list(ListUserReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/acs/v1/users" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/users" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改用户部分信息,飞书智能门禁在人脸识别成功后会有韦根信号输出,输出用户的卡号。;对于使用韦根协议的门禁系统,企业可使用该接口录入用户卡号。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/PatchUserSample.java ; - */ - public PatchUserResp patch(PatchUserReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/acs/v1/users/:user_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/users/:user_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改用户部分信息,飞书智能门禁在人脸识别成功后会有韦根信号输出,输出用户的卡号。;对于使用韦根协议的门禁系统,企业可使用该接口录入用户卡号。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/PatchUserSample.java ; - */ - public PatchUserResp patch(PatchUserReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/acs/v1/users/:user_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/users/:user_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class UserFace { - private final Config config; - - public UserFace(Config config) { - this.config = config; - } - - /** - * 下载人脸图片,对于已经录入人脸图片的用户,可以使用该接口下载用户人脸图片。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user-face/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/GetUserFaceSample.java ; - */ - public GetUserFaceResp get(GetUserFaceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/acs/v1/users/:user_id/face" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - if (httpResponse.getStatusCode() == 200) { - GetUserFaceResp resp = new GetUserFaceResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - GetUserFaceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetUserFaceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/users/:user_id/face" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 下载人脸图片,对于已经录入人脸图片的用户,可以使用该接口下载用户人脸图片。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user-face/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/GetUserFaceSample.java ; - */ - public GetUserFaceResp get(GetUserFaceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/acs/v1/users/:user_id/face" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 下载请求,返回流 - if (httpResponse.getStatusCode() == 200) { - GetUserFaceResp resp = new GetUserFaceResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - GetUserFaceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetUserFaceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/users/:user_id/face" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 上传人脸图片,用户需要录入人脸图片才可以使用门禁考勤机。使用该 API 上传门禁用户的人脸图片。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user-face/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/UpdateUserFaceSample.java ; - */ - public UpdateUserFaceResp update(UpdateUserFaceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/acs/v1/users/:user_id/face" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateUserFaceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateUserFaceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/users/:user_id/face" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 上传人脸图片,用户需要录入人脸图片才可以使用门禁考勤机。使用该 API 上传门禁用户的人脸图片。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user-face/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/UpdateUserFaceSample.java ; - */ - public UpdateUserFaceResp update(UpdateUserFaceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/acs/v1/users/:user_id/face" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateUserFaceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateUserFaceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/users/:user_id/face" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public abstract static class P2AccessRecordCreatedV1Handler implements IEventHandler { - @Override - public P2AccessRecordCreatedV1 getEvent() { - return new P2AccessRecordCreatedV1(); - } - } - - public abstract static class P2UserUpdatedV1Handler implements IEventHandler { - @Override - public P2UserUpdatedV1 getEvent() { - return new P2UserUpdatedV1(); - } - } -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/V1.java new file mode 100644 index 000000000..d60dd9591 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/V1.java @@ -0,0 +1,53 @@ +// Code generated by lark suite 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 com.lark.oapi.service.acs.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.acs.v1.resource.*; + +public class V1 { + private final AccessRecord accessRecord; // 门禁记录 + private final AccessRecordAccessPhoto accessRecordAccessPhoto; // access_record.access_photo + private final Device device; // 门禁设备 + private final User user; // 用户管理 + private final UserFace userFace; // user.face + + public V1(Config config) { + this.accessRecord = new AccessRecord(config); + this.accessRecordAccessPhoto = new AccessRecordAccessPhoto(config); + this.device = new Device(config); + this.user = new User(config); + this.userFace = new UserFace(config); + } + + public AccessRecord accessRecord() { + return accessRecord; + } + + public AccessRecordAccessPhoto accessRecordAccessPhoto() { + return accessRecordAccessPhoto; + } + + public Device device() { + return device; + } + + public User user() { + return user; + } + + public UserFace userFace() { + return userFace; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/enums/AccessRecordAccessTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/enums/AccessRecordAccessTypeEnum.java index 24466fe50..e61194143 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/enums/AccessRecordAccessTypeEnum.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/enums/AccessRecordAccessTypeEnum.java @@ -17,7 +17,9 @@ * 识别方式 */ public enum AccessRecordAccessTypeEnum { - FA("FA"), // 人脸识别方式 + FACE("FA"), // 人脸识别方式 + QRCODE("QRCode"), // 二维码识别方式 + CARD("Card"), // 卡片识别方式 ; private String value; diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/enums/PropertyOnlineStatusEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/enums/PropertyOnlineStatusEnum.java new file mode 100644 index 000000000..c1a9907af --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/enums/PropertyOnlineStatusEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.acs.v1.enums; + +/** + * 在线状态 + */ +public enum PropertyOnlineStatusEnum { + ONLINE(1), // 在线 + OFFLINE(0), // 离线 + ; + private Integer value; + + PropertyOnlineStatusEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/enums/UserExternalUserTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/enums/UserExternalUserTypeEnum.java new file mode 100644 index 000000000..6dff6aad4 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/enums/UserExternalUserTypeEnum.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.acs.v1.enums; + +/** + * 用户类型 + */ +public enum UserExternalUserTypeEnum { + USER(1), // 员工 + DEPARTMENT(2), // 部门 + TENANT(10), // 全体员工 + GUEST(11), // 访客 + ; + private Integer value; + + UserExternalUserTypeEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/Device.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/Device.java index 9bbbd9b0a..ab830f169 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/Device.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/Device.java @@ -34,6 +34,12 @@ public class Device { */ @SerializedName("device_sn") private String deviceSn; + /** + * 设备属性 + *

示例值: + */ + @SerializedName("property") + private Property property; // builder 开始 public Device() { @@ -55,6 +61,11 @@ public Device(Builder builder) { *

示例值:3X811621174000240 */ this.deviceSn = builder.deviceSn; + /** + * 设备属性 + *

示例值: + */ + this.property = builder.property; } public static Builder newBuilder() { @@ -85,6 +96,14 @@ public void setDeviceSn(String deviceSn) { this.deviceSn = deviceSn; } + public Property getProperty() { + return this.property; + } + + public void setProperty(Property property) { + this.property = property; + } + public static class Builder { /** * 门禁设备 ID @@ -101,6 +120,11 @@ public static class Builder { *

示例值:3X811621174000240 */ private String deviceSn; + /** + * 设备属性 + *

示例值: + */ + private Property property; /** * 门禁设备 ID @@ -141,6 +165,19 @@ public Builder deviceSn(String deviceSn) { } + /** + * 设备属性 + *

示例值: + * + * @param property + * @return + */ + public Builder property(Property property) { + this.property = property; + return this; + } + + public Device build() { return new Device(this); } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/DeviceExternal.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/DeviceExternal.java new file mode 100644 index 000000000..969401136 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/DeviceExternal.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.acs.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class DeviceExternal { + /** + * 设备id + *

示例值:534545234523452345 + */ + @SerializedName("id") + private String id; + /** + * 设备名称 + *

示例值:北门 + */ + @SerializedName("name") + private String name; + + // builder 开始 + public DeviceExternal() { + } + + public DeviceExternal(Builder builder) { + /** + * 设备id + *

示例值:534545234523452345 + */ + this.id = builder.id; + /** + * 设备名称 + *

示例值:北门 + */ + this.name = builder.name; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public static class Builder { + /** + * 设备id + *

示例值:534545234523452345 + */ + private String id; + /** + * 设备名称 + *

示例值:北门 + */ + private String name; + + /** + * 设备id + *

示例值:534545234523452345 + * + * @param id + * @return + */ + public Builder id(String id) { + this.id = id; + return this; + } + + + /** + * 设备名称 + *

示例值:北门 + * + * @param name + * @return + */ + public Builder name(String name) { + this.name = name; + return this; + } + + + public DeviceExternal build() { + return new DeviceExternal(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/OpeningTimeExternal.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/OpeningTimeExternal.java new file mode 100644 index 000000000..8eb80409a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/OpeningTimeExternal.java @@ -0,0 +1,148 @@ +// Code generated by lark suite 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 com.lark.oapi.service.acs.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class OpeningTimeExternal { + /** + * 有效日期 + *

示例值: + */ + @SerializedName("valid_day") + private OpeningTimeValidDayExternal validDay; + /** + * 有效星期 + *

示例值: + */ + @SerializedName("weekdays") + private Integer[] weekdays; + /** + * 有效时间 + *

示例值: + */ + @SerializedName("day_times") + private OpeningTimePeriodExternal[] dayTimes; + + // builder 开始 + public OpeningTimeExternal() { + } + + public OpeningTimeExternal(Builder builder) { + /** + * 有效日期 + *

示例值: + */ + this.validDay = builder.validDay; + /** + * 有效星期 + *

示例值: + */ + this.weekdays = builder.weekdays; + /** + * 有效时间 + *

示例值: + */ + this.dayTimes = builder.dayTimes; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public OpeningTimeValidDayExternal getValidDay() { + return this.validDay; + } + + public void setValidDay(OpeningTimeValidDayExternal validDay) { + this.validDay = validDay; + } + + public Integer[] getWeekdays() { + return this.weekdays; + } + + public void setWeekdays(Integer[] weekdays) { + this.weekdays = weekdays; + } + + public OpeningTimePeriodExternal[] getDayTimes() { + return this.dayTimes; + } + + public void setDayTimes(OpeningTimePeriodExternal[] dayTimes) { + this.dayTimes = dayTimes; + } + + public static class Builder { + /** + * 有效日期 + *

示例值: + */ + private OpeningTimeValidDayExternal validDay; + /** + * 有效星期 + *

示例值: + */ + private Integer[] weekdays; + /** + * 有效时间 + *

示例值: + */ + private OpeningTimePeriodExternal[] dayTimes; + + /** + * 有效日期 + *

示例值: + * + * @param validDay + * @return + */ + public Builder validDay(OpeningTimeValidDayExternal validDay) { + this.validDay = validDay; + return this; + } + + + /** + * 有效星期 + *

示例值: + * + * @param weekdays + * @return + */ + public Builder weekdays(Integer[] weekdays) { + this.weekdays = weekdays; + return this; + } + + + /** + * 有效时间 + *

示例值: + * + * @param dayTimes + * @return + */ + public Builder dayTimes(OpeningTimePeriodExternal[] dayTimes) { + this.dayTimes = dayTimes; + return this; + } + + + public OpeningTimeExternal build() { + return new OpeningTimeExternal(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/OpeningTimePeriodExternal.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/OpeningTimePeriodExternal.java new file mode 100644 index 000000000..a1cc0a836 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/OpeningTimePeriodExternal.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.acs.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class OpeningTimePeriodExternal { + /** + * 起始时间 + *

示例值:1200 + */ + @SerializedName("start_hhmm") + private Integer startHhmm; + /** + * 结束时间 + *

示例值:1400 + */ + @SerializedName("end_hhmm") + private Integer endHhmm; + + // builder 开始 + public OpeningTimePeriodExternal() { + } + + public OpeningTimePeriodExternal(Builder builder) { + /** + * 起始时间 + *

示例值:1200 + */ + this.startHhmm = builder.startHhmm; + /** + * 结束时间 + *

示例值:1400 + */ + this.endHhmm = builder.endHhmm; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Integer getStartHhmm() { + return this.startHhmm; + } + + public void setStartHhmm(Integer startHhmm) { + this.startHhmm = startHhmm; + } + + public Integer getEndHhmm() { + return this.endHhmm; + } + + public void setEndHhmm(Integer endHhmm) { + this.endHhmm = endHhmm; + } + + public static class Builder { + /** + * 起始时间 + *

示例值:1200 + */ + private Integer startHhmm; + /** + * 结束时间 + *

示例值:1400 + */ + private Integer endHhmm; + + /** + * 起始时间 + *

示例值:1200 + * + * @param startHhmm + * @return + */ + public Builder startHhmm(Integer startHhmm) { + this.startHhmm = startHhmm; + return this; + } + + + /** + * 结束时间 + *

示例值:1400 + * + * @param endHhmm + * @return + */ + public Builder endHhmm(Integer endHhmm) { + this.endHhmm = endHhmm; + return this; + } + + + public OpeningTimePeriodExternal build() { + return new OpeningTimePeriodExternal(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/OpeningTimeValidDayExternal.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/OpeningTimeValidDayExternal.java new file mode 100644 index 000000000..b0c64c48a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/OpeningTimeValidDayExternal.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.acs.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class OpeningTimeValidDayExternal { + /** + * 权限开始时间 + *

示例值:1699031483 + */ + @SerializedName("start_day") + private Integer startDay; + /** + * 权限结束时间 + *

示例值:1699931483 + */ + @SerializedName("end_day") + private Integer endDay; + + // builder 开始 + public OpeningTimeValidDayExternal() { + } + + public OpeningTimeValidDayExternal(Builder builder) { + /** + * 权限开始时间 + *

示例值:1699031483 + */ + this.startDay = builder.startDay; + /** + * 权限结束时间 + *

示例值:1699931483 + */ + this.endDay = builder.endDay; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Integer getStartDay() { + return this.startDay; + } + + public void setStartDay(Integer startDay) { + this.startDay = startDay; + } + + public Integer getEndDay() { + return this.endDay; + } + + public void setEndDay(Integer endDay) { + this.endDay = endDay; + } + + public static class Builder { + /** + * 权限开始时间 + *

示例值:1699031483 + */ + private Integer startDay; + /** + * 权限结束时间 + *

示例值:1699931483 + */ + private Integer endDay; + + /** + * 权限开始时间 + *

示例值:1699031483 + * + * @param startDay + * @return + */ + public Builder startDay(Integer startDay) { + this.startDay = startDay; + return this; + } + + + /** + * 权限结束时间 + *

示例值:1699931483 + * + * @param endDay + * @return + */ + public Builder endDay(Integer endDay) { + this.endDay = endDay; + return this; + } + + + public OpeningTimeValidDayExternal build() { + return new OpeningTimeValidDayExternal(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/Property.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/Property.java new file mode 100644 index 000000000..dc017f8c9 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/Property.java @@ -0,0 +1,271 @@ +// Code generated by lark suite 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 com.lark.oapi.service.acs.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class Property { + /** + * 设备版本号 + *

示例值:2.3.10 + */ + @SerializedName("version") + private String version; + /** + * 当前设备人脸数量 + *

示例值:300 + */ + @SerializedName("current_device_face_count") + private Integer currentDeviceFaceCount; + /** + * 设备最大人脸容量 + *

示例值:5000 + */ + @SerializedName("max_face_capacity") + private Integer maxFaceCapacity; + /** + * 在线状态 + *

示例值:1 + */ + @SerializedName("online_status") + private Integer onlineStatus; + /** + * 设备名称 + *

示例值:南门 + */ + @SerializedName("device_name") + private String deviceName; + /** + * 是否是打卡 + *

示例值:true + */ + @SerializedName("is_clock_in") + private Boolean isClockIn; + + // builder 开始 + public Property() { + } + + public Property(Builder builder) { + /** + * 设备版本号 + *

示例值:2.3.10 + */ + this.version = builder.version; + /** + * 当前设备人脸数量 + *

示例值:300 + */ + this.currentDeviceFaceCount = builder.currentDeviceFaceCount; + /** + * 设备最大人脸容量 + *

示例值:5000 + */ + this.maxFaceCapacity = builder.maxFaceCapacity; + /** + * 在线状态 + *

示例值:1 + */ + this.onlineStatus = builder.onlineStatus; + /** + * 设备名称 + *

示例值:南门 + */ + this.deviceName = builder.deviceName; + /** + * 是否是打卡 + *

示例值:true + */ + this.isClockIn = builder.isClockIn; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getVersion() { + return this.version; + } + + public void setVersion(String version) { + this.version = version; + } + + public Integer getCurrentDeviceFaceCount() { + return this.currentDeviceFaceCount; + } + + public void setCurrentDeviceFaceCount(Integer currentDeviceFaceCount) { + this.currentDeviceFaceCount = currentDeviceFaceCount; + } + + public Integer getMaxFaceCapacity() { + return this.maxFaceCapacity; + } + + public void setMaxFaceCapacity(Integer maxFaceCapacity) { + this.maxFaceCapacity = maxFaceCapacity; + } + + public Integer getOnlineStatus() { + return this.onlineStatus; + } + + public void setOnlineStatus(Integer onlineStatus) { + this.onlineStatus = onlineStatus; + } + + public String getDeviceName() { + return this.deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public Boolean getIsClockIn() { + return this.isClockIn; + } + + public void setIsClockIn(Boolean isClockIn) { + this.isClockIn = isClockIn; + } + + public static class Builder { + /** + * 设备版本号 + *

示例值:2.3.10 + */ + private String version; + /** + * 当前设备人脸数量 + *

示例值:300 + */ + private Integer currentDeviceFaceCount; + /** + * 设备最大人脸容量 + *

示例值:5000 + */ + private Integer maxFaceCapacity; + /** + * 在线状态 + *

示例值:1 + */ + private Integer onlineStatus; + /** + * 设备名称 + *

示例值:南门 + */ + private String deviceName; + /** + * 是否是打卡 + *

示例值:true + */ + private Boolean isClockIn; + + /** + * 设备版本号 + *

示例值:2.3.10 + * + * @param version + * @return + */ + public Builder version(String version) { + this.version = version; + return this; + } + + + /** + * 当前设备人脸数量 + *

示例值:300 + * + * @param currentDeviceFaceCount + * @return + */ + public Builder currentDeviceFaceCount(Integer currentDeviceFaceCount) { + this.currentDeviceFaceCount = currentDeviceFaceCount; + return this; + } + + + /** + * 设备最大人脸容量 + *

示例值:5000 + * + * @param maxFaceCapacity + * @return + */ + public Builder maxFaceCapacity(Integer maxFaceCapacity) { + this.maxFaceCapacity = maxFaceCapacity; + return this; + } + + + /** + * 在线状态 + *

示例值:1 + * + * @param onlineStatus + * @return + */ + public Builder onlineStatus(Integer onlineStatus) { + this.onlineStatus = onlineStatus; + return this; + } + + /** + * 在线状态 + *

示例值:1 + * + * @param onlineStatus {@link com.lark.oapi.service.acs.v1.enums.PropertyOnlineStatusEnum} + * @return + */ + public Builder onlineStatus(com.lark.oapi.service.acs.v1.enums.PropertyOnlineStatusEnum onlineStatus) { + this.onlineStatus = onlineStatus.getValue(); + return this; + } + + + /** + * 设备名称 + *

示例值:南门 + * + * @param deviceName + * @return + */ + public Builder deviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + + /** + * 是否是打卡 + *

示例值:true + * + * @param isClockIn + * @return + */ + public Builder isClockIn(Boolean isClockIn) { + this.isClockIn = isClockIn; + return this; + } + + + public Property build() { + return new Property(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/Rule.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/Rule.java new file mode 100644 index 000000000..cd23e93ab --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/Rule.java @@ -0,0 +1,370 @@ +// Code generated by lark suite 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 com.lark.oapi.service.acs.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class Rule { + /** + * 权限组id + *

示例值:34252345234523 + */ + @SerializedName("id") + private String id; + /** + * 权限组名称 + *

示例值:南门 + */ + @SerializedName("name") + private String name; + /** + * 权限组包含的设备 + *

示例值: + */ + @SerializedName("devices") + private DeviceExternal[] devices; + /** + * 权限组包含的员工个数 + *

示例值:3 + */ + @SerializedName("user_count") + private String userCount; + /** + * 权限组包含的员工列表 + *

示例值: + */ + @SerializedName("users") + private UserExternal[] users; + /** + * 权限组包含的访客个数 + *

示例值:3 + */ + @SerializedName("visitor_count") + private String visitorCount; + /** + * 权限组包含的访客列表 + *

示例值: + */ + @SerializedName("visitors") + private UserExternal[] visitors; + /** + * 是否通知人员录入 + *

示例值:false + */ + @SerializedName("remind_face") + private Boolean remindFace; + /** + * 开门时间段 + *

示例值: + */ + @SerializedName("opening_time") + private OpeningTimeExternal openingTime; + + // builder 开始 + public Rule() { + } + + public Rule(Builder builder) { + /** + * 权限组id + *

示例值:34252345234523 + */ + this.id = builder.id; + /** + * 权限组名称 + *

示例值:南门 + */ + this.name = builder.name; + /** + * 权限组包含的设备 + *

示例值: + */ + this.devices = builder.devices; + /** + * 权限组包含的员工个数 + *

示例值:3 + */ + this.userCount = builder.userCount; + /** + * 权限组包含的员工列表 + *

示例值: + */ + this.users = builder.users; + /** + * 权限组包含的访客个数 + *

示例值:3 + */ + this.visitorCount = builder.visitorCount; + /** + * 权限组包含的访客列表 + *

示例值: + */ + this.visitors = builder.visitors; + /** + * 是否通知人员录入 + *

示例值:false + */ + this.remindFace = builder.remindFace; + /** + * 开门时间段 + *

示例值: + */ + this.openingTime = builder.openingTime; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public DeviceExternal[] getDevices() { + return this.devices; + } + + public void setDevices(DeviceExternal[] devices) { + this.devices = devices; + } + + public String getUserCount() { + return this.userCount; + } + + public void setUserCount(String userCount) { + this.userCount = userCount; + } + + public UserExternal[] getUsers() { + return this.users; + } + + public void setUsers(UserExternal[] users) { + this.users = users; + } + + public String getVisitorCount() { + return this.visitorCount; + } + + public void setVisitorCount(String visitorCount) { + this.visitorCount = visitorCount; + } + + public UserExternal[] getVisitors() { + return this.visitors; + } + + public void setVisitors(UserExternal[] visitors) { + this.visitors = visitors; + } + + public Boolean getRemindFace() { + return this.remindFace; + } + + public void setRemindFace(Boolean remindFace) { + this.remindFace = remindFace; + } + + public OpeningTimeExternal getOpeningTime() { + return this.openingTime; + } + + public void setOpeningTime(OpeningTimeExternal openingTime) { + this.openingTime = openingTime; + } + + public static class Builder { + /** + * 权限组id + *

示例值:34252345234523 + */ + private String id; + /** + * 权限组名称 + *

示例值:南门 + */ + private String name; + /** + * 权限组包含的设备 + *

示例值: + */ + private DeviceExternal[] devices; + /** + * 权限组包含的员工个数 + *

示例值:3 + */ + private String userCount; + /** + * 权限组包含的员工列表 + *

示例值: + */ + private UserExternal[] users; + /** + * 权限组包含的访客个数 + *

示例值:3 + */ + private String visitorCount; + /** + * 权限组包含的访客列表 + *

示例值: + */ + private UserExternal[] visitors; + /** + * 是否通知人员录入 + *

示例值:false + */ + private Boolean remindFace; + /** + * 开门时间段 + *

示例值: + */ + private OpeningTimeExternal openingTime; + + /** + * 权限组id + *

示例值:34252345234523 + * + * @param id + * @return + */ + public Builder id(String id) { + this.id = id; + return this; + } + + + /** + * 权限组名称 + *

示例值:南门 + * + * @param name + * @return + */ + public Builder name(String name) { + this.name = name; + return this; + } + + + /** + * 权限组包含的设备 + *

示例值: + * + * @param devices + * @return + */ + public Builder devices(DeviceExternal[] devices) { + this.devices = devices; + return this; + } + + + /** + * 权限组包含的员工个数 + *

示例值:3 + * + * @param userCount + * @return + */ + public Builder userCount(String userCount) { + this.userCount = userCount; + return this; + } + + + /** + * 权限组包含的员工列表 + *

示例值: + * + * @param users + * @return + */ + public Builder users(UserExternal[] users) { + this.users = users; + return this; + } + + + /** + * 权限组包含的访客个数 + *

示例值:3 + * + * @param visitorCount + * @return + */ + public Builder visitorCount(String visitorCount) { + this.visitorCount = visitorCount; + return this; + } + + + /** + * 权限组包含的访客列表 + *

示例值: + * + * @param visitors + * @return + */ + public Builder visitors(UserExternal[] visitors) { + this.visitors = visitors; + return this; + } + + + /** + * 是否通知人员录入 + *

示例值:false + * + * @param remindFace + * @return + */ + public Builder remindFace(Boolean remindFace) { + this.remindFace = remindFace; + return this; + } + + + /** + * 开门时间段 + *

示例值: + * + * @param openingTime + * @return + */ + public Builder openingTime(OpeningTimeExternal openingTime) { + this.openingTime = openingTime; + return this; + } + + + public Rule build() { + return new Rule(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/UserExternal.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/UserExternal.java new file mode 100644 index 000000000..05d9b000c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/model/UserExternal.java @@ -0,0 +1,197 @@ +// Code generated by lark suite 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 com.lark.oapi.service.acs.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class UserExternal { + /** + * 用户类型 + *

示例值:1 + */ + @SerializedName("user_type") + private Integer userType; + /** + * 用户id + *

示例值:ou_7dab8a3d3cdcc9da365777c7ad535d62 + */ + @SerializedName("user_id") + private String userId; + /** + * 用户名称 + *

示例值:张三 + */ + @SerializedName("user_name") + private String userName; + /** + * 电话号码 + *

示例值:1357890001 + */ + @SerializedName("phone_num") + private String phoneNum; + + // builder 开始 + public UserExternal() { + } + + public UserExternal(Builder builder) { + /** + * 用户类型 + *

示例值:1 + */ + this.userType = builder.userType; + /** + * 用户id + *

示例值:ou_7dab8a3d3cdcc9da365777c7ad535d62 + */ + this.userId = builder.userId; + /** + * 用户名称 + *

示例值:张三 + */ + this.userName = builder.userName; + /** + * 电话号码 + *

示例值:1357890001 + */ + this.phoneNum = builder.phoneNum; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Integer getUserType() { + return this.userType; + } + + public void setUserType(Integer userType) { + this.userType = userType; + } + + public String getUserId() { + return this.userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getUserName() { + return this.userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getPhoneNum() { + return this.phoneNum; + } + + public void setPhoneNum(String phoneNum) { + this.phoneNum = phoneNum; + } + + public static class Builder { + /** + * 用户类型 + *

示例值:1 + */ + private Integer userType; + /** + * 用户id + *

示例值:ou_7dab8a3d3cdcc9da365777c7ad535d62 + */ + private String userId; + /** + * 用户名称 + *

示例值:张三 + */ + private String userName; + /** + * 电话号码 + *

示例值:1357890001 + */ + private String phoneNum; + + /** + * 用户类型 + *

示例值:1 + * + * @param userType + * @return + */ + public Builder userType(Integer userType) { + this.userType = userType; + return this; + } + + /** + * 用户类型 + *

示例值:1 + * + * @param userType {@link com.lark.oapi.service.acs.v1.enums.UserExternalUserTypeEnum} + * @return + */ + public Builder userType(com.lark.oapi.service.acs.v1.enums.UserExternalUserTypeEnum userType) { + this.userType = userType.getValue(); + return this; + } + + + /** + * 用户id + *

示例值:ou_7dab8a3d3cdcc9da365777c7ad535d62 + * + * @param userId + * @return + */ + public Builder userId(String userId) { + this.userId = userId; + return this; + } + + + /** + * 用户名称 + *

示例值:张三 + * + * @param userName + * @return + */ + public Builder userName(String userName) { + this.userName = userName; + return this; + } + + + /** + * 电话号码 + *

示例值:1357890001 + * + * @param phoneNum + * @return + */ + public Builder phoneNum(String phoneNum) { + this.phoneNum = phoneNum; + return this; + } + + + public UserExternal build() { + return new UserExternal(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/resource/AccessRecord.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/resource/AccessRecord.java new file mode 100644 index 000000000..73b4a7f38 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/resource/AccessRecord.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.acs.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.acs.v1.model.ListAccessRecordReq; +import com.lark.oapi.service.acs.v1.model.ListAccessRecordResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class AccessRecord { + private static final Logger log = LoggerFactory.getLogger(AccessRecord.class); + private final Config config; + + public AccessRecord(Config config) { + this.config = config; + } + + + /** + * 获取门禁记录列表,用户在门禁考勤机上成功开门或打卡后,智能门禁应用都会生成一条门禁记录。;;该接口返回满足查询参数的识别记录。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/access_record/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/ListAccessRecordSample.java ; + */ + public ListAccessRecordResp list(ListAccessRecordReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/acs/v1/access_records" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListAccessRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAccessRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/access_records" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取门禁记录列表,用户在门禁考勤机上成功开门或打卡后,智能门禁应用都会生成一条门禁记录。;;该接口返回满足查询参数的识别记录。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/access_record/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/ListAccessRecordSample.java ; + */ + public ListAccessRecordResp list(ListAccessRecordReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/acs/v1/access_records" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListAccessRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAccessRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/access_records" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/resource/AccessRecordAccessPhoto.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/resource/AccessRecordAccessPhoto.java new file mode 100644 index 000000000..5f914c465 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/resource/AccessRecordAccessPhoto.java @@ -0,0 +1,127 @@ +// Code generated by lark suite 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 com.lark.oapi.service.acs.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.acs.v1.model.GetAccessRecordAccessPhotoReq; +import com.lark.oapi.service.acs.v1.model.GetAccessRecordAccessPhotoResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.ByteArrayOutputStream; +import java.nio.charset.StandardCharsets; + +public class AccessRecordAccessPhoto { + private static final Logger log = LoggerFactory.getLogger(AccessRecordAccessPhoto.class); + private final Config config; + + public AccessRecordAccessPhoto(Config config) { + this.config = config; + } + + + /** + * 下载开门时的人脸识别图片,用户在门禁考勤机上成功开门或打卡后,智能门禁应用都会生成一条门禁记录,对于使用人脸识别方式进行开门的识别记录,还会有抓拍图。;;可以用该接口下载开门时的人脸识别照片。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/access_record-access_photo/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/GetAccessRecordAccessPhotoSample.java ; + */ + public GetAccessRecordAccessPhotoResp get(GetAccessRecordAccessPhotoReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/acs/v1/access_records/:access_record_id/access_photo" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + if (httpResponse.getStatusCode() == 200) { + GetAccessRecordAccessPhotoResp resp = new GetAccessRecordAccessPhotoResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + GetAccessRecordAccessPhotoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAccessRecordAccessPhotoResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/access_records/:access_record_id/access_photo" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 下载开门时的人脸识别图片,用户在门禁考勤机上成功开门或打卡后,智能门禁应用都会生成一条门禁记录,对于使用人脸识别方式进行开门的识别记录,还会有抓拍图。;;可以用该接口下载开门时的人脸识别照片。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/access_record-access_photo/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/GetAccessRecordAccessPhotoSample.java ; + */ + public GetAccessRecordAccessPhotoResp get(GetAccessRecordAccessPhotoReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/acs/v1/access_records/:access_record_id/access_photo" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 下载请求,返回流 + if (httpResponse.getStatusCode() == 200) { + GetAccessRecordAccessPhotoResp resp = new GetAccessRecordAccessPhotoResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + GetAccessRecordAccessPhotoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAccessRecordAccessPhotoResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/access_records/:access_record_id/access_photo" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/resource/Device.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/resource/Device.java new file mode 100644 index 000000000..4df6f624a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/resource/Device.java @@ -0,0 +1,102 @@ +// Code generated by lark suite 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 com.lark.oapi.service.acs.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.acs.v1.model.ListDeviceResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Device { + private static final Logger log = LoggerFactory.getLogger(Device.class); + private final Config config; + + public Device(Config config) { + this.config = config; + } + + + /** + * 获取门禁设备列表,使用该接口获取租户内所有门禁设备。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/device/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/ListDeviceSample.java ; + */ + public ListDeviceResp list(RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/acs/v1/devices" + , Sets.newHashSet(AccessTokenType.Tenant) + , null); + + // 反序列化 + ListDeviceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDeviceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/devices" + , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + return resp; + } + + /** + * 获取门禁设备列表,使用该接口获取租户内所有门禁设备。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/device/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/ListDeviceSample.java ; + */ + public ListDeviceResp list() throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/acs/v1/devices" + , Sets.newHashSet(AccessTokenType.Tenant) + , null); + + // 反序列化 + ListDeviceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDeviceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/devices" + , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/resource/User.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/resource/User.java new file mode 100644 index 000000000..2246a2d24 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/resource/User.java @@ -0,0 +1,240 @@ +// Code generated by lark suite 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 com.lark.oapi.service.acs.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.acs.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class User { + private static final Logger log = LoggerFactory.getLogger(User.class); + private final Config config; + + public User(Config config) { + this.config = config; + } + + + /** + * 获取单个用户信息,该接口用于获取智能门禁中单个用户的信息。 + *

只能获取已加入智能门禁权限组的用户 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/GetUserSample.java ; + */ + public GetUserResp get(GetUserReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/acs/v1/users/:user_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/users/:user_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取单个用户信息,该接口用于获取智能门禁中单个用户的信息。 + *

只能获取已加入智能门禁权限组的用户 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/GetUserSample.java ; + */ + public GetUserResp get(GetUserReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/acs/v1/users/:user_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/users/:user_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取用户列表,使用该接口获取智能门禁中所有用户信息。 + *

只能获取已加入智能门禁权限组的用户。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/ListUserSample.java ; + */ + public ListUserResp list(ListUserReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/acs/v1/users" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/users" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取用户列表,使用该接口获取智能门禁中所有用户信息。 + *

只能获取已加入智能门禁权限组的用户。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/ListUserSample.java ; + */ + public ListUserResp list(ListUserReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/acs/v1/users" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/users" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改用户部分信息,飞书智能门禁在人脸识别成功后会有韦根信号输出,输出用户的卡号。;对于使用韦根协议的门禁系统,企业可使用该接口录入用户卡号。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/PatchUserSample.java ; + */ + public PatchUserResp patch(PatchUserReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/acs/v1/users/:user_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/users/:user_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改用户部分信息,飞书智能门禁在人脸识别成功后会有韦根信号输出,输出用户的卡号。;对于使用韦根协议的门禁系统,企业可使用该接口录入用户卡号。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/PatchUserSample.java ; + */ + public PatchUserResp patch(PatchUserReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/acs/v1/users/:user_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/users/:user_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/resource/UserFace.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/resource/UserFace.java new file mode 100644 index 000000000..f02d44d71 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/acs/v1/resource/UserFace.java @@ -0,0 +1,197 @@ +// Code generated by lark suite 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 com.lark.oapi.service.acs.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.acs.v1.model.GetUserFaceReq; +import com.lark.oapi.service.acs.v1.model.GetUserFaceResp; +import com.lark.oapi.service.acs.v1.model.UpdateUserFaceReq; +import com.lark.oapi.service.acs.v1.model.UpdateUserFaceResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.ByteArrayOutputStream; +import java.nio.charset.StandardCharsets; + +public class UserFace { + private static final Logger log = LoggerFactory.getLogger(UserFace.class); + private final Config config; + + public UserFace(Config config) { + this.config = config; + } + + + /** + * 下载人脸图片,对于已经录入人脸图片的用户,可以使用该接口下载用户人脸图片。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user-face/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/GetUserFaceSample.java ; + */ + public GetUserFaceResp get(GetUserFaceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/acs/v1/users/:user_id/face" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + if (httpResponse.getStatusCode() == 200) { + GetUserFaceResp resp = new GetUserFaceResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + GetUserFaceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetUserFaceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/users/:user_id/face" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 下载人脸图片,对于已经录入人脸图片的用户,可以使用该接口下载用户人脸图片。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user-face/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/GetUserFaceSample.java ; + */ + public GetUserFaceResp get(GetUserFaceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/acs/v1/users/:user_id/face" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 下载请求,返回流 + if (httpResponse.getStatusCode() == 200) { + GetUserFaceResp resp = new GetUserFaceResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + GetUserFaceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetUserFaceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/users/:user_id/face" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 上传人脸图片,用户需要录入人脸图片才可以使用门禁考勤机。使用该 API 上传门禁用户的人脸图片。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user-face/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/UpdateUserFaceSample.java ; + */ + public UpdateUserFaceResp update(UpdateUserFaceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/acs/v1/users/:user_id/face" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateUserFaceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateUserFaceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/users/:user_id/face" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 上传人脸图片,用户需要录入人脸图片才可以使用门禁考勤机。使用该 API 上传门禁用户的人脸图片。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user-face/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/UpdateUserFaceSample.java ; + */ + public UpdateUserFaceResp update(UpdateUserFaceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/acs/v1/users/:user_id/face" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateUserFaceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateUserFaceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/acs/v1/users/:user_id/face" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/AdminService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/AdminService.java new file mode 100644 index 000000000..84a7e1ac1 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/AdminService.java @@ -0,0 +1,71 @@ +// Code generated by lark suite 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 com.lark.oapi.service.admin; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.admin.v1.V1; +import com.lark.oapi.service.admin.v1.resource.*; + +public class AdminService { + private final V1 v1; + private final AdminDeptStat adminDeptStat; // 部门维度的数据报表 + private final AdminUserStat adminUserStat; // 用户维度的数据报表 + private final AuditInfo auditInfo; // 行为审计日志(灰度租户可见) + private final Badge badge; // 勋章 + private final BadgeGrant badgeGrant; // 勋章授予名单 + private final BadgeImage badgeImage; // 勋章图片 + private final Password password; // 登录密码管理 + + public AdminService(Config config) { + this.v1 = new V1(config); + this.adminDeptStat = new AdminDeptStat(config); + this.adminUserStat = new AdminUserStat(config); + this.auditInfo = new AuditInfo(config); + this.badge = new Badge(config); + this.badgeGrant = new BadgeGrant(config); + this.badgeImage = new BadgeImage(config); + this.password = new Password(config); + } + + public V1 v1() { + return v1; + } + + public AdminDeptStat adminDeptStat() { + return adminDeptStat; + } + + public AdminUserStat adminUserStat() { + return adminUserStat; + } + + public AuditInfo auditInfo() { + return auditInfo; + } + + public Badge badge() { + return badge; + } + + public BadgeGrant badgeGrant() { + return badgeGrant; + } + + public BadgeImage badgeImage() { + return badgeImage; + } + + public Password password() { + return password; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/AdminService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/AdminService.java deleted file mode 100644 index 434f97e2e..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/AdminService.java +++ /dev/null @@ -1,1014 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.admin.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.admin.v1.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class AdminService { - private static final Logger log = LoggerFactory.getLogger(AdminService.class); - private final AdminDeptStat adminDeptStat; // 部门维度的数据报表 - private final AdminUserStat adminUserStat; // 用户维度的数据报表 - private final Badge badge; // 勋章 - private final BadgeGrant badgeGrant; // 勋章授予名单 - private final BadgeImage badgeImage; // 勋章图片 - private final Password password; // 登录密码管理 - - public AdminService(Config config) { - this.adminDeptStat = new AdminDeptStat(config); - this.adminUserStat = new AdminUserStat(config); - this.badge = new Badge(config); - this.badgeGrant = new BadgeGrant(config); - this.badgeImage = new BadgeImage(config); - this.password = new Password(config); - } - - /** - * 部门维度的数据报表 - * - * @return - */ - public AdminDeptStat adminDeptStat() { - return adminDeptStat; - } - - /** - * 用户维度的数据报表 - * - * @return - */ - public AdminUserStat adminUserStat() { - return adminUserStat; - } - - /** - * 勋章 - * - * @return - */ - public Badge badge() { - return badge; - } - - /** - * 勋章授予名单 - * - * @return - */ - public BadgeGrant badgeGrant() { - return badgeGrant; - } - - /** - * 勋章图片 - * - * @return - */ - public BadgeImage badgeImage() { - return badgeImage; - } - - /** - * 登录密码管理 - * - * @return - */ - public Password password() { - return password; - } - - public static class AdminDeptStat { - private final Config config; - - public AdminDeptStat(Config config) { - this.config = config; - } - - /** - * 获取部门维度的用户活跃和功能使用数据,该接口用于获取部门维度的用户活跃和功能使用数据,即IM(即时通讯)、日历、云文档、音视频会议功能的使用数据。 - *

- 只有企业自建应用才有权限调用此接口;;- 当天的数据会在第二天的早上九点半产出(UTC+8) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/admin_dept_stat/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListAdminDeptStatSample.java ; - */ - public ListAdminDeptStatResp list(ListAdminDeptStatReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/admin/v1/admin_dept_stats" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListAdminDeptStatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAdminDeptStatResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/admin_dept_stats" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取部门维度的用户活跃和功能使用数据,该接口用于获取部门维度的用户活跃和功能使用数据,即IM(即时通讯)、日历、云文档、音视频会议功能的使用数据。 - *

- 只有企业自建应用才有权限调用此接口;;- 当天的数据会在第二天的早上九点半产出(UTC+8) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/admin_dept_stat/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListAdminDeptStatSample.java ; - */ - public ListAdminDeptStatResp list(ListAdminDeptStatReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/admin/v1/admin_dept_stats" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListAdminDeptStatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAdminDeptStatResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/admin_dept_stats" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class AdminUserStat { - private final Config config; - - public AdminUserStat(Config config) { - this.config = config; - } - - /** - * 获取用户维度的用户活跃和功能使用数据,用于获取用户维度的用户活跃和功能使用数据,即IM(即时通讯)、日历、云文档、音视频会议功能的使用数据。 - *

- 只有企业自建应用才有权限调用此接口;;- 当天的数据会在第二天的早上九点半产出(UTC+8) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/admin_user_stat/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListAdminUserStatSample.java ; - */ - public ListAdminUserStatResp list(ListAdminUserStatReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/admin/v1/admin_user_stats" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListAdminUserStatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAdminUserStatResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/admin_user_stats" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取用户维度的用户活跃和功能使用数据,用于获取用户维度的用户活跃和功能使用数据,即IM(即时通讯)、日历、云文档、音视频会议功能的使用数据。 - *

- 只有企业自建应用才有权限调用此接口;;- 当天的数据会在第二天的早上九点半产出(UTC+8) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/admin_user_stat/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListAdminUserStatSample.java ; - */ - public ListAdminUserStatResp list(ListAdminUserStatReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/admin/v1/admin_user_stats" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListAdminUserStatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAdminUserStatResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/admin_user_stats" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Badge { - private final Config config; - - public Badge(Config config) { - this.config = config; - } - - /** - * 创建勋章,使用该接口可以创建一枚完整的勋章信息,一个租户下最多可创建1000枚勋章。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/CreateBadgeSample.java ; - */ - public CreateBadgeResp create(CreateBadgeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/admin/v1/badges" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateBadgeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateBadgeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建勋章,使用该接口可以创建一枚完整的勋章信息,一个租户下最多可创建1000枚勋章。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/CreateBadgeSample.java ; - */ - public CreateBadgeResp create(CreateBadgeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/admin/v1/badges" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateBadgeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateBadgeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取勋章详情,可以通过该接口查询勋章的详情 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/GetBadgeSample.java ; - */ - public GetBadgeResp get(GetBadgeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/admin/v1/badges/:badge_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetBadgeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetBadgeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取勋章详情,可以通过该接口查询勋章的详情 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/GetBadgeSample.java ; - */ - public GetBadgeResp get(GetBadgeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/admin/v1/badges/:badge_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetBadgeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetBadgeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取勋章列表,可以通过该接口列出租户下所有的勋章,勋章的排列顺序是按照创建时间倒序排列。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListBadgeSample.java ; - */ - public ListBadgeResp list(ListBadgeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/admin/v1/badges" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListBadgeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListBadgeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取勋章列表,可以通过该接口列出租户下所有的勋章,勋章的排列顺序是按照创建时间倒序排列。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListBadgeSample.java ; - */ - public ListBadgeResp list(ListBadgeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/admin/v1/badges" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListBadgeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListBadgeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改勋章信息,通过该接口可以修改勋章的信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/UpdateBadgeSample.java ; - */ - public UpdateBadgeResp update(UpdateBadgeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/admin/v1/badges/:badge_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateBadgeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateBadgeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改勋章信息,通过该接口可以修改勋章的信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/UpdateBadgeSample.java ; - */ - public UpdateBadgeResp update(UpdateBadgeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/admin/v1/badges/:badge_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateBadgeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateBadgeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class BadgeGrant { - private final Config config; - - public BadgeGrant(Config config) { - this.config = config; - } - - /** - * 创建勋章的授予名单,通过该接口可以为特定勋章创建一份授予名单,一枚勋章下最多可创建1000份授予名单。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/CreateBadgeGrantSample.java ; - */ - public CreateBadgeGrantResp create(CreateBadgeGrantReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/admin/v1/badges/:badge_id/grants" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateBadgeGrantResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateBadgeGrantResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id/grants" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建勋章的授予名单,通过该接口可以为特定勋章创建一份授予名单,一枚勋章下最多可创建1000份授予名单。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/CreateBadgeGrantSample.java ; - */ - public CreateBadgeGrantResp create(CreateBadgeGrantReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/admin/v1/badges/:badge_id/grants" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateBadgeGrantResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateBadgeGrantResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id/grants" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除授予名单,通过该接口可以删除特定授予名单的信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/DeleteBadgeGrantSample.java ; - */ - public DeleteBadgeGrantResp delete(DeleteBadgeGrantReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/admin/v1/badges/:badge_id/grants/:grant_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteBadgeGrantResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteBadgeGrantResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id/grants/:grant_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除授予名单,通过该接口可以删除特定授予名单的信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/DeleteBadgeGrantSample.java ; - */ - public DeleteBadgeGrantResp delete(DeleteBadgeGrantReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/admin/v1/badges/:badge_id/grants/:grant_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteBadgeGrantResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteBadgeGrantResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id/grants/:grant_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取授予名单的信息,通过该接口可以获取特定授予名单的信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/GetBadgeGrantSample.java ; - */ - public GetBadgeGrantResp get(GetBadgeGrantReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/admin/v1/badges/:badge_id/grants/:grant_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetBadgeGrantResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetBadgeGrantResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id/grants/:grant_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取授予名单的信息,通过该接口可以获取特定授予名单的信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/GetBadgeGrantSample.java ; - */ - public GetBadgeGrantResp get(GetBadgeGrantReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/admin/v1/badges/:badge_id/grants/:grant_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetBadgeGrantResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetBadgeGrantResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id/grants/:grant_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取勋章的授予名单列表,通过该接口可以获取特定勋章下的授予名单列表,授予名单的排列顺序按照创建时间倒序排列。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListBadgeGrantSample.java ; - */ - public ListBadgeGrantResp list(ListBadgeGrantReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/admin/v1/badges/:badge_id/grants" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListBadgeGrantResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListBadgeGrantResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id/grants" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取勋章的授予名单列表,通过该接口可以获取特定勋章下的授予名单列表,授予名单的排列顺序按照创建时间倒序排列。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListBadgeGrantSample.java ; - */ - public ListBadgeGrantResp list(ListBadgeGrantReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/admin/v1/badges/:badge_id/grants" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListBadgeGrantResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListBadgeGrantResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id/grants" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改授予名单,通过该接口可以修改特定授予名单的相关信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/UpdateBadgeGrantSample.java ; - */ - public UpdateBadgeGrantResp update(UpdateBadgeGrantReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/admin/v1/badges/:badge_id/grants/:grant_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateBadgeGrantResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateBadgeGrantResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id/grants/:grant_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改授予名单,通过该接口可以修改特定授予名单的相关信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/UpdateBadgeGrantSample.java ; - */ - public UpdateBadgeGrantResp update(UpdateBadgeGrantReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/admin/v1/badges/:badge_id/grants/:grant_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateBadgeGrantResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateBadgeGrantResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id/grants/:grant_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class BadgeImage { - private final Config config; - - public BadgeImage(Config config) { - this.config = config; - } - - /** - * 上传勋章图片,通过该接口可以上传勋章详情图、挂饰图的文件,获取对应的文件key - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge_image/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/CreateBadgeImageSample.java ; - */ - public CreateBadgeImageResp create(CreateBadgeImageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/admin/v1/badge_images" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateBadgeImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateBadgeImageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badge_images" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 上传勋章图片,通过该接口可以上传勋章详情图、挂饰图的文件,获取对应的文件key - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge_image/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/CreateBadgeImageSample.java ; - */ - public CreateBadgeImageResp create(CreateBadgeImageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/admin/v1/badge_images" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateBadgeImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateBadgeImageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badge_images" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Password { - private final Config config; - - public Password(Config config) { - this.config = config; - } - - /** - * 重置密码,重置用户的企业邮箱密码,仅当用户的邮箱和企业邮箱(别名)一致时生效,可用于处理飞书企业邮箱登录死锁的问题。;;邮箱死锁:当用户的登录凭证与飞书企业邮箱一致时,目前飞书登录流程要求用户输入验证码,由于飞书邮箱无单独的帐号体系,则未登录时无法收取邮箱验证码,即陷入死锁 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/password/reset ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ResetPasswordSample.java ; - */ - public ResetPasswordResp reset(ResetPasswordReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/admin/v1/password/reset" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ResetPasswordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ResetPasswordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/password/reset" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 重置密码,重置用户的企业邮箱密码,仅当用户的邮箱和企业邮箱(别名)一致时生效,可用于处理飞书企业邮箱登录死锁的问题。;;邮箱死锁:当用户的登录凭证与飞书企业邮箱一致时,目前飞书登录流程要求用户输入验证码,由于飞书邮箱无单独的帐号体系,则未登录时无法收取邮箱验证码,即陷入死锁 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/password/reset ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ResetPasswordSample.java ; - */ - public ResetPasswordResp reset(ResetPasswordReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/admin/v1/password/reset" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ResetPasswordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ResetPasswordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/password/reset" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/V1.java new file mode 100644 index 000000000..f2aca3934 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/V1.java @@ -0,0 +1,65 @@ +// Code generated by lark suite 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 com.lark.oapi.service.admin.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.admin.v1.resource.*; + +public class V1 { + private final AdminDeptStat adminDeptStat; // 部门维度的数据报表 + private final AdminUserStat adminUserStat; // 用户维度的数据报表 + private final AuditInfo auditInfo; // 行为审计日志(灰度租户可见) + private final Badge badge; // 勋章 + private final BadgeGrant badgeGrant; // 勋章授予名单 + private final BadgeImage badgeImage; // 勋章图片 + private final Password password; // 登录密码管理 + + public V1(Config config) { + this.adminDeptStat = new AdminDeptStat(config); + this.adminUserStat = new AdminUserStat(config); + this.auditInfo = new AuditInfo(config); + this.badge = new Badge(config); + this.badgeGrant = new BadgeGrant(config); + this.badgeImage = new BadgeImage(config); + this.password = new Password(config); + } + + public AdminDeptStat adminDeptStat() { + return adminDeptStat; + } + + public AdminUserStat adminUserStat() { + return adminUserStat; + } + + public AuditInfo auditInfo() { + return auditInfo; + } + + public Badge badge() { + return badge; + } + + public BadgeGrant badgeGrant() { + return badgeGrant; + } + + public BadgeImage badgeImage() { + return badgeImage; + } + + public Password password() { + return password; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/enums/ListAuditInfoOperatorTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/enums/ListAuditInfoOperatorTypeEnum.java new file mode 100644 index 000000000..7fb1c5ae3 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/enums/ListAuditInfoOperatorTypeEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.admin.v1.enums; + +/** + * 操作者类型 + */ +public enum ListAuditInfoOperatorTypeEnum { + USER("user"), // 以user_id来识别用户 + BOT("bot"), // 以bot_id来识别用户 + ; + private String value; + + ListAuditInfoOperatorTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/enums/ListAuditInfoUserIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/enums/ListAuditInfoUserIdTypeEnum.java new file mode 100644 index 000000000..73060e16f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/enums/ListAuditInfoUserIdTypeEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.admin.v1.enums; + +/** + * 此次调用中使用的用户ID的类型 + */ +public enum ListAuditInfoUserIdTypeEnum { + USER_ID("user_id"), // 以user_id来识别用户 + UNION_ID("union_id"), // 以union_id来识别用户 + OPEN_ID("open_id"), // 以open_id来识别用户 + ; + private String value; + + ListAuditInfoUserIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/model/ListAuditInfoReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/model/ListAuditInfoReq.java new file mode 100644 index 000000000..6e3eea0e4 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/model/ListAuditInfoReq.java @@ -0,0 +1,368 @@ +// Code generated by lark suite 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 com.lark.oapi.service.admin.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Query; + +public class ListAuditInfoReq { + /** + * 此次调用中使用的用户ID的类型 + *

示例值: + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 起始时间戳 + *

示例值:1668700799 + */ + @Query + @SerializedName("latest") + private Integer latest; + /** + * 终止时间戳 + *

示例值:1668528000 + */ + @Query + @SerializedName("oldest") + private Integer oldest; + /** + * 事件名称 + *

示例值:space_create_doc + */ + @Query + @SerializedName("event_name") + private String eventName; + /** + * 操作者类型 + *

示例值: + */ + @Query + @SerializedName("operator_type") + private String operatorType; + /** + * 操作者值 + *

示例值:55ed16fe + */ + @Query + @SerializedName("operator_value") + private String operatorValue; + /** + * 模块 + *

示例值:1 + */ + @Query + @SerializedName("event_module") + private Integer eventModule; + /** + * 下一页分页的token + *

示例值:LC39/f1%2B/Sz9Uv39Gf39/ew/cd5WY0gfGYFdixOW9cVk4bC79ituO/gx0qpPn1bYf92nz/kI0nNJOG3wCwDJKoNU%2BtyaXbpI8pV/9UNDMZT0BNeyanFH17Wv711Qh9anR3l2GjQfc2fUqXtxg1YPp63XyhYY4iRMv54ySRG7r%2BI89iS3zAoPzFuuU1MUJKsf + */ + @Query + @SerializedName("page_token") + private String pageToken; + /** + * 分页参数 + *

示例值:20 + */ + @Query + @SerializedName("page_size") + private Integer pageSize; + + // builder 开始 + public ListAuditInfoReq() { + } + + public ListAuditInfoReq(Builder builder) { + /** + * 此次调用中使用的用户ID的类型 + *

示例值: + */ + this.userIdType = builder.userIdType; + /** + * 起始时间戳 + *

示例值:1668700799 + */ + this.latest = builder.latest; + /** + * 终止时间戳 + *

示例值:1668528000 + */ + this.oldest = builder.oldest; + /** + * 事件名称 + *

示例值:space_create_doc + */ + this.eventName = builder.eventName; + /** + * 操作者类型 + *

示例值: + */ + this.operatorType = builder.operatorType; + /** + * 操作者值 + *

示例值:55ed16fe + */ + this.operatorValue = builder.operatorValue; + /** + * 模块 + *

示例值:1 + */ + this.eventModule = builder.eventModule; + /** + * 下一页分页的token + *

示例值:LC39/f1%2B/Sz9Uv39Gf39/ew/cd5WY0gfGYFdixOW9cVk4bC79ituO/gx0qpPn1bYf92nz/kI0nNJOG3wCwDJKoNU%2BtyaXbpI8pV/9UNDMZT0BNeyanFH17Wv711Qh9anR3l2GjQfc2fUqXtxg1YPp63XyhYY4iRMv54ySRG7r%2BI89iS3zAoPzFuuU1MUJKsf + */ + this.pageToken = builder.pageToken; + /** + * 分页参数 + *

示例值:20 + */ + this.pageSize = builder.pageSize; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public Integer getLatest() { + return this.latest; + } + + public void setLatest(Integer latest) { + this.latest = latest; + } + + public Integer getOldest() { + return this.oldest; + } + + public void setOldest(Integer oldest) { + this.oldest = oldest; + } + + public String getEventName() { + return this.eventName; + } + + public void setEventName(String eventName) { + this.eventName = eventName; + } + + public String getOperatorType() { + return this.operatorType; + } + + public void setOperatorType(String operatorType) { + this.operatorType = operatorType; + } + + public String getOperatorValue() { + return this.operatorValue; + } + + public void setOperatorValue(String operatorValue) { + this.operatorValue = operatorValue; + } + + public Integer getEventModule() { + return this.eventModule; + } + + public void setEventModule(Integer eventModule) { + this.eventModule = eventModule; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public Integer getPageSize() { + return this.pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public static class Builder { + private String userIdType; // 此次调用中使用的用户ID的类型 + private Integer latest; // 起始时间戳 + private Integer oldest; // 终止时间戳 + private String eventName; // 事件名称 + private String operatorType; // 操作者类型 + private String operatorValue; // 操作者值 + private Integer eventModule; // 模块 + private String pageToken; // 下一页分页的token + private Integer pageSize; // 分页参数 + + + /** + * 此次调用中使用的用户ID的类型 + *

示例值: + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 此次调用中使用的用户ID的类型 + *

示例值: + * + * @param userIdType {@link com.lark.oapi.service.admin.v1.enums.ListAuditInfoUserIdTypeEnum} + * @return + */ + public Builder userIdType(com.lark.oapi.service.admin.v1.enums.ListAuditInfoUserIdTypeEnum userIdType) { + this.userIdType = userIdType.getValue(); + return this; + } + + + /** + * 起始时间戳 + *

示例值:1668700799 + * + * @param latest + * @return + */ + public Builder latest(Integer latest) { + this.latest = latest; + return this; + } + + + /** + * 终止时间戳 + *

示例值:1668528000 + * + * @param oldest + * @return + */ + public Builder oldest(Integer oldest) { + this.oldest = oldest; + return this; + } + + + /** + * 事件名称 + *

示例值:space_create_doc + * + * @param eventName + * @return + */ + public Builder eventName(String eventName) { + this.eventName = eventName; + return this; + } + + + /** + * 操作者类型 + *

示例值: + * + * @param operatorType + * @return + */ + public Builder operatorType(String operatorType) { + this.operatorType = operatorType; + return this; + } + + /** + * 操作者类型 + *

示例值: + * + * @param operatorType {@link com.lark.oapi.service.admin.v1.enums.ListAuditInfoOperatorTypeEnum} + * @return + */ + public Builder operatorType(com.lark.oapi.service.admin.v1.enums.ListAuditInfoOperatorTypeEnum operatorType) { + this.operatorType = operatorType.getValue(); + return this; + } + + + /** + * 操作者值 + *

示例值:55ed16fe + * + * @param operatorValue + * @return + */ + public Builder operatorValue(String operatorValue) { + this.operatorValue = operatorValue; + return this; + } + + + /** + * 模块 + *

示例值:1 + * + * @param eventModule + * @return + */ + public Builder eventModule(Integer eventModule) { + this.eventModule = eventModule; + return this; + } + + + /** + * 下一页分页的token + *

示例值:LC39/f1%2B/Sz9Uv39Gf39/ew/cd5WY0gfGYFdixOW9cVk4bC79ituO/gx0qpPn1bYf92nz/kI0nNJOG3wCwDJKoNU%2BtyaXbpI8pV/9UNDMZT0BNeyanFH17Wv711Qh9anR3l2GjQfc2fUqXtxg1YPp63XyhYY4iRMv54ySRG7r%2BI89iS3zAoPzFuuU1MUJKsf + * + * @param pageToken + * @return + */ + public Builder pageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + + /** + * 分页参数 + *

示例值:20 + * + * @param pageSize + * @return + */ + public Builder pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + public ListAuditInfoReq build() { + return new ListAuditInfoReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/model/ListAuditInfoResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/model/ListAuditInfoResp.java new file mode 100644 index 000000000..d0d5f9808 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/model/ListAuditInfoResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.admin.v1.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class ListAuditInfoResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/model/ListAuditInfoRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/model/ListAuditInfoRespBody.java new file mode 100644 index 000000000..eebf56682 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/model/ListAuditInfoRespBody.java @@ -0,0 +1,62 @@ +// Code generated by lark suite 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 com.lark.oapi.service.admin.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class ListAuditInfoRespBody { + /** + * 是否有下一页数据 + *

示例值: + */ + @SerializedName("has_more") + private Boolean hasMore; + /** + * 下一页分页的token + *

示例值:LC39/f1%2B/Sz9Uv39Gf39/ew/cd5WY0gfGYFdixOW9cVk4bC79ituO/gx0qpPn1bYf92nz/kI0nNJOG3wCwDJKoNU%2BtyaXbpI8pV/9UNDMZT0BNeyanFH17Wv711Qh9anR3l2GjQfc2fUqXtxg1YPp63XyhYY4iRMv54ySRG7r%2BI89iS3zAoPzFuuU1MUJKsf + */ + @SerializedName("page_token") + private String pageToken; + /** + * 返回的具体数据内容 + *

示例值: + */ + @SerializedName("items") + private AuditInfo[] items; + + public Boolean getHasMore() { + return this.hasMore; + } + + public void setHasMore(Boolean hasMore) { + this.hasMore = hasMore; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public AuditInfo[] getItems() { + return this.items; + } + + public void setItems(AuditInfo[] items) { + this.items = items; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/AdminDeptStat.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/AdminDeptStat.java new file mode 100644 index 000000000..cc820c25d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/AdminDeptStat.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.admin.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.admin.v1.model.ListAdminDeptStatReq; +import com.lark.oapi.service.admin.v1.model.ListAdminDeptStatResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class AdminDeptStat { + private static final Logger log = LoggerFactory.getLogger(AdminDeptStat.class); + private final Config config; + + public AdminDeptStat(Config config) { + this.config = config; + } + + + /** + * 获取部门维度的用户活跃和功能使用数据,该接口用于获取部门维度的用户活跃和功能使用数据,即IM(即时通讯)、日历、云文档、音视频会议功能的使用数据。 + *

- 只有企业自建应用才有权限调用此接口;;- 当天的数据会在第二天的早上九点半产出(UTC+8) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/admin_dept_stat/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListAdminDeptStatSample.java ; + */ + public ListAdminDeptStatResp list(ListAdminDeptStatReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/admin/v1/admin_dept_stats" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListAdminDeptStatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAdminDeptStatResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/admin_dept_stats" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取部门维度的用户活跃和功能使用数据,该接口用于获取部门维度的用户活跃和功能使用数据,即IM(即时通讯)、日历、云文档、音视频会议功能的使用数据。 + *

- 只有企业自建应用才有权限调用此接口;;- 当天的数据会在第二天的早上九点半产出(UTC+8) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/admin_dept_stat/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListAdminDeptStatSample.java ; + */ + public ListAdminDeptStatResp list(ListAdminDeptStatReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/admin/v1/admin_dept_stats" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListAdminDeptStatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAdminDeptStatResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/admin_dept_stats" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/AdminUserStat.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/AdminUserStat.java new file mode 100644 index 000000000..db083803b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/AdminUserStat.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.admin.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.admin.v1.model.ListAdminUserStatReq; +import com.lark.oapi.service.admin.v1.model.ListAdminUserStatResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class AdminUserStat { + private static final Logger log = LoggerFactory.getLogger(AdminUserStat.class); + private final Config config; + + public AdminUserStat(Config config) { + this.config = config; + } + + + /** + * 获取用户维度的用户活跃和功能使用数据,用于获取用户维度的用户活跃和功能使用数据,即IM(即时通讯)、日历、云文档、音视频会议功能的使用数据。 + *

- 只有企业自建应用才有权限调用此接口;;- 当天的数据会在第二天的早上九点半产出(UTC+8) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/admin_user_stat/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListAdminUserStatSample.java ; + */ + public ListAdminUserStatResp list(ListAdminUserStatReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/admin/v1/admin_user_stats" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListAdminUserStatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAdminUserStatResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/admin_user_stats" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取用户维度的用户活跃和功能使用数据,用于获取用户维度的用户活跃和功能使用数据,即IM(即时通讯)、日历、云文档、音视频会议功能的使用数据。 + *

- 只有企业自建应用才有权限调用此接口;;- 当天的数据会在第二天的早上九点半产出(UTC+8) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/admin_user_stat/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListAdminUserStatSample.java ; + */ + public ListAdminUserStatResp list(ListAdminUserStatReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/admin/v1/admin_user_stats" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListAdminUserStatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAdminUserStatResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/admin_user_stats" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/AuditInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/AuditInfo.java new file mode 100644 index 000000000..2200a6923 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/AuditInfo.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.admin.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.admin.v1.model.ListAuditInfoReq; +import com.lark.oapi.service.admin.v1.model.ListAuditInfoResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class AuditInfo { + private static final Logger log = LoggerFactory.getLogger(AuditInfo.class); + private final Config config; + + public AuditInfo(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uQjM5YjL0ITO24CNykjN/audit_log/audit_data_get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListAuditInfoSample.java ; + */ + public ListAuditInfoResp list(ListAuditInfoReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/admin/v1/audit_infos" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListAuditInfoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAuditInfoResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/audit_infos" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uQjM5YjL0ITO24CNykjN/audit_log/audit_data_get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListAuditInfoSample.java ; + */ + public ListAuditInfoResp list(ListAuditInfoReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/admin/v1/audit_infos" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListAuditInfoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAuditInfoResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/audit_infos" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/Badge.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/Badge.java new file mode 100644 index 000000000..3303d9bda --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/Badge.java @@ -0,0 +1,302 @@ +// Code generated by lark suite 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 com.lark.oapi.service.admin.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.admin.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Badge { + private static final Logger log = LoggerFactory.getLogger(Badge.class); + private final Config config; + + public Badge(Config config) { + this.config = config; + } + + + /** + * 创建勋章,使用该接口可以创建一枚完整的勋章信息,一个租户下最多可创建1000枚勋章。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/CreateBadgeSample.java ; + */ + public CreateBadgeResp create(CreateBadgeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/admin/v1/badges" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateBadgeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateBadgeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建勋章,使用该接口可以创建一枚完整的勋章信息,一个租户下最多可创建1000枚勋章。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/CreateBadgeSample.java ; + */ + public CreateBadgeResp create(CreateBadgeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/admin/v1/badges" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateBadgeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateBadgeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取勋章详情,可以通过该接口查询勋章的详情 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/GetBadgeSample.java ; + */ + public GetBadgeResp get(GetBadgeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/admin/v1/badges/:badge_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetBadgeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetBadgeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取勋章详情,可以通过该接口查询勋章的详情 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/GetBadgeSample.java ; + */ + public GetBadgeResp get(GetBadgeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/admin/v1/badges/:badge_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetBadgeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetBadgeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取勋章列表,可以通过该接口列出租户下所有的勋章,勋章的排列顺序是按照创建时间倒序排列。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListBadgeSample.java ; + */ + public ListBadgeResp list(ListBadgeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/admin/v1/badges" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListBadgeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListBadgeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取勋章列表,可以通过该接口列出租户下所有的勋章,勋章的排列顺序是按照创建时间倒序排列。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListBadgeSample.java ; + */ + public ListBadgeResp list(ListBadgeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/admin/v1/badges" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListBadgeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListBadgeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改勋章信息,通过该接口可以修改勋章的信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/UpdateBadgeSample.java ; + */ + public UpdateBadgeResp update(UpdateBadgeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/admin/v1/badges/:badge_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateBadgeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateBadgeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改勋章信息,通过该接口可以修改勋章的信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/UpdateBadgeSample.java ; + */ + public UpdateBadgeResp update(UpdateBadgeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/admin/v1/badges/:badge_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateBadgeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateBadgeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/BadgeGrant.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/BadgeGrant.java new file mode 100644 index 000000000..c3716f46d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/BadgeGrant.java @@ -0,0 +1,368 @@ +// Code generated by lark suite 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 com.lark.oapi.service.admin.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.admin.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class BadgeGrant { + private static final Logger log = LoggerFactory.getLogger(BadgeGrant.class); + private final Config config; + + public BadgeGrant(Config config) { + this.config = config; + } + + + /** + * 创建勋章的授予名单,通过该接口可以为特定勋章创建一份授予名单,一枚勋章下最多可创建1000份授予名单。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/CreateBadgeGrantSample.java ; + */ + public CreateBadgeGrantResp create(CreateBadgeGrantReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/admin/v1/badges/:badge_id/grants" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateBadgeGrantResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateBadgeGrantResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id/grants" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建勋章的授予名单,通过该接口可以为特定勋章创建一份授予名单,一枚勋章下最多可创建1000份授予名单。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/CreateBadgeGrantSample.java ; + */ + public CreateBadgeGrantResp create(CreateBadgeGrantReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/admin/v1/badges/:badge_id/grants" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateBadgeGrantResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateBadgeGrantResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id/grants" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除授予名单,通过该接口可以删除特定授予名单的信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/DeleteBadgeGrantSample.java ; + */ + public DeleteBadgeGrantResp delete(DeleteBadgeGrantReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/admin/v1/badges/:badge_id/grants/:grant_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteBadgeGrantResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteBadgeGrantResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id/grants/:grant_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除授予名单,通过该接口可以删除特定授予名单的信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/DeleteBadgeGrantSample.java ; + */ + public DeleteBadgeGrantResp delete(DeleteBadgeGrantReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/admin/v1/badges/:badge_id/grants/:grant_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteBadgeGrantResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteBadgeGrantResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id/grants/:grant_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取授予名单的信息,通过该接口可以获取特定授予名单的信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/GetBadgeGrantSample.java ; + */ + public GetBadgeGrantResp get(GetBadgeGrantReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/admin/v1/badges/:badge_id/grants/:grant_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetBadgeGrantResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetBadgeGrantResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id/grants/:grant_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取授予名单的信息,通过该接口可以获取特定授予名单的信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/GetBadgeGrantSample.java ; + */ + public GetBadgeGrantResp get(GetBadgeGrantReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/admin/v1/badges/:badge_id/grants/:grant_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetBadgeGrantResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetBadgeGrantResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id/grants/:grant_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取勋章的授予名单列表,通过该接口可以获取特定勋章下的授予名单列表,授予名单的排列顺序按照创建时间倒序排列。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListBadgeGrantSample.java ; + */ + public ListBadgeGrantResp list(ListBadgeGrantReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/admin/v1/badges/:badge_id/grants" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListBadgeGrantResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListBadgeGrantResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id/grants" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取勋章的授予名单列表,通过该接口可以获取特定勋章下的授予名单列表,授予名单的排列顺序按照创建时间倒序排列。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListBadgeGrantSample.java ; + */ + public ListBadgeGrantResp list(ListBadgeGrantReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/admin/v1/badges/:badge_id/grants" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListBadgeGrantResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListBadgeGrantResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id/grants" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改授予名单,通过该接口可以修改特定授予名单的相关信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/UpdateBadgeGrantSample.java ; + */ + public UpdateBadgeGrantResp update(UpdateBadgeGrantReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/admin/v1/badges/:badge_id/grants/:grant_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateBadgeGrantResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateBadgeGrantResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id/grants/:grant_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改授予名单,通过该接口可以修改特定授予名单的相关信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/UpdateBadgeGrantSample.java ; + */ + public UpdateBadgeGrantResp update(UpdateBadgeGrantReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/admin/v1/badges/:badge_id/grants/:grant_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateBadgeGrantResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateBadgeGrantResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badges/:badge_id/grants/:grant_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/BadgeImage.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/BadgeImage.java new file mode 100644 index 000000000..376e7feb8 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/BadgeImage.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.admin.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.admin.v1.model.CreateBadgeImageReq; +import com.lark.oapi.service.admin.v1.model.CreateBadgeImageResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class BadgeImage { + private static final Logger log = LoggerFactory.getLogger(BadgeImage.class); + private final Config config; + + public BadgeImage(Config config) { + this.config = config; + } + + + /** + * 上传勋章图片,通过该接口可以上传勋章详情图、挂饰图的文件,获取对应的文件key + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge_image/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/CreateBadgeImageSample.java ; + */ + public CreateBadgeImageResp create(CreateBadgeImageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/admin/v1/badge_images" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateBadgeImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateBadgeImageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badge_images" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 上传勋章图片,通过该接口可以上传勋章详情图、挂饰图的文件,获取对应的文件key + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge_image/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/CreateBadgeImageSample.java ; + */ + public CreateBadgeImageResp create(CreateBadgeImageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/admin/v1/badge_images" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateBadgeImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateBadgeImageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/badge_images" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/Password.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/Password.java new file mode 100644 index 000000000..5deadfc4e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/admin/v1/resource/Password.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.admin.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.admin.v1.model.ResetPasswordReq; +import com.lark.oapi.service.admin.v1.model.ResetPasswordResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Password { + private static final Logger log = LoggerFactory.getLogger(Password.class); + private final Config config; + + public Password(Config config) { + this.config = config; + } + + + /** + * 重置密码,重置用户的企业邮箱密码,仅当用户的邮箱和企业邮箱(别名)一致时生效,可用于处理飞书企业邮箱登录死锁的问题。;;邮箱死锁:当用户的登录凭证与飞书企业邮箱一致时,目前飞书登录流程要求用户输入验证码,由于飞书邮箱无单独的帐号体系,则未登录时无法收取邮箱验证码,即陷入死锁 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/password/reset ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ResetPasswordSample.java ; + */ + public ResetPasswordResp reset(ResetPasswordReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/admin/v1/password/reset" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ResetPasswordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ResetPasswordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/password/reset" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 重置密码,重置用户的企业邮箱密码,仅当用户的邮箱和企业邮箱(别名)一致时生效,可用于处理飞书企业邮箱登录死锁的问题。;;邮箱死锁:当用户的登录凭证与飞书企业邮箱一致时,目前飞书登录流程要求用户输入验证码,由于飞书邮箱无单独的帐号体系,则未登录时无法收取邮箱验证码,即陷入死锁 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/password/reset ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ResetPasswordSample.java ; + */ + public ResetPasswordResp reset(ResetPasswordReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/admin/v1/password/reset" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ResetPasswordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ResetPasswordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/admin/v1/password/reset" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/application/ApplicationService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/application/ApplicationService.java new file mode 100644 index 000000000..88628c810 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/application/ApplicationService.java @@ -0,0 +1,177 @@ +// Code generated by lark suite 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 com.lark.oapi.service.application; + +import com.lark.oapi.core.Config; +import com.lark.oapi.event.IEventHandler; +import com.lark.oapi.service.application.v6.V6; +import com.lark.oapi.service.application.v6.model.*; +import com.lark.oapi.service.application.v6.resource.AppBadge; +import com.lark.oapi.service.application.v6.resource.AppRecommendRule; +import com.lark.oapi.service.application.v6.resource.Application; +import com.lark.oapi.service.application.v6.resource.ApplicationAppUsage; +import com.lark.oapi.service.application.v6.resource.ApplicationAppVersion; +import com.lark.oapi.service.application.v6.resource.ApplicationFeedback; +import com.lark.oapi.service.application.v6.resource.ApplicationVisibility; +import com.lark.oapi.service.application.v6.resource.Bot; +import com.lark.oapi.service.application.v6.resource.*; + +public class ApplicationService { + private final V6 v6; + private final AppBadge appBadge; // 应用红点 + private final AppRecommendRule appRecommendRule; // 我的常用推荐规则 + private final Application application; // 应用 + private final ApplicationAppUsage applicationAppUsage; // 应用使用情况 + private final ApplicationAppVersion applicationAppVersion; // 事件 + private final ApplicationContactsRange applicationContactsRange; // application.contacts_range + private final ApplicationFeedback applicationFeedback; // 应用反馈 + private final ApplicationVisibility applicationVisibility; // 事件 + private final Bot bot; // 事件 + + public ApplicationService(Config config) { + this.v6 = new V6(config); + this.appBadge = new AppBadge(config); + this.appRecommendRule = new AppRecommendRule(config); + this.application = new Application(config); + this.applicationAppUsage = new ApplicationAppUsage(config); + this.applicationAppVersion = new ApplicationAppVersion(config); + this.applicationContactsRange = new ApplicationContactsRange(config); + this.applicationFeedback = new ApplicationFeedback(config); + this.applicationVisibility = new ApplicationVisibility(config); + this.bot = new Bot(config); + } + + public V6 v6() { + return v6; + } + + public AppBadge appBadge() { + return appBadge; + } + + public AppRecommendRule appRecommendRule() { + return appRecommendRule; + } + + public Application application() { + return application; + } + + public ApplicationAppUsage applicationAppUsage() { + return applicationAppUsage; + } + + public ApplicationAppVersion applicationAppVersion() { + return applicationAppVersion; + } + + public ApplicationContactsRange applicationContactsRange() { + return applicationContactsRange; + } + + public ApplicationFeedback applicationFeedback() { + return applicationFeedback; + } + + public ApplicationVisibility applicationVisibility() { + return applicationVisibility; + } + + public Bot bot() { + return bot; + } + + public abstract static class P2ApplicationCreatedV6Handler implements IEventHandler { + @Override + public P2ApplicationCreatedV6 getEvent() { + return new P2ApplicationCreatedV6(); + } + } + + public abstract static class P2ApplicationAppVersionAuditV6Handler implements IEventHandler { + @Override + public P2ApplicationAppVersionAuditV6 getEvent() { + return new P2ApplicationAppVersionAuditV6(); + } + } + + public abstract static class P2ApplicationAppVersionPublishApplyV6Handler implements IEventHandler { + @Override + public P2ApplicationAppVersionPublishApplyV6 getEvent() { + return new P2ApplicationAppVersionPublishApplyV6(); + } + } + + public abstract static class P2ApplicationAppVersionPublishRevokeV6Handler implements IEventHandler { + @Override + public P2ApplicationAppVersionPublishRevokeV6 getEvent() { + return new P2ApplicationAppVersionPublishRevokeV6(); + } + } + + public abstract static class P2ApplicationFeedbackCreatedV6Handler implements IEventHandler { + @Override + public P2ApplicationFeedbackCreatedV6 getEvent() { + return new P2ApplicationFeedbackCreatedV6(); + } + } + + public abstract static class P2ApplicationFeedbackUpdatedV6Handler implements IEventHandler { + @Override + public P2ApplicationFeedbackUpdatedV6 getEvent() { + return new P2ApplicationFeedbackUpdatedV6(); + } + } + + public abstract static class P2ApplicationVisibilityAddedV6Handler implements IEventHandler { + @Override + public P2ApplicationVisibilityAddedV6 getEvent() { + return new P2ApplicationVisibilityAddedV6(); + } + } + + public abstract static class P2BotMenuV6Handler implements IEventHandler { + @Override + public P2BotMenuV6 getEvent() { + return new P2BotMenuV6(); + } + } + + public abstract static class P1AppOpenV6Handler implements IEventHandler { + @Override + public P1AppOpenV6 getEvent() { + return new P1AppOpenV6(); + } + } + + public abstract static class P1AppStatusChangedV6Handler implements IEventHandler { + @Override + public P1AppStatusChangedV6 getEvent() { + return new P1AppStatusChangedV6(); + } + } + + public abstract static class P1OrderPaidV6Handler implements IEventHandler { + @Override + public P1OrderPaidV6 getEvent() { + return new P1OrderPaidV6(); + } + } + + public abstract static class P1AppUninstalledV6Handler implements IEventHandler { + @Override + public P1AppUninstalledV6 getEvent() { + return new P1AppUninstalledV6(); + } + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/ApplicationService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/ApplicationService.java deleted file mode 100644 index f907c15da..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/ApplicationService.java +++ /dev/null @@ -1,1417 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.application.v6; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.event.IEventHandler; -import com.lark.oapi.service.application.v6.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class ApplicationService { - private static final Logger log = LoggerFactory.getLogger(ApplicationService.class); - private final AppBadge appBadge; // 应用红点 - private final AppRecommendRule appRecommendRule; // 我的常用推荐规则 - private final Application application; // 应用 - private final ApplicationAppUsage applicationAppUsage; // 应用使用情况 - private final ApplicationAppVersion applicationAppVersion; // 事件 - private final ApplicationContactsRange applicationContactsRange; // application.contacts_range - private final ApplicationFeedback applicationFeedback; // 应用反馈 - private final ApplicationVisibility applicationVisibility; // 事件 - private final Bot bot; // 事件 - - public ApplicationService(Config config) { - this.appBadge = new AppBadge(config); - this.appRecommendRule = new AppRecommendRule(config); - this.application = new Application(config); - this.applicationAppUsage = new ApplicationAppUsage(config); - this.applicationAppVersion = new ApplicationAppVersion(config); - this.applicationContactsRange = new ApplicationContactsRange(config); - this.applicationFeedback = new ApplicationFeedback(config); - this.applicationVisibility = new ApplicationVisibility(config); - this.bot = new Bot(config); - } - - /** - * 应用红点 - * - * @return - */ - public AppBadge appBadge() { - return appBadge; - } - - /** - * 我的常用推荐规则 - * - * @return - */ - public AppRecommendRule appRecommendRule() { - return appRecommendRule; - } - - /** - * 应用 - * - * @return - */ - public Application application() { - return application; - } - - /** - * 应用使用情况 - * - * @return - */ - public ApplicationAppUsage applicationAppUsage() { - return applicationAppUsage; - } - - /** - * 事件 - * - * @return - */ - public ApplicationAppVersion applicationAppVersion() { - return applicationAppVersion; - } - - /** - * application.contacts_range - * - * @return - */ - public ApplicationContactsRange applicationContactsRange() { - return applicationContactsRange; - } - - /** - * 应用反馈 - * - * @return - */ - public ApplicationFeedback applicationFeedback() { - return applicationFeedback; - } - - /** - * 事件 - * - * @return - */ - public ApplicationVisibility applicationVisibility() { - return applicationVisibility; - } - - /** - * 事件 - * - * @return - */ - public Bot bot() { - return bot; - } - - public static class AppBadge { - private final Config config; - - public AppBadge(Config config) { - this.config = config; - } - - /** - * 更新应用红点,更新应用红点信息,用于工作台场景 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/app_badge/set ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/SetAppBadgeSample.java ; - */ - public SetAppBadgeResp set(SetAppBadgeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/application/v6/app_badge/set" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SetAppBadgeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SetAppBadgeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/app_badge/set" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新应用红点,更新应用红点信息,用于工作台场景 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/app_badge/set ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/SetAppBadgeSample.java ; - */ - public SetAppBadgeResp set(SetAppBadgeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/application/v6/app_badge/set" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SetAppBadgeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SetAppBadgeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/app_badge/set" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class AppRecommendRule { - private final Config config; - - public AppRecommendRule(Config config) { - this.config = config; - } - - /** - * 获取当前设置的推荐规则列表,获取当前设置的推荐规则列表。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/app_recommend_rule/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ListAppRecommendRuleSample.java ; - */ - public ListAppRecommendRuleResp list(ListAppRecommendRuleReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/application/v6/app_recommend_rules" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListAppRecommendRuleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppRecommendRuleResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/app_recommend_rules" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取当前设置的推荐规则列表,获取当前设置的推荐规则列表。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/app_recommend_rule/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ListAppRecommendRuleSample.java ; - */ - public ListAppRecommendRuleResp list(ListAppRecommendRuleReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/application/v6/app_recommend_rules" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListAppRecommendRuleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppRecommendRuleResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/app_recommend_rules" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Application { - private final Config config; - - public Application(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=contacts_range_configuration&project=application&resource=application&version=v6 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ContactsRangeConfigurationApplicationSample.java ; - */ - public ContactsRangeConfigurationApplicationResp contactsRangeConfiguration(ContactsRangeConfigurationApplicationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/application/v6/applications/:app_id/contacts_range_configuration" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ContactsRangeConfigurationApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ContactsRangeConfigurationApplicationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/contacts_range_configuration" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=contacts_range_configuration&project=application&resource=application&version=v6 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ContactsRangeConfigurationApplicationSample.java ; - */ - public ContactsRangeConfigurationApplicationResp contactsRangeConfiguration(ContactsRangeConfigurationApplicationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/application/v6/applications/:app_id/contacts_range_configuration" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ContactsRangeConfigurationApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ContactsRangeConfigurationApplicationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/contacts_range_configuration" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取应用信息,根据app_id获取应用的基础信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/GetApplicationSample.java ; - */ - public GetApplicationResp get(GetApplicationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/application/v6/applications/:app_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetApplicationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取应用信息,根据app_id获取应用的基础信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/GetApplicationSample.java ; - */ - public GetApplicationResp get(GetApplicationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/application/v6/applications/:app_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetApplicationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新应用分组信息,更新应用的分组信息(分组会影响应用在工作台中的分类情况,请谨慎更新) - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationSample.java ; - */ - public PatchApplicationResp patch(PatchApplicationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/application/v6/applications/:app_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchApplicationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新应用分组信息,更新应用的分组信息(分组会影响应用在工作台中的分类情况,请谨慎更新) - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationSample.java ; - */ - public PatchApplicationResp patch(PatchApplicationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/application/v6/applications/:app_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchApplicationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查看待审核的应用列表,查看本企业下所有待审核的自建应用列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application/underauditlist ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/UnderauditlistApplicationSample.java ; - */ - public UnderauditlistApplicationResp underauditlist(UnderauditlistApplicationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/application/v6/applications/underauditlist" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UnderauditlistApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnderauditlistApplicationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/underauditlist" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查看待审核的应用列表,查看本企业下所有待审核的自建应用列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application/underauditlist ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/UnderauditlistApplicationSample.java ; - */ - public UnderauditlistApplicationResp underauditlist(UnderauditlistApplicationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/application/v6/applications/underauditlist" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UnderauditlistApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnderauditlistApplicationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/underauditlist" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ApplicationAppUsage { - private final Config config; - - public ApplicationAppUsage(Config config) { - this.config = config; - } - - /** - * 获取多部门应用使用概览(灰度租户可见),查看应用在某一天/某一周/某一个月的使用数据,可以根据部门做多层子部门的筛选 - *

1. 仅支持企业版/旗舰版租户使用;2. 一般每天早上10点产出前一天的数据;3. 已经支持的指标包括:应用的活跃用户数、累计用户数、新增用户数、访问页面数、打开次数;4. 按照部门查看数据时,可以分别展示当前部门以及其子部门的使用情况;5. 如果查询的部门在查询日期没有使用过应用,只返回指标:应用的活跃用户数指标;6. 数据从飞书4.10版本开始统计,使用飞书版本4.10及以下版本的用户数据不会被统计到;7. 调用频控为100次/分 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_usage/department_overview ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/DepartmentOverviewApplicationAppUsageSample.java ; - */ - public DepartmentOverviewApplicationAppUsageResp departmentOverview(DepartmentOverviewApplicationAppUsageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/application/v6/applications/:app_id/app_usage/department_overview" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DepartmentOverviewApplicationAppUsageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DepartmentOverviewApplicationAppUsageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/app_usage/department_overview" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取多部门应用使用概览(灰度租户可见),查看应用在某一天/某一周/某一个月的使用数据,可以根据部门做多层子部门的筛选 - *

1. 仅支持企业版/旗舰版租户使用;2. 一般每天早上10点产出前一天的数据;3. 已经支持的指标包括:应用的活跃用户数、累计用户数、新增用户数、访问页面数、打开次数;4. 按照部门查看数据时,可以分别展示当前部门以及其子部门的使用情况;5. 如果查询的部门在查询日期没有使用过应用,只返回指标:应用的活跃用户数指标;6. 数据从飞书4.10版本开始统计,使用飞书版本4.10及以下版本的用户数据不会被统计到;7. 调用频控为100次/分 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_usage/department_overview ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/DepartmentOverviewApplicationAppUsageSample.java ; - */ - public DepartmentOverviewApplicationAppUsageResp departmentOverview(DepartmentOverviewApplicationAppUsageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/application/v6/applications/:app_id/app_usage/department_overview" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DepartmentOverviewApplicationAppUsageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DepartmentOverviewApplicationAppUsageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/app_usage/department_overview" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取应用使用概览,查看应用在某一天/某一周/某一个月的使用数据,可以查看租户整体对应用的使用情况,也可以分部门查看。 - *

1. 仅支持企业版/旗舰版租户使用;2. 一般每天早上10点产出前一天的数据;3. 已经支持的指标包括:应用的活跃用户数、累计用户数、新增用户数、访问页面数、打开次数;4. 数据从飞书4.10版本开始统计,使用飞书版本4.10及以下版本的用户数据不会被统计到;5. 按照部门查看数据时,会展示当前部门以及其子部门的整体使用情况;6. 调用频控为100次/分 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_usage/overview ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/OverviewApplicationAppUsageSample.java ; - */ - public OverviewApplicationAppUsageResp overview(OverviewApplicationAppUsageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/application/v6/applications/:app_id/app_usage/overview" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - OverviewApplicationAppUsageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, OverviewApplicationAppUsageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/app_usage/overview" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取应用使用概览,查看应用在某一天/某一周/某一个月的使用数据,可以查看租户整体对应用的使用情况,也可以分部门查看。 - *

1. 仅支持企业版/旗舰版租户使用;2. 一般每天早上10点产出前一天的数据;3. 已经支持的指标包括:应用的活跃用户数、累计用户数、新增用户数、访问页面数、打开次数;4. 数据从飞书4.10版本开始统计,使用飞书版本4.10及以下版本的用户数据不会被统计到;5. 按照部门查看数据时,会展示当前部门以及其子部门的整体使用情况;6. 调用频控为100次/分 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_usage/overview ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/OverviewApplicationAppUsageSample.java ; - */ - public OverviewApplicationAppUsageResp overview(OverviewApplicationAppUsageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/application/v6/applications/:app_id/app_usage/overview" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - OverviewApplicationAppUsageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, OverviewApplicationAppUsageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/app_usage/overview" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ApplicationAppVersion { - private final Config config; - - public ApplicationAppVersion(Config config) { - this.config = config; - } - - /** - * ,获取应用版本通讯录权限范围建议 - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=contacts_range_suggest&project=application&resource=application.app_version&version=v6 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ContactsRangeSuggestApplicationAppVersionSample.java ; - */ - public ContactsRangeSuggestApplicationAppVersionResp contactsRangeSuggest(ContactsRangeSuggestApplicationAppVersionReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/application/v6/applications/:app_id/app_versions/:version_id/contacts_range_suggest" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ContactsRangeSuggestApplicationAppVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ContactsRangeSuggestApplicationAppVersionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/app_versions/:version_id/contacts_range_suggest" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * ,获取应用版本通讯录权限范围建议 - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=contacts_range_suggest&project=application&resource=application.app_version&version=v6 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ContactsRangeSuggestApplicationAppVersionSample.java ; - */ - public ContactsRangeSuggestApplicationAppVersionResp contactsRangeSuggest(ContactsRangeSuggestApplicationAppVersionReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/application/v6/applications/:app_id/app_versions/:version_id/contacts_range_suggest" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ContactsRangeSuggestApplicationAppVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ContactsRangeSuggestApplicationAppVersionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/app_versions/:version_id/contacts_range_suggest" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取应用版本信息,根据应用 ID 和应用版本 ID 来获取同租户下的应用版本的信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_version/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/GetApplicationAppVersionSample.java ; - */ - public GetApplicationAppVersionResp get(GetApplicationAppVersionReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/application/v6/applications/:app_id/app_versions/:version_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetApplicationAppVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetApplicationAppVersionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/app_versions/:version_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取应用版本信息,根据应用 ID 和应用版本 ID 来获取同租户下的应用版本的信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_version/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/GetApplicationAppVersionSample.java ; - */ - public GetApplicationAppVersionResp get(GetApplicationAppVersionReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/application/v6/applications/:app_id/app_versions/:version_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetApplicationAppVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetApplicationAppVersionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/app_versions/:version_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取应用版本列表,根据 app_id 获取对应应用版本列表。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_version/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ListApplicationAppVersionSample.java ; - */ - public ListApplicationAppVersionResp list(ListApplicationAppVersionReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/application/v6/applications/:app_id/app_versions" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListApplicationAppVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListApplicationAppVersionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/app_versions" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取应用版本列表,根据 app_id 获取对应应用版本列表。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_version/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ListApplicationAppVersionSample.java ; - */ - public ListApplicationAppVersionResp list(ListApplicationAppVersionReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/application/v6/applications/:app_id/app_versions" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListApplicationAppVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListApplicationAppVersionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/app_versions" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新应用审核状态,通过接口来更新应用版本的审核结果:通过后应用可以直接上架;拒绝后则开发者可以看到拒绝理由,并在修改后再次申请发布。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_version/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationAppVersionSample.java ; - */ - public PatchApplicationAppVersionResp patch(PatchApplicationAppVersionReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/application/v6/applications/:app_id/app_versions/:version_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchApplicationAppVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchApplicationAppVersionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/app_versions/:version_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新应用审核状态,通过接口来更新应用版本的审核结果:通过后应用可以直接上架;拒绝后则开发者可以看到拒绝理由,并在修改后再次申请发布。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_version/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationAppVersionSample.java ; - */ - public PatchApplicationAppVersionResp patch(PatchApplicationAppVersionReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/application/v6/applications/:app_id/app_versions/:version_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchApplicationAppVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchApplicationAppVersionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/app_versions/:version_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ApplicationContactsRange { - private final Config config; - - public ApplicationContactsRange(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=application&resource=application.contacts_range&version=v6 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationContactsRangeSample.java ; - */ - public PatchApplicationContactsRangeResp patch(PatchApplicationContactsRangeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/application/v6/applications/:app_id/contacts_range" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchApplicationContactsRangeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchApplicationContactsRangeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/contacts_range" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=application&resource=application.contacts_range&version=v6 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationContactsRangeSample.java ; - */ - public PatchApplicationContactsRangeResp patch(PatchApplicationContactsRangeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/application/v6/applications/:app_id/contacts_range" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchApplicationContactsRangeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchApplicationContactsRangeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/contacts_range" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ApplicationFeedback { - private final Config config; - - public ApplicationFeedback(Config config) { - this.config = config; - } - - /** - * 获取应用反馈列表,查询应用的反馈数据 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-feedback/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ListApplicationFeedbackSample.java ; - */ - public ListApplicationFeedbackResp list(ListApplicationFeedbackReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/application/v6/applications/:app_id/feedbacks" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListApplicationFeedbackResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListApplicationFeedbackResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/feedbacks" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取应用反馈列表,查询应用的反馈数据 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-feedback/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ListApplicationFeedbackSample.java ; - */ - public ListApplicationFeedbackResp list(ListApplicationFeedbackReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/application/v6/applications/:app_id/feedbacks" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListApplicationFeedbackResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListApplicationFeedbackResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/feedbacks" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新应用反馈,更新应用的反馈数据 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-feedback/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationFeedbackSample.java ; - */ - public PatchApplicationFeedbackResp patch(PatchApplicationFeedbackReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/application/v6/applications/:app_id/feedbacks/:feedback_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchApplicationFeedbackResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchApplicationFeedbackResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/feedbacks/:feedback_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新应用反馈,更新应用的反馈数据 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-feedback/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationFeedbackSample.java ; - */ - public PatchApplicationFeedbackResp patch(PatchApplicationFeedbackReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/application/v6/applications/:app_id/feedbacks/:feedback_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchApplicationFeedbackResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchApplicationFeedbackResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/feedbacks/:feedback_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ApplicationVisibility { - private final Config config; - - public ApplicationVisibility(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=check_white_black_list&project=application&resource=application.visibility&version=v6 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/CheckWhiteBlackListApplicationVisibilitySample.java ; - */ - public CheckWhiteBlackListApplicationVisibilityResp checkWhiteBlackList(CheckWhiteBlackListApplicationVisibilityReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/application/v6/applications/:app_id/visibility/check_white_black_list" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CheckWhiteBlackListApplicationVisibilityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CheckWhiteBlackListApplicationVisibilityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/visibility/check_white_black_list" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=check_white_black_list&project=application&resource=application.visibility&version=v6 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/CheckWhiteBlackListApplicationVisibilitySample.java ; - */ - public CheckWhiteBlackListApplicationVisibilityResp checkWhiteBlackList(CheckWhiteBlackListApplicationVisibilityReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/application/v6/applications/:app_id/visibility/check_white_black_list" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CheckWhiteBlackListApplicationVisibilityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CheckWhiteBlackListApplicationVisibilityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/visibility/check_white_black_list" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=application&resource=application.visibility&version=v6 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationVisibilitySample.java ; - */ - public PatchApplicationVisibilityResp patch(PatchApplicationVisibilityReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/application/v6/applications/:app_id/visibility" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchApplicationVisibilityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchApplicationVisibilityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/visibility" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=application&resource=application.visibility&version=v6 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationVisibilitySample.java ; - */ - public PatchApplicationVisibilityResp patch(PatchApplicationVisibilityReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/application/v6/applications/:app_id/visibility" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchApplicationVisibilityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchApplicationVisibilityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/visibility" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Bot { - private final Config config; - - public Bot(Config config) { - this.config = config; - } - } - - public abstract static class P2ApplicationCreatedV6Handler implements IEventHandler { - @Override - public P2ApplicationCreatedV6 getEvent() { - return new P2ApplicationCreatedV6(); - } - } - - public abstract static class P2ApplicationAppVersionAuditV6Handler implements IEventHandler { - @Override - public P2ApplicationAppVersionAuditV6 getEvent() { - return new P2ApplicationAppVersionAuditV6(); - } - } - - public abstract static class P2ApplicationAppVersionPublishApplyV6Handler implements IEventHandler { - @Override - public P2ApplicationAppVersionPublishApplyV6 getEvent() { - return new P2ApplicationAppVersionPublishApplyV6(); - } - } - - public abstract static class P2ApplicationAppVersionPublishRevokeV6Handler implements IEventHandler { - @Override - public P2ApplicationAppVersionPublishRevokeV6 getEvent() { - return new P2ApplicationAppVersionPublishRevokeV6(); - } - } - - public abstract static class P2ApplicationFeedbackCreatedV6Handler implements IEventHandler { - @Override - public P2ApplicationFeedbackCreatedV6 getEvent() { - return new P2ApplicationFeedbackCreatedV6(); - } - } - - public abstract static class P2ApplicationFeedbackUpdatedV6Handler implements IEventHandler { - @Override - public P2ApplicationFeedbackUpdatedV6 getEvent() { - return new P2ApplicationFeedbackUpdatedV6(); - } - } - - public abstract static class P2ApplicationVisibilityAddedV6Handler implements IEventHandler { - @Override - public P2ApplicationVisibilityAddedV6 getEvent() { - return new P2ApplicationVisibilityAddedV6(); - } - } - - public abstract static class P2BotMenuV6Handler implements IEventHandler { - @Override - public P2BotMenuV6 getEvent() { - return new P2BotMenuV6(); - } - } - - public abstract static class P1AppOpenV6Handler implements IEventHandler { - @Override - public P1AppOpenV6 getEvent() { - return new P1AppOpenV6(); - } - } - - public abstract static class P1AppStatusChangedV6Handler implements IEventHandler { - @Override - public P1AppStatusChangedV6 getEvent() { - return new P1AppStatusChangedV6(); - } - } - - public abstract static class P1OrderPaidV6Handler implements IEventHandler { - @Override - public P1OrderPaidV6 getEvent() { - return new P1OrderPaidV6(); - } - } - - public abstract static class P1AppUninstalledV6Handler implements IEventHandler { - @Override - public P1AppUninstalledV6 getEvent() { - return new P1AppUninstalledV6(); - } - } -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/V6.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/V6.java new file mode 100644 index 000000000..012392eb2 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/V6.java @@ -0,0 +1,77 @@ +// Code generated by lark suite 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 com.lark.oapi.service.application.v6; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.application.v6.resource.*; + +public class V6 { + private final AppBadge appBadge; // 应用红点 + private final AppRecommendRule appRecommendRule; // 我的常用推荐规则 + private final Application application; // 应用 + private final ApplicationAppUsage applicationAppUsage; // 应用使用情况 + private final ApplicationAppVersion applicationAppVersion; // 事件 + private final ApplicationContactsRange applicationContactsRange; // application.contacts_range + private final ApplicationFeedback applicationFeedback; // 应用反馈 + private final ApplicationVisibility applicationVisibility; // 事件 + private final Bot bot; // 事件 + + public V6(Config config) { + this.appBadge = new AppBadge(config); + this.appRecommendRule = new AppRecommendRule(config); + this.application = new Application(config); + this.applicationAppUsage = new ApplicationAppUsage(config); + this.applicationAppVersion = new ApplicationAppVersion(config); + this.applicationContactsRange = new ApplicationContactsRange(config); + this.applicationFeedback = new ApplicationFeedback(config); + this.applicationVisibility = new ApplicationVisibility(config); + this.bot = new Bot(config); + } + + public AppBadge appBadge() { + return appBadge; + } + + public AppRecommendRule appRecommendRule() { + return appRecommendRule; + } + + public Application application() { + return application; + } + + public ApplicationAppUsage applicationAppUsage() { + return applicationAppUsage; + } + + public ApplicationAppVersion applicationAppVersion() { + return applicationAppVersion; + } + + public ApplicationContactsRange applicationContactsRange() { + return applicationContactsRange; + } + + public ApplicationFeedback applicationFeedback() { + return applicationFeedback; + } + + public ApplicationVisibility applicationVisibility() { + return applicationVisibility; + } + + public Bot bot() { + return bot; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/AppBadge.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/AppBadge.java new file mode 100644 index 000000000..af545dd9f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/AppBadge.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.application.v6.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.application.v6.model.SetAppBadgeReq; +import com.lark.oapi.service.application.v6.model.SetAppBadgeResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class AppBadge { + private static final Logger log = LoggerFactory.getLogger(AppBadge.class); + private final Config config; + + public AppBadge(Config config) { + this.config = config; + } + + + /** + * 更新应用红点,更新应用红点信息,用于工作台场景 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/app_badge/set ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/SetAppBadgeSample.java ; + */ + public SetAppBadgeResp set(SetAppBadgeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/application/v6/app_badge/set" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SetAppBadgeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SetAppBadgeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/app_badge/set" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新应用红点,更新应用红点信息,用于工作台场景 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/app_badge/set ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/SetAppBadgeSample.java ; + */ + public SetAppBadgeResp set(SetAppBadgeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/application/v6/app_badge/set" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SetAppBadgeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SetAppBadgeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/app_badge/set" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/AppRecommendRule.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/AppRecommendRule.java new file mode 100644 index 000000000..7584f15c8 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/AppRecommendRule.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.application.v6.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.application.v6.model.ListAppRecommendRuleReq; +import com.lark.oapi.service.application.v6.model.ListAppRecommendRuleResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class AppRecommendRule { + private static final Logger log = LoggerFactory.getLogger(AppRecommendRule.class); + private final Config config; + + public AppRecommendRule(Config config) { + this.config = config; + } + + + /** + * 获取当前设置的推荐规则列表,获取当前设置的推荐规则列表。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/app_recommend_rule/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ListAppRecommendRuleSample.java ; + */ + public ListAppRecommendRuleResp list(ListAppRecommendRuleReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/application/v6/app_recommend_rules" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListAppRecommendRuleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppRecommendRuleResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/app_recommend_rules" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取当前设置的推荐规则列表,获取当前设置的推荐规则列表。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/app_recommend_rule/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ListAppRecommendRuleSample.java ; + */ + public ListAppRecommendRuleResp list(ListAppRecommendRuleReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/application/v6/app_recommend_rules" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListAppRecommendRuleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppRecommendRuleResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/app_recommend_rules" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/Application.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/Application.java new file mode 100644 index 000000000..f7d3037bd --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/Application.java @@ -0,0 +1,302 @@ +// Code generated by lark suite 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 com.lark.oapi.service.application.v6.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.application.v6.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Application { + private static final Logger log = LoggerFactory.getLogger(Application.class); + private final Config config; + + public Application(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=contacts_range_configuration&project=application&resource=application&version=v6 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ContactsRangeConfigurationApplicationSample.java ; + */ + public ContactsRangeConfigurationApplicationResp contactsRangeConfiguration(ContactsRangeConfigurationApplicationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/application/v6/applications/:app_id/contacts_range_configuration" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ContactsRangeConfigurationApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ContactsRangeConfigurationApplicationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/contacts_range_configuration" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=contacts_range_configuration&project=application&resource=application&version=v6 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ContactsRangeConfigurationApplicationSample.java ; + */ + public ContactsRangeConfigurationApplicationResp contactsRangeConfiguration(ContactsRangeConfigurationApplicationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/application/v6/applications/:app_id/contacts_range_configuration" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ContactsRangeConfigurationApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ContactsRangeConfigurationApplicationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/contacts_range_configuration" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取应用信息,根据app_id获取应用的基础信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/GetApplicationSample.java ; + */ + public GetApplicationResp get(GetApplicationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/application/v6/applications/:app_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetApplicationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取应用信息,根据app_id获取应用的基础信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/GetApplicationSample.java ; + */ + public GetApplicationResp get(GetApplicationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/application/v6/applications/:app_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetApplicationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新应用分组信息,更新应用的分组信息(分组会影响应用在工作台中的分类情况,请谨慎更新) + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationSample.java ; + */ + public PatchApplicationResp patch(PatchApplicationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/application/v6/applications/:app_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchApplicationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新应用分组信息,更新应用的分组信息(分组会影响应用在工作台中的分类情况,请谨慎更新) + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationSample.java ; + */ + public PatchApplicationResp patch(PatchApplicationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/application/v6/applications/:app_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchApplicationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查看待审核的应用列表,查看本企业下所有待审核的自建应用列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application/underauditlist ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/UnderauditlistApplicationSample.java ; + */ + public UnderauditlistApplicationResp underauditlist(UnderauditlistApplicationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/application/v6/applications/underauditlist" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UnderauditlistApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnderauditlistApplicationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/underauditlist" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查看待审核的应用列表,查看本企业下所有待审核的自建应用列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application/underauditlist ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/UnderauditlistApplicationSample.java ; + */ + public UnderauditlistApplicationResp underauditlist(UnderauditlistApplicationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/application/v6/applications/underauditlist" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UnderauditlistApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnderauditlistApplicationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/underauditlist" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/ApplicationAppUsage.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/ApplicationAppUsage.java new file mode 100644 index 000000000..971fb2c02 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/ApplicationAppUsage.java @@ -0,0 +1,177 @@ +// Code generated by lark suite 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 com.lark.oapi.service.application.v6.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.application.v6.model.DepartmentOverviewApplicationAppUsageReq; +import com.lark.oapi.service.application.v6.model.DepartmentOverviewApplicationAppUsageResp; +import com.lark.oapi.service.application.v6.model.OverviewApplicationAppUsageReq; +import com.lark.oapi.service.application.v6.model.OverviewApplicationAppUsageResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ApplicationAppUsage { + private static final Logger log = LoggerFactory.getLogger(ApplicationAppUsage.class); + private final Config config; + + public ApplicationAppUsage(Config config) { + this.config = config; + } + + + /** + * 获取多部门应用使用概览(灰度租户可见),查看应用在某一天/某一周/某一个月的使用数据,可以根据部门做多层子部门的筛选 + *

1. 仅支持企业版/旗舰版租户使用;2. 一般每天早上10点产出前一天的数据;3. 已经支持的指标包括:应用的活跃用户数、累计用户数、新增用户数、访问页面数、打开次数;4. 按照部门查看数据时,可以分别展示当前部门以及其子部门的使用情况;5. 如果查询的部门在查询日期没有使用过应用,只返回指标:应用的活跃用户数指标;6. 数据从飞书4.10版本开始统计,使用飞书版本4.10及以下版本的用户数据不会被统计到;7. 调用频控为100次/分 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_usage/department_overview ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/DepartmentOverviewApplicationAppUsageSample.java ; + */ + public DepartmentOverviewApplicationAppUsageResp departmentOverview(DepartmentOverviewApplicationAppUsageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/application/v6/applications/:app_id/app_usage/department_overview" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DepartmentOverviewApplicationAppUsageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DepartmentOverviewApplicationAppUsageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/app_usage/department_overview" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取多部门应用使用概览(灰度租户可见),查看应用在某一天/某一周/某一个月的使用数据,可以根据部门做多层子部门的筛选 + *

1. 仅支持企业版/旗舰版租户使用;2. 一般每天早上10点产出前一天的数据;3. 已经支持的指标包括:应用的活跃用户数、累计用户数、新增用户数、访问页面数、打开次数;4. 按照部门查看数据时,可以分别展示当前部门以及其子部门的使用情况;5. 如果查询的部门在查询日期没有使用过应用,只返回指标:应用的活跃用户数指标;6. 数据从飞书4.10版本开始统计,使用飞书版本4.10及以下版本的用户数据不会被统计到;7. 调用频控为100次/分 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_usage/department_overview ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/DepartmentOverviewApplicationAppUsageSample.java ; + */ + public DepartmentOverviewApplicationAppUsageResp departmentOverview(DepartmentOverviewApplicationAppUsageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/application/v6/applications/:app_id/app_usage/department_overview" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DepartmentOverviewApplicationAppUsageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DepartmentOverviewApplicationAppUsageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/app_usage/department_overview" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取应用使用概览,查看应用在某一天/某一周/某一个月的使用数据,可以查看租户整体对应用的使用情况,也可以分部门查看。 + *

1. 仅支持企业版/旗舰版租户使用;2. 一般每天早上10点产出前一天的数据;3. 已经支持的指标包括:应用的活跃用户数、累计用户数、新增用户数、访问页面数、打开次数;4. 数据从飞书4.10版本开始统计,使用飞书版本4.10及以下版本的用户数据不会被统计到;5. 按照部门查看数据时,会展示当前部门以及其子部门的整体使用情况;6. 调用频控为100次/分 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_usage/overview ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/OverviewApplicationAppUsageSample.java ; + */ + public OverviewApplicationAppUsageResp overview(OverviewApplicationAppUsageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/application/v6/applications/:app_id/app_usage/overview" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + OverviewApplicationAppUsageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, OverviewApplicationAppUsageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/app_usage/overview" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取应用使用概览,查看应用在某一天/某一周/某一个月的使用数据,可以查看租户整体对应用的使用情况,也可以分部门查看。 + *

1. 仅支持企业版/旗舰版租户使用;2. 一般每天早上10点产出前一天的数据;3. 已经支持的指标包括:应用的活跃用户数、累计用户数、新增用户数、访问页面数、打开次数;4. 数据从飞书4.10版本开始统计,使用飞书版本4.10及以下版本的用户数据不会被统计到;5. 按照部门查看数据时,会展示当前部门以及其子部门的整体使用情况;6. 调用频控为100次/分 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_usage/overview ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/OverviewApplicationAppUsageSample.java ; + */ + public OverviewApplicationAppUsageResp overview(OverviewApplicationAppUsageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/application/v6/applications/:app_id/app_usage/overview" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + OverviewApplicationAppUsageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, OverviewApplicationAppUsageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/app_usage/overview" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/ApplicationAppVersion.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/ApplicationAppVersion.java new file mode 100644 index 000000000..0bd280a08 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/ApplicationAppVersion.java @@ -0,0 +1,302 @@ +// Code generated by lark suite 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 com.lark.oapi.service.application.v6.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.application.v6.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ApplicationAppVersion { + private static final Logger log = LoggerFactory.getLogger(ApplicationAppVersion.class); + private final Config config; + + public ApplicationAppVersion(Config config) { + this.config = config; + } + + + /** + * ,获取应用版本通讯录权限范围建议 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=contacts_range_suggest&project=application&resource=application.app_version&version=v6 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ContactsRangeSuggestApplicationAppVersionSample.java ; + */ + public ContactsRangeSuggestApplicationAppVersionResp contactsRangeSuggest(ContactsRangeSuggestApplicationAppVersionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/application/v6/applications/:app_id/app_versions/:version_id/contacts_range_suggest" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ContactsRangeSuggestApplicationAppVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ContactsRangeSuggestApplicationAppVersionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/app_versions/:version_id/contacts_range_suggest" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,获取应用版本通讯录权限范围建议 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=contacts_range_suggest&project=application&resource=application.app_version&version=v6 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ContactsRangeSuggestApplicationAppVersionSample.java ; + */ + public ContactsRangeSuggestApplicationAppVersionResp contactsRangeSuggest(ContactsRangeSuggestApplicationAppVersionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/application/v6/applications/:app_id/app_versions/:version_id/contacts_range_suggest" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ContactsRangeSuggestApplicationAppVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ContactsRangeSuggestApplicationAppVersionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/app_versions/:version_id/contacts_range_suggest" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取应用版本信息,根据应用 ID 和应用版本 ID 来获取同租户下的应用版本的信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_version/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/GetApplicationAppVersionSample.java ; + */ + public GetApplicationAppVersionResp get(GetApplicationAppVersionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/application/v6/applications/:app_id/app_versions/:version_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetApplicationAppVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetApplicationAppVersionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/app_versions/:version_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取应用版本信息,根据应用 ID 和应用版本 ID 来获取同租户下的应用版本的信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_version/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/GetApplicationAppVersionSample.java ; + */ + public GetApplicationAppVersionResp get(GetApplicationAppVersionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/application/v6/applications/:app_id/app_versions/:version_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetApplicationAppVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetApplicationAppVersionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/app_versions/:version_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取应用版本列表,根据 app_id 获取对应应用版本列表。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_version/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ListApplicationAppVersionSample.java ; + */ + public ListApplicationAppVersionResp list(ListApplicationAppVersionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/application/v6/applications/:app_id/app_versions" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListApplicationAppVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListApplicationAppVersionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/app_versions" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取应用版本列表,根据 app_id 获取对应应用版本列表。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_version/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ListApplicationAppVersionSample.java ; + */ + public ListApplicationAppVersionResp list(ListApplicationAppVersionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/application/v6/applications/:app_id/app_versions" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListApplicationAppVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListApplicationAppVersionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/app_versions" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新应用审核状态,通过接口来更新应用版本的审核结果:通过后应用可以直接上架;拒绝后则开发者可以看到拒绝理由,并在修改后再次申请发布。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_version/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationAppVersionSample.java ; + */ + public PatchApplicationAppVersionResp patch(PatchApplicationAppVersionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/application/v6/applications/:app_id/app_versions/:version_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchApplicationAppVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchApplicationAppVersionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/app_versions/:version_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新应用审核状态,通过接口来更新应用版本的审核结果:通过后应用可以直接上架;拒绝后则开发者可以看到拒绝理由,并在修改后再次申请发布。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_version/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationAppVersionSample.java ; + */ + public PatchApplicationAppVersionResp patch(PatchApplicationAppVersionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/application/v6/applications/:app_id/app_versions/:version_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchApplicationAppVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchApplicationAppVersionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/app_versions/:version_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/ApplicationContactsRange.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/ApplicationContactsRange.java new file mode 100644 index 000000000..6cfd8c0f1 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/ApplicationContactsRange.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.application.v6.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.application.v6.model.PatchApplicationContactsRangeReq; +import com.lark.oapi.service.application.v6.model.PatchApplicationContactsRangeResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ApplicationContactsRange { + private static final Logger log = LoggerFactory.getLogger(ApplicationContactsRange.class); + private final Config config; + + public ApplicationContactsRange(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=application&resource=application.contacts_range&version=v6 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationContactsRangeSample.java ; + */ + public PatchApplicationContactsRangeResp patch(PatchApplicationContactsRangeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/application/v6/applications/:app_id/contacts_range" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchApplicationContactsRangeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchApplicationContactsRangeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/contacts_range" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=application&resource=application.contacts_range&version=v6 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationContactsRangeSample.java ; + */ + public PatchApplicationContactsRangeResp patch(PatchApplicationContactsRangeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/application/v6/applications/:app_id/contacts_range" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchApplicationContactsRangeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchApplicationContactsRangeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/contacts_range" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/ApplicationFeedback.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/ApplicationFeedback.java new file mode 100644 index 000000000..ebd12a290 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/ApplicationFeedback.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.application.v6.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.application.v6.model.ListApplicationFeedbackReq; +import com.lark.oapi.service.application.v6.model.ListApplicationFeedbackResp; +import com.lark.oapi.service.application.v6.model.PatchApplicationFeedbackReq; +import com.lark.oapi.service.application.v6.model.PatchApplicationFeedbackResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ApplicationFeedback { + private static final Logger log = LoggerFactory.getLogger(ApplicationFeedback.class); + private final Config config; + + public ApplicationFeedback(Config config) { + this.config = config; + } + + + /** + * 获取应用反馈列表,查询应用的反馈数据 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-feedback/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ListApplicationFeedbackSample.java ; + */ + public ListApplicationFeedbackResp list(ListApplicationFeedbackReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/application/v6/applications/:app_id/feedbacks" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListApplicationFeedbackResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListApplicationFeedbackResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/feedbacks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取应用反馈列表,查询应用的反馈数据 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-feedback/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ListApplicationFeedbackSample.java ; + */ + public ListApplicationFeedbackResp list(ListApplicationFeedbackReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/application/v6/applications/:app_id/feedbacks" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListApplicationFeedbackResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListApplicationFeedbackResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/feedbacks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新应用反馈,更新应用的反馈数据 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-feedback/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationFeedbackSample.java ; + */ + public PatchApplicationFeedbackResp patch(PatchApplicationFeedbackReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/application/v6/applications/:app_id/feedbacks/:feedback_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchApplicationFeedbackResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchApplicationFeedbackResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/feedbacks/:feedback_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新应用反馈,更新应用的反馈数据 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-feedback/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationFeedbackSample.java ; + */ + public PatchApplicationFeedbackResp patch(PatchApplicationFeedbackReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/application/v6/applications/:app_id/feedbacks/:feedback_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchApplicationFeedbackResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchApplicationFeedbackResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/feedbacks/:feedback_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/ApplicationVisibility.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/ApplicationVisibility.java new file mode 100644 index 000000000..dce2e16a3 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/ApplicationVisibility.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.application.v6.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.application.v6.model.CheckWhiteBlackListApplicationVisibilityReq; +import com.lark.oapi.service.application.v6.model.CheckWhiteBlackListApplicationVisibilityResp; +import com.lark.oapi.service.application.v6.model.PatchApplicationVisibilityReq; +import com.lark.oapi.service.application.v6.model.PatchApplicationVisibilityResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ApplicationVisibility { + private static final Logger log = LoggerFactory.getLogger(ApplicationVisibility.class); + private final Config config; + + public ApplicationVisibility(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=check_white_black_list&project=application&resource=application.visibility&version=v6 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/CheckWhiteBlackListApplicationVisibilitySample.java ; + */ + public CheckWhiteBlackListApplicationVisibilityResp checkWhiteBlackList(CheckWhiteBlackListApplicationVisibilityReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/application/v6/applications/:app_id/visibility/check_white_black_list" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CheckWhiteBlackListApplicationVisibilityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CheckWhiteBlackListApplicationVisibilityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/visibility/check_white_black_list" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=check_white_black_list&project=application&resource=application.visibility&version=v6 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/CheckWhiteBlackListApplicationVisibilitySample.java ; + */ + public CheckWhiteBlackListApplicationVisibilityResp checkWhiteBlackList(CheckWhiteBlackListApplicationVisibilityReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/application/v6/applications/:app_id/visibility/check_white_black_list" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CheckWhiteBlackListApplicationVisibilityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CheckWhiteBlackListApplicationVisibilityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/visibility/check_white_black_list" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=application&resource=application.visibility&version=v6 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationVisibilitySample.java ; + */ + public PatchApplicationVisibilityResp patch(PatchApplicationVisibilityReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/application/v6/applications/:app_id/visibility" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchApplicationVisibilityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchApplicationVisibilityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/visibility" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=application&resource=application.visibility&version=v6 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationVisibilitySample.java ; + */ + public PatchApplicationVisibilityResp patch(PatchApplicationVisibilityReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/application/v6/applications/:app_id/visibility" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchApplicationVisibilityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchApplicationVisibilityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/applications/:app_id/visibility" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/Bot.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/Bot.java new file mode 100644 index 000000000..dad6d9fb7 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/resource/Bot.java @@ -0,0 +1,29 @@ +// Code generated by lark suite 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 com.lark.oapi.service.application.v6.resource; + +import com.lark.oapi.core.Config; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Bot { + private static final Logger log = LoggerFactory.getLogger(Bot.class); + private final Config config; + + public Bot(Config config) { + this.config = config; + } + + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/ApprovalService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/ApprovalService.java new file mode 100644 index 000000000..bf7b433b6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/ApprovalService.java @@ -0,0 +1,129 @@ +// Code generated by lark suite 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 com.lark.oapi.service.approval; + +import com.lark.oapi.core.Config; +import com.lark.oapi.event.IEventHandler; +import com.lark.oapi.service.approval.v4.V4; +import com.lark.oapi.service.approval.v4.model.*; +import com.lark.oapi.service.approval.v4.resource.Approval; +import com.lark.oapi.service.approval.v4.resource.ExternalApproval; +import com.lark.oapi.service.approval.v4.resource.ExternalInstance; +import com.lark.oapi.service.approval.v4.resource.Instance; +import com.lark.oapi.service.approval.v4.resource.InstanceComment; +import com.lark.oapi.service.approval.v4.resource.Task; +import com.lark.oapi.service.approval.v4.resource.*; + +public class ApprovalService { + private final V4 v4; + private final Approval approval; // 事件 + private final ExternalApproval externalApproval; // 三方审批定义 + private final ExternalInstance externalInstance; // 三方审批实例 + private final ExternalTask externalTask; // 三方审批任务 + private final Instance instance; // 审批查询 + private final InstanceComment instanceComment; // 原生审批评论 + private final Task task; // 原生审批任务 + + public ApprovalService(Config config) { + this.v4 = new V4(config); + this.approval = new Approval(config); + this.externalApproval = new ExternalApproval(config); + this.externalInstance = new ExternalInstance(config); + this.externalTask = new ExternalTask(config); + this.instance = new Instance(config); + this.instanceComment = new InstanceComment(config); + this.task = new Task(config); + } + + public V4 v4() { + return v4; + } + + public Approval approval() { + return approval; + } + + public ExternalApproval externalApproval() { + return externalApproval; + } + + public ExternalInstance externalInstance() { + return externalInstance; + } + + public ExternalTask externalTask() { + return externalTask; + } + + public Instance instance() { + return instance; + } + + public InstanceComment instanceComment() { + return instanceComment; + } + + public Task task() { + return task; + } + + public abstract static class P2ApprovalUpdatedV4Handler implements IEventHandler { + @Override + public P2ApprovalUpdatedV4 getEvent() { + return new P2ApprovalUpdatedV4(); + } + } + + public abstract static class P1LeaveApprovalV4Handler implements IEventHandler { + @Override + public P1LeaveApprovalV4 getEvent() { + return new P1LeaveApprovalV4(); + } + } + + public abstract static class P1WorkApprovalV4Handler implements IEventHandler { + @Override + public P1WorkApprovalV4 getEvent() { + return new P1WorkApprovalV4(); + } + } + + public abstract static class P1ShiftApprovalV4Handler implements IEventHandler { + @Override + public P1ShiftApprovalV4 getEvent() { + return new P1ShiftApprovalV4(); + } + } + + public abstract static class P1RemedyApprovalV4Handler implements IEventHandler { + @Override + public P1RemedyApprovalV4 getEvent() { + return new P1RemedyApprovalV4(); + } + } + + public abstract static class P1TripApprovalV4Handler implements IEventHandler { + @Override + public P1TripApprovalV4 getEvent() { + return new P1TripApprovalV4(); + } + } + + + public abstract static class P1OutApprovalV4Handler implements IEventHandler { + @Override + public P1OutApprovalV4 getEvent() { + return new P1OutApprovalV4(); + } + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/ApprovalService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/ApprovalService.java deleted file mode 100644 index 241aa0d74..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/ApprovalService.java +++ /dev/null @@ -1,2141 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.approval.v4; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.event.IEventHandler; -import com.lark.oapi.service.approval.v4.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class ApprovalService { - private static final Logger log = LoggerFactory.getLogger(ApprovalService.class); - private final Approval approval; // 事件 - private final ExternalApproval externalApproval; // 三方审批定义 - private final ExternalInstance externalInstance; // 三方审批实例 - private final ExternalTask externalTask; // 三方审批任务 - private final Instance instance; // 原生审批实例 - private final InstanceComment instanceComment; // 原生审批评论 - private final Task task; // 原生审批任务 - - public ApprovalService(Config config) { - this.approval = new Approval(config); - this.externalApproval = new ExternalApproval(config); - this.externalInstance = new ExternalInstance(config); - this.externalTask = new ExternalTask(config); - this.instance = new Instance(config); - this.instanceComment = new InstanceComment(config); - this.task = new Task(config); - } - - /** - * 事件 - * - * @return - */ - public Approval approval() { - return approval; - } - - /** - * 三方审批定义 - * - * @return - */ - public ExternalApproval externalApproval() { - return externalApproval; - } - - /** - * 三方审批实例 - * - * @return - */ - public ExternalInstance externalInstance() { - return externalInstance; - } - - /** - * 三方审批任务 - * - * @return - */ - public ExternalTask externalTask() { - return externalTask; - } - - /** - * 原生审批实例 - * - * @return - */ - public Instance instance() { - return instance; - } - - /** - * 原生审批评论 - * - * @return - */ - public InstanceComment instanceComment() { - return instanceComment; - } - - /** - * 原生审批任务 - * - * @return - */ - public Task task() { - return task; - } - - public static class Approval { - private final Config config; - - public Approval(Config config) { - this.config = config; - } - - /** - * 创建审批定义,用于通过接口创建简单的审批定义,可以灵活指定定义的基础信息、表单和流程等。创建成功后,不支持从审批管理后台删除该定义。不推荐企业自建应用使用,如有需要尽量联系管理员在审批管理后台创建定义。 - *

接口谨慎调用,创建后的审批定义无法停用/删除 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateApprovalSample.java ; - */ - public CreateApprovalResp create(CreateApprovalReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/approvals" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateApprovalResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/approvals" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建审批定义,用于通过接口创建简单的审批定义,可以灵活指定定义的基础信息、表单和流程等。创建成功后,不支持从审批管理后台删除该定义。不推荐企业自建应用使用,如有需要尽量联系管理员在审批管理后台创建定义。 - *

接口谨慎调用,创建后的审批定义无法停用/删除 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateApprovalSample.java ; - */ - public CreateApprovalResp create(CreateApprovalReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/approvals" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateApprovalResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/approvals" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查看审批定义,根据 Approval Code 获取某个审批定义的详情,用于构造创建审批实例的请求。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/GetApprovalSample.java ; - */ - public GetApprovalResp get(GetApprovalReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/approval/v4/approvals/:approval_code" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetApprovalResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/approvals/:approval_code" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查看审批定义,根据 Approval Code 获取某个审批定义的详情,用于构造创建审批实例的请求。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/GetApprovalSample.java ; - */ - public GetApprovalResp get(GetApprovalReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/approval/v4/approvals/:approval_code" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetApprovalResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/approvals/:approval_code" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 订阅审批事件,应用订阅 approval_code 后,该应用就可以收到该审批定义对应实例的事件通知。同一应用只需要订阅一次,无需重复订阅。;;当应用不希望再收到审批事件时,可以使用取消订阅接口进行取消,取消后将不再给应用推送消息。;;订阅和取消订阅都是应用维度的,多个应用可以同时订阅同一个 approval_code,每个应用都能收到审批事件。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/subscribe ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SubscribeApprovalSample.java ; - */ - public SubscribeApprovalResp subscribe(SubscribeApprovalReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/approvals/:approval_code/subscribe" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SubscribeApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscribeApprovalResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/approvals/:approval_code/subscribe" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 订阅审批事件,应用订阅 approval_code 后,该应用就可以收到该审批定义对应实例的事件通知。同一应用只需要订阅一次,无需重复订阅。;;当应用不希望再收到审批事件时,可以使用取消订阅接口进行取消,取消后将不再给应用推送消息。;;订阅和取消订阅都是应用维度的,多个应用可以同时订阅同一个 approval_code,每个应用都能收到审批事件。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/subscribe ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SubscribeApprovalSample.java ; - */ - public SubscribeApprovalResp subscribe(SubscribeApprovalReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/approvals/:approval_code/subscribe" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SubscribeApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscribeApprovalResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/approvals/:approval_code/subscribe" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 取消订阅审批事件,取消订阅 approval_code 后,无法再收到该审批定义对应实例的事件通知 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/unsubscribe ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/UnsubscribeApprovalSample.java ; - */ - public UnsubscribeApprovalResp unsubscribe(UnsubscribeApprovalReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/approvals/:approval_code/unsubscribe" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UnsubscribeApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnsubscribeApprovalResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/approvals/:approval_code/unsubscribe" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 取消订阅审批事件,取消订阅 approval_code 后,无法再收到该审批定义对应实例的事件通知 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/unsubscribe ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/UnsubscribeApprovalSample.java ; - */ - public UnsubscribeApprovalResp unsubscribe(UnsubscribeApprovalReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/approvals/:approval_code/unsubscribe" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UnsubscribeApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnsubscribeApprovalResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/approvals/:approval_code/unsubscribe" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ExternalApproval { - private final Config config; - - public ExternalApproval(Config config) { - this.config = config; - } - - /** - * 三方审批定义创建,审批定义是审批的描述,包括审批名称、图标、描述等基础信息。创建好审批定义,用户就可以在审批应用的发起页中看到审批,如果用户点击发起,则会跳转到配置的发起三方系统地址去发起审批。;;另外,审批定义还配置了审批操作时的回调地址:审批人在待审批列表中进行【同意】【拒绝】操作时,审批中心会调用回调地址通知三方系统。 - *

注意,审批中心不负责审批流程的流转,只负责展示、操作、消息通知。因此审批定义创建时没有审批流程的信息。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/external_approval/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateExternalApprovalSample.java ; - */ - public CreateExternalApprovalResp create(CreateExternalApprovalReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/external_approvals" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateExternalApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExternalApprovalResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/external_approvals" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 三方审批定义创建,审批定义是审批的描述,包括审批名称、图标、描述等基础信息。创建好审批定义,用户就可以在审批应用的发起页中看到审批,如果用户点击发起,则会跳转到配置的发起三方系统地址去发起审批。;;另外,审批定义还配置了审批操作时的回调地址:审批人在待审批列表中进行【同意】【拒绝】操作时,审批中心会调用回调地址通知三方系统。 - *

注意,审批中心不负责审批流程的流转,只负责展示、操作、消息通知。因此审批定义创建时没有审批流程的信息。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/external_approval/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateExternalApprovalSample.java ; - */ - public CreateExternalApprovalResp create(CreateExternalApprovalReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/external_approvals" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateExternalApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExternalApprovalResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/external_approvals" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=approval&resource=external_approval&version=v4 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/GetExternalApprovalSample.java ; - */ - public GetExternalApprovalResp get(GetExternalApprovalReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/approval/v4/external_approvals/:approval_code" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetExternalApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetExternalApprovalResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/external_approvals/:approval_code" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=approval&resource=external_approval&version=v4 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/GetExternalApprovalSample.java ; - */ - public GetExternalApprovalResp get(GetExternalApprovalReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/approval/v4/external_approvals/:approval_code" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetExternalApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetExternalApprovalResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/external_approvals/:approval_code" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ExternalInstance { - private final Config config; - - public ExternalInstance(Config config) { - this.config = config; - } - - /** - * 三方审批实例校验,校验三方审批实例数据,用于判断服务端数据是否为最新的。用户提交实例最新更新时间,如果服务端不存在该实例,或者服务端实例更新时间不是最新的,则返回对应实例 id。;;例如,用户可以每隔5分钟,将最近5分钟产生的实例使用该接口进行对比。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/external_instance/check ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CheckExternalInstanceSample.java ; - */ - public CheckExternalInstanceResp check(CheckExternalInstanceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/external_instances/check" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CheckExternalInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CheckExternalInstanceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/external_instances/check" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 三方审批实例校验,校验三方审批实例数据,用于判断服务端数据是否为最新的。用户提交实例最新更新时间,如果服务端不存在该实例,或者服务端实例更新时间不是最新的,则返回对应实例 id。;;例如,用户可以每隔5分钟,将最近5分钟产生的实例使用该接口进行对比。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/external_instance/check ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CheckExternalInstanceSample.java ; - */ - public CheckExternalInstanceResp check(CheckExternalInstanceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/external_instances/check" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CheckExternalInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CheckExternalInstanceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/external_instances/check" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 三方审批实例同步,审批中心不负责审批的流转,审批的流转在三方系统,三方系统在审批流转后生成的审批实例、审批任务、审批抄送数据同步到审批中心。;;用户可以在审批中心中浏览三方系统同步过来的实例、任务、抄送信息,并且可以跳转回三方系统进行更详细的查看和操作,其中实例信息在【已发起】列表,任务信息在【待审批】和【已审批】列表,抄送信息在【抄送我】列表;;:::html;;;;;;;;:::;;对于审批任务,三方系统也可以配置审批任务的回调接口,这样审批人可以在审批中心中直接进行审批操作,审批中心会回调三方系统,三方系统收到回调后更新任务信息,并将新的任务信息同步回审批中心,形成闭环。;;:::html;;:::;
- *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/external_instance/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateExternalInstanceSample.java ; - */ - public CreateExternalInstanceResp create(CreateExternalInstanceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/external_instances" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateExternalInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExternalInstanceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/external_instances" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 三方审批实例同步,审批中心不负责审批的流转,审批的流转在三方系统,三方系统在审批流转后生成的审批实例、审批任务、审批抄送数据同步到审批中心。;;用户可以在审批中心中浏览三方系统同步过来的实例、任务、抄送信息,并且可以跳转回三方系统进行更详细的查看和操作,其中实例信息在【已发起】列表,任务信息在【待审批】和【已审批】列表,抄送信息在【抄送我】列表;;:::html;;;;;;;;:::;;对于审批任务,三方系统也可以配置审批任务的回调接口,这样审批人可以在审批中心中直接进行审批操作,审批中心会回调三方系统,三方系统收到回调后更新任务信息,并将新的任务信息同步回审批中心,形成闭环。;;:::html;;:::;
- *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/external_instance/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateExternalInstanceSample.java ; - */ - public CreateExternalInstanceResp create(CreateExternalInstanceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/external_instances" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateExternalInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExternalInstanceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/external_instances" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ExternalTask { - private final Config config; - - public ExternalTask(Config config) { - this.config = config; - } - - /** - * 获取三方审批任务状态,该接口用于获取三方审批的状态。用户传入查询条件,接口返回满足条件的审批实例的状态。该接口支持多种参数的组合,包括如下组合:;;1.通过 instance_ids 获取指定实例的任务状态;;2.通过 user_ids 获取指定用户的任务状态;;3.通过 status 获取指定状态的所有任务;;4.通过page_token获取下一批数据 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/external_task/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ListExternalTaskSample.java ; - */ - public ListExternalTaskResp list(ListExternalTaskReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/approval/v4/external_tasks" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListExternalTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListExternalTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/external_tasks" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取三方审批任务状态,该接口用于获取三方审批的状态。用户传入查询条件,接口返回满足条件的审批实例的状态。该接口支持多种参数的组合,包括如下组合:;;1.通过 instance_ids 获取指定实例的任务状态;;2.通过 user_ids 获取指定用户的任务状态;;3.通过 status 获取指定状态的所有任务;;4.通过page_token获取下一批数据 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/external_task/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ListExternalTaskSample.java ; - */ - public ListExternalTaskResp list(ListExternalTaskReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/approval/v4/external_tasks" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListExternalTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListExternalTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/external_tasks" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Instance { - private final Config config; - - public Instance(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/ukTM5UjL5ETO14SOxkTN/approval-task-addsign ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/AddSignInstanceSample.java ; - */ - public AddSignInstanceResp addSign(AddSignInstanceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/instances/add_sign" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - AddSignInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddSignInstanceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/add_sign" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/ukTM5UjL5ETO14SOxkTN/approval-task-addsign ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/AddSignInstanceSample.java ; - */ - public AddSignInstanceResp addSign(AddSignInstanceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/instances/add_sign" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - AddSignInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddSignInstanceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/add_sign" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 审批实例撤回,对于状态为“审批中”的单个审批实例进行撤销操作,撤销后审批流程结束 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/cancel ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CancelInstanceSample.java ; - */ - public CancelInstanceResp cancel(CancelInstanceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/instances/cancel" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CancelInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CancelInstanceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/cancel" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 审批实例撤回,对于状态为“审批中”的单个审批实例进行撤销操作,撤销后审批流程结束 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/cancel ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CancelInstanceSample.java ; - */ - public CancelInstanceResp cancel(CancelInstanceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/instances/cancel" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CancelInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CancelInstanceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/cancel" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 审批实例抄送,通过接口可以将当前审批实例抄送给其他人。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/cc ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CcInstanceSample.java ; - */ - public CcInstanceResp cc(CcInstanceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/instances/cc" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CcInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CcInstanceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/cc" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 审批实例抄送,通过接口可以将当前审批实例抄送给其他人。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/cc ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CcInstanceSample.java ; - */ - public CcInstanceResp cc(CcInstanceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/instances/cc" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CcInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CcInstanceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/cc" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建审批实例,创建一个审批实例,调用方需对审批定义的表单有详细了解,将按照定义的表单结构,将表单 Value 通过接口传入 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateInstanceSample.java ; - */ - public CreateInstanceResp create(CreateInstanceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/instances" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateInstanceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建审批实例,创建一个审批实例,调用方需对审批定义的表单有详细了解,将按照定义的表单结构,将表单 Value 通过接口传入 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateInstanceSample.java ; - */ - public CreateInstanceResp create(CreateInstanceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/instances" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateInstanceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取单个审批实例详情,通过审批实例 Instance Code 获取审批实例详情。Instance Code 由 [批量获取审批实例](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/list) 接口获取。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/GetInstanceSample.java ; - */ - public GetInstanceResp get(GetInstanceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/approval/v4/instances/:instance_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetInstanceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/:instance_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取单个审批实例详情,通过审批实例 Instance Code 获取审批实例详情。Instance Code 由 [批量获取审批实例](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/list) 接口获取。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/GetInstanceSample.java ; - */ - public GetInstanceResp get(GetInstanceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/approval/v4/instances/:instance_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetInstanceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/:instance_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量获取审批实例ID,根据 approval_code 批量获取审批实例的 instance_code,用于拉取租户下某个审批定义的全部审批实例。默认以审批创建时间先后顺序排列 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ListInstanceSample.java ; - */ - public ListInstanceResp list(ListInstanceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/approval/v4/instances" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListInstanceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量获取审批实例ID,根据 approval_code 批量获取审批实例的 instance_code,用于拉取租户下某个审批定义的全部审批实例。默认以审批创建时间先后顺序排列 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ListInstanceSample.java ; - */ - public ListInstanceResp list(ListInstanceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/approval/v4/instances" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListInstanceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/ukTM5UjL5ETO14SOxkTN/approval-preview ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/PreviewInstanceSample.java ; - */ - public PreviewInstanceResp preview(PreviewInstanceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/instances/preview" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PreviewInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PreviewInstanceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/preview" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/ukTM5UjL5ETO14SOxkTN/approval-preview ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/PreviewInstanceSample.java ; - */ - public PreviewInstanceResp preview(PreviewInstanceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/instances/preview" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PreviewInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PreviewInstanceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/preview" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询实例列表,该接口通过不同条件查询审批系统中符合条件的审批实例列表。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/QueryInstanceSample.java ; - */ - public QueryInstanceResp query(QueryInstanceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/instances/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryInstanceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询实例列表,该接口通过不同条件查询审批系统中符合条件的审批实例列表。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/QueryInstanceSample.java ; - */ - public QueryInstanceResp query(QueryInstanceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/instances/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryInstanceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询抄送列表,该接口通过不同条件查询审批系统中符合条件的审批抄送列表。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/search_cc ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SearchCcInstanceSample.java ; - */ - public SearchCcInstanceResp searchCc(SearchCcInstanceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/instances/search_cc" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SearchCcInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchCcInstanceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/search_cc" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询抄送列表,该接口通过不同条件查询审批系统中符合条件的审批抄送列表。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/search_cc ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SearchCcInstanceSample.java ; - */ - public SearchCcInstanceResp searchCc(SearchCcInstanceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/instances/search_cc" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SearchCcInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchCcInstanceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/search_cc" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 审批任务退回,从当前审批任务,退回到已审批的一个或多个任务节点。退回后,已审批节点重新生成审批任务 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/specified_rollback ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SpecifiedRollbackInstanceSample.java ; - */ - public SpecifiedRollbackInstanceResp specifiedRollback(SpecifiedRollbackInstanceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/instances/specified_rollback" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SpecifiedRollbackInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SpecifiedRollbackInstanceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/specified_rollback" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 审批任务退回,从当前审批任务,退回到已审批的一个或多个任务节点。退回后,已审批节点重新生成审批任务 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/specified_rollback ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SpecifiedRollbackInstanceSample.java ; - */ - public SpecifiedRollbackInstanceResp specifiedRollback(SpecifiedRollbackInstanceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/instances/specified_rollback" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SpecifiedRollbackInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SpecifiedRollbackInstanceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/specified_rollback" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class InstanceComment { - private final Config config; - - public InstanceComment(Config config) { - this.config = config; - } - - /** - * 创建评论,在某审批实例下创建、修改评论或评论回复(不包含审批同意、拒绝、转交等附加的理由或意见)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance-comment/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateInstanceCommentSample.java ; - */ - public CreateInstanceCommentResp create(CreateInstanceCommentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/instances/:instance_id/comments" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateInstanceCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateInstanceCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/:instance_id/comments" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建评论,在某审批实例下创建、修改评论或评论回复(不包含审批同意、拒绝、转交等附加的理由或意见)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance-comment/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateInstanceCommentSample.java ; - */ - public CreateInstanceCommentResp create(CreateInstanceCommentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/instances/:instance_id/comments" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateInstanceCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateInstanceCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/:instance_id/comments" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除评论,逻辑删除某审批实例下的一条评论或评论回复(不包含审批同意、拒绝、转交等附加的理由或意见)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance-comment/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/DeleteInstanceCommentSample.java ; - */ - public DeleteInstanceCommentResp delete(DeleteInstanceCommentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/approval/v4/instances/:instance_id/comments/:comment_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteInstanceCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteInstanceCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/:instance_id/comments/:comment_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除评论,逻辑删除某审批实例下的一条评论或评论回复(不包含审批同意、拒绝、转交等附加的理由或意见)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance-comment/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/DeleteInstanceCommentSample.java ; - */ - public DeleteInstanceCommentResp delete(DeleteInstanceCommentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/approval/v4/instances/:instance_id/comments/:comment_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteInstanceCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteInstanceCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/:instance_id/comments/:comment_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取评论,根据 Instance Code 获取某个审批实例下的全部评论与评论回复(不包含审批同意、拒绝、转交等附加的理由或意见)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance-comment/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ListInstanceCommentSample.java ; - */ - public ListInstanceCommentResp list(ListInstanceCommentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/approval/v4/instances/:instance_id/comments" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListInstanceCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListInstanceCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/:instance_id/comments" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取评论,根据 Instance Code 获取某个审批实例下的全部评论与评论回复(不包含审批同意、拒绝、转交等附加的理由或意见)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance-comment/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ListInstanceCommentSample.java ; - */ - public ListInstanceCommentResp list(ListInstanceCommentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/approval/v4/instances/:instance_id/comments" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListInstanceCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListInstanceCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/:instance_id/comments" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 清空评论,删除某审批实例下的全部评论与评论回复。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance-comment/remove ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/RemoveInstanceCommentSample.java ; - */ - public RemoveInstanceCommentResp remove(RemoveInstanceCommentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/instances/:instance_id/comments/remove" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RemoveInstanceCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RemoveInstanceCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/:instance_id/comments/remove" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 清空评论,删除某审批实例下的全部评论与评论回复。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance-comment/remove ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/RemoveInstanceCommentSample.java ; - */ - public RemoveInstanceCommentResp remove(RemoveInstanceCommentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/instances/:instance_id/comments/remove" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RemoveInstanceCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RemoveInstanceCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/:instance_id/comments/remove" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Task { - private final Config config; - - public Task(Config config) { - this.config = config; - } - - /** - * 审批任务同意,对于单个审批任务进行同意操作。同意后审批流程会流转到下一个审批人。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/approve ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ApproveTaskSample.java ; - */ - public ApproveTaskResp approve(ApproveTaskReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/tasks/approve" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ApproveTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ApproveTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/tasks/approve" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 审批任务同意,对于单个审批任务进行同意操作。同意后审批流程会流转到下一个审批人。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/approve ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ApproveTaskSample.java ; - */ - public ApproveTaskResp approve(ApproveTaskReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/tasks/approve" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ApproveTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ApproveTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/tasks/approve" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 用户角度列出任务,根据用户和任务分组查询任务列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/QueryTaskSample.java ; - */ - public QueryTaskResp query(QueryTaskReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/approval/v4/tasks/query" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - QueryTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/tasks/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 用户角度列出任务,根据用户和任务分组查询任务列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/QueryTaskSample.java ; - */ - public QueryTaskResp query(QueryTaskReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/approval/v4/tasks/query" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - QueryTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/tasks/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 审批任务拒绝,对于单个审批任务进行拒绝操作。拒绝后审批流程结束。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/reject ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/RejectTaskSample.java ; - */ - public RejectTaskResp reject(RejectTaskReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/tasks/reject" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RejectTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RejectTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/tasks/reject" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 审批任务拒绝,对于单个审批任务进行拒绝操作。拒绝后审批流程结束。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/reject ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/RejectTaskSample.java ; - */ - public RejectTaskResp reject(RejectTaskReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/tasks/reject" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RejectTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RejectTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/tasks/reject" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 审批任务重新提交,对于单个退回到发起人的审批任务进行重新发起操作。发起后审批流程会流转到下一个审批人。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/resubmit ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ResubmitTaskSample.java ; - */ - public ResubmitTaskResp resubmit(ResubmitTaskReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/tasks/resubmit" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ResubmitTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ResubmitTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/tasks/resubmit" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 审批任务重新提交,对于单个退回到发起人的审批任务进行重新发起操作。发起后审批流程会流转到下一个审批人。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/resubmit ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ResubmitTaskSample.java ; - */ - public ResubmitTaskResp resubmit(ResubmitTaskReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/tasks/resubmit" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ResubmitTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ResubmitTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/tasks/resubmit" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询任务列表,该接口通过不同条件查询审批系统中符合条件的审批任务列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/search ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SearchTaskSample.java ; - */ - public SearchTaskResp search(SearchTaskReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/tasks/search" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SearchTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/tasks/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询任务列表,该接口通过不同条件查询审批系统中符合条件的审批任务列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/search ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SearchTaskSample.java ; - */ - public SearchTaskResp search(SearchTaskReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/tasks/search" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SearchTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/tasks/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 审批任务转交,对于单个审批任务进行转交操作。转交后审批流程流转给被转交人。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/transfer ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/TransferTaskSample.java ; - */ - public TransferTaskResp transfer(TransferTaskReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/tasks/transfer" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - TransferTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TransferTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/tasks/transfer" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 审批任务转交,对于单个审批任务进行转交操作。转交后审批流程流转给被转交人。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/transfer ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/TransferTaskSample.java ; - */ - public TransferTaskResp transfer(TransferTaskReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/approval/v4/tasks/transfer" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - TransferTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TransferTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/tasks/transfer" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public abstract static class P2ApprovalUpdatedV4Handler implements IEventHandler { - @Override - public P2ApprovalUpdatedV4 getEvent() { - return new P2ApprovalUpdatedV4(); - } - } - - public abstract static class P1LeaveApprovalV4Handler implements - IEventHandler { - - @Override - public P1LeaveApprovalV4 getEvent() { - return new P1LeaveApprovalV4(); - } - } - - public abstract static class P1WorkApprovalV4Handler implements IEventHandler { - - @Override - public P1WorkApprovalV4 getEvent() { - return new P1WorkApprovalV4(); - } - } - - public abstract static class P1ShiftApprovalV4Handler implements IEventHandler { - - @Override - public P1ShiftApprovalV4 getEvent() { - return new P1ShiftApprovalV4(); - } - } - - public abstract static class P1RemedyApprovalV4Handler implements IEventHandler { - @Override - public P1RemedyApprovalV4 getEvent() { - return new P1RemedyApprovalV4(); - } - } - - public abstract static class P1TripApprovalV4Handler implements IEventHandler { - @Override - public P1TripApprovalV4 getEvent() { - return new P1TripApprovalV4(); - } - } - - - public abstract static class P1OutApprovalV4Handler implements IEventHandler { - @Override - public P1OutApprovalV4 getEvent() { - return new P1OutApprovalV4(); - } - } -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/V4.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/V4.java new file mode 100644 index 000000000..659f63e7c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/V4.java @@ -0,0 +1,65 @@ +// Code generated by lark suite 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 com.lark.oapi.service.approval.v4; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.approval.v4.resource.*; + +public class V4 { + private final Approval approval; // 事件 + private final ExternalApproval externalApproval; // 三方审批定义 + private final ExternalInstance externalInstance; // 三方审批实例 + private final ExternalTask externalTask; // 三方审批任务 + private final Instance instance; // 审批查询 + private final InstanceComment instanceComment; // 原生审批评论 + private final Task task; // 原生审批任务 + + public V4(Config config) { + this.approval = new Approval(config); + this.externalApproval = new ExternalApproval(config); + this.externalInstance = new ExternalInstance(config); + this.externalTask = new ExternalTask(config); + this.instance = new Instance(config); + this.instanceComment = new InstanceComment(config); + this.task = new Task(config); + } + + public Approval approval() { + return approval; + } + + public ExternalApproval externalApproval() { + return externalApproval; + } + + public ExternalInstance externalInstance() { + return externalInstance; + } + + public ExternalTask externalTask() { + return externalTask; + } + + public Instance instance() { + return instance; + } + + public InstanceComment instanceComment() { + return instanceComment; + } + + public Task task() { + return task; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/Approval.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/Approval.java new file mode 100644 index 000000000..837fa33d4 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/Approval.java @@ -0,0 +1,304 @@ +// Code generated by lark suite 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 com.lark.oapi.service.approval.v4.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.approval.v4.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Approval { + private static final Logger log = LoggerFactory.getLogger(Approval.class); + private final Config config; + + public Approval(Config config) { + this.config = config; + } + + + /** + * 创建审批定义,用于通过接口创建简单的审批定义,可以灵活指定定义的基础信息、表单和流程等。创建成功后,不支持从审批管理后台删除该定义。不推荐企业自建应用使用,如有需要尽量联系管理员在审批管理后台创建定义。 + *

接口谨慎调用,创建后的审批定义无法停用/删除 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateApprovalSample.java ; + */ + public CreateApprovalResp create(CreateApprovalReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/approvals" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateApprovalResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/approvals" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建审批定义,用于通过接口创建简单的审批定义,可以灵活指定定义的基础信息、表单和流程等。创建成功后,不支持从审批管理后台删除该定义。不推荐企业自建应用使用,如有需要尽量联系管理员在审批管理后台创建定义。 + *

接口谨慎调用,创建后的审批定义无法停用/删除 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateApprovalSample.java ; + */ + public CreateApprovalResp create(CreateApprovalReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/approvals" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateApprovalResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/approvals" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查看审批定义,根据 Approval Code 获取某个审批定义的详情,用于构造创建审批实例的请求。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/GetApprovalSample.java ; + */ + public GetApprovalResp get(GetApprovalReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/approval/v4/approvals/:approval_code" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetApprovalResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/approvals/:approval_code" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查看审批定义,根据 Approval Code 获取某个审批定义的详情,用于构造创建审批实例的请求。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/GetApprovalSample.java ; + */ + public GetApprovalResp get(GetApprovalReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/approval/v4/approvals/:approval_code" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetApprovalResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/approvals/:approval_code" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 订阅审批事件,应用订阅 approval_code 后,该应用就可以收到该审批定义对应实例的事件通知。同一应用只需要订阅一次,无需重复订阅。;;当应用不希望再收到审批事件时,可以使用取消订阅接口进行取消,取消后将不再给应用推送消息。;;订阅和取消订阅都是应用维度的,多个应用可以同时订阅同一个 approval_code,每个应用都能收到审批事件。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/subscribe ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SubscribeApprovalSample.java ; + */ + public SubscribeApprovalResp subscribe(SubscribeApprovalReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/approvals/:approval_code/subscribe" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SubscribeApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscribeApprovalResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/approvals/:approval_code/subscribe" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 订阅审批事件,应用订阅 approval_code 后,该应用就可以收到该审批定义对应实例的事件通知。同一应用只需要订阅一次,无需重复订阅。;;当应用不希望再收到审批事件时,可以使用取消订阅接口进行取消,取消后将不再给应用推送消息。;;订阅和取消订阅都是应用维度的,多个应用可以同时订阅同一个 approval_code,每个应用都能收到审批事件。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/subscribe ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SubscribeApprovalSample.java ; + */ + public SubscribeApprovalResp subscribe(SubscribeApprovalReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/approvals/:approval_code/subscribe" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SubscribeApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscribeApprovalResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/approvals/:approval_code/subscribe" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 取消订阅审批事件,取消订阅 approval_code 后,无法再收到该审批定义对应实例的事件通知 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/unsubscribe ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/UnsubscribeApprovalSample.java ; + */ + public UnsubscribeApprovalResp unsubscribe(UnsubscribeApprovalReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/approvals/:approval_code/unsubscribe" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UnsubscribeApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnsubscribeApprovalResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/approvals/:approval_code/unsubscribe" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 取消订阅审批事件,取消订阅 approval_code 后,无法再收到该审批定义对应实例的事件通知 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/unsubscribe ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/UnsubscribeApprovalSample.java ; + */ + public UnsubscribeApprovalResp unsubscribe(UnsubscribeApprovalReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/approvals/:approval_code/unsubscribe" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UnsubscribeApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnsubscribeApprovalResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/approvals/:approval_code/unsubscribe" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/ExternalApproval.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/ExternalApproval.java new file mode 100644 index 000000000..ca0bdec63 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/ExternalApproval.java @@ -0,0 +1,175 @@ +// Code generated by lark suite 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 com.lark.oapi.service.approval.v4.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.approval.v4.model.CreateExternalApprovalReq; +import com.lark.oapi.service.approval.v4.model.CreateExternalApprovalResp; +import com.lark.oapi.service.approval.v4.model.GetExternalApprovalReq; +import com.lark.oapi.service.approval.v4.model.GetExternalApprovalResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ExternalApproval { + private static final Logger log = LoggerFactory.getLogger(ExternalApproval.class); + private final Config config; + + public ExternalApproval(Config config) { + this.config = config; + } + + + /** + * 三方审批定义创建,审批定义是审批的描述,包括审批名称、图标、描述等基础信息。创建好审批定义,用户就可以在审批应用的发起页中看到审批,如果用户点击发起,则会跳转到配置的发起三方系统地址去发起审批。;;另外,审批定义还配置了审批操作时的回调地址:审批人在待审批列表中进行【同意】【拒绝】操作时,审批中心会调用回调地址通知三方系统。 + *

注意,审批中心不负责审批流程的流转,只负责展示、操作、消息通知。因此审批定义创建时没有审批流程的信息。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/external_approval/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateExternalApprovalSample.java ; + */ + public CreateExternalApprovalResp create(CreateExternalApprovalReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/external_approvals" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateExternalApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExternalApprovalResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/external_approvals" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 三方审批定义创建,审批定义是审批的描述,包括审批名称、图标、描述等基础信息。创建好审批定义,用户就可以在审批应用的发起页中看到审批,如果用户点击发起,则会跳转到配置的发起三方系统地址去发起审批。;;另外,审批定义还配置了审批操作时的回调地址:审批人在待审批列表中进行【同意】【拒绝】操作时,审批中心会调用回调地址通知三方系统。 + *

注意,审批中心不负责审批流程的流转,只负责展示、操作、消息通知。因此审批定义创建时没有审批流程的信息。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/external_approval/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateExternalApprovalSample.java ; + */ + public CreateExternalApprovalResp create(CreateExternalApprovalReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/external_approvals" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateExternalApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExternalApprovalResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/external_approvals" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=approval&resource=external_approval&version=v4 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/GetExternalApprovalSample.java ; + */ + public GetExternalApprovalResp get(GetExternalApprovalReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/approval/v4/external_approvals/:approval_code" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetExternalApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetExternalApprovalResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/external_approvals/:approval_code" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=approval&resource=external_approval&version=v4 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/GetExternalApprovalSample.java ; + */ + public GetExternalApprovalResp get(GetExternalApprovalReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/approval/v4/external_approvals/:approval_code" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetExternalApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetExternalApprovalResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/external_approvals/:approval_code" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/ExternalInstance.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/ExternalInstance.java new file mode 100644 index 000000000..0b26a3955 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/ExternalInstance.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.approval.v4.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.approval.v4.model.CheckExternalInstanceReq; +import com.lark.oapi.service.approval.v4.model.CheckExternalInstanceResp; +import com.lark.oapi.service.approval.v4.model.CreateExternalInstanceReq; +import com.lark.oapi.service.approval.v4.model.CreateExternalInstanceResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ExternalInstance { + private static final Logger log = LoggerFactory.getLogger(ExternalInstance.class); + private final Config config; + + public ExternalInstance(Config config) { + this.config = config; + } + + + /** + * 三方审批实例校验,校验三方审批实例数据,用于判断服务端数据是否为最新的。用户提交实例最新更新时间,如果服务端不存在该实例,或者服务端实例更新时间不是最新的,则返回对应实例 id。;;例如,用户可以每隔5分钟,将最近5分钟产生的实例使用该接口进行对比。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/external_instance/check ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CheckExternalInstanceSample.java ; + */ + public CheckExternalInstanceResp check(CheckExternalInstanceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/external_instances/check" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CheckExternalInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CheckExternalInstanceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/external_instances/check" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 三方审批实例校验,校验三方审批实例数据,用于判断服务端数据是否为最新的。用户提交实例最新更新时间,如果服务端不存在该实例,或者服务端实例更新时间不是最新的,则返回对应实例 id。;;例如,用户可以每隔5分钟,将最近5分钟产生的实例使用该接口进行对比。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/external_instance/check ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CheckExternalInstanceSample.java ; + */ + public CheckExternalInstanceResp check(CheckExternalInstanceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/external_instances/check" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CheckExternalInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CheckExternalInstanceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/external_instances/check" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 三方审批实例同步,审批中心不负责审批的流转,审批的流转在三方系统,三方系统在审批流转后生成的审批实例、审批任务、审批抄送数据同步到审批中心。;;用户可以在审批中心中浏览三方系统同步过来的实例、任务、抄送信息,并且可以跳转回三方系统进行更详细的查看和操作,其中实例信息在【已发起】列表,任务信息在【待审批】和【已审批】列表,抄送信息在【抄送我】列表;;:::html;;;;;;;;:::;;对于审批任务,三方系统也可以配置审批任务的回调接口,这样审批人可以在审批中心中直接进行审批操作,审批中心会回调三方系统,三方系统收到回调后更新任务信息,并将新的任务信息同步回审批中心,形成闭环。;;:::html;;:::;
+ *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/external_instance/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateExternalInstanceSample.java ; + */ + public CreateExternalInstanceResp create(CreateExternalInstanceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/external_instances" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateExternalInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExternalInstanceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/external_instances" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 三方审批实例同步,审批中心不负责审批的流转,审批的流转在三方系统,三方系统在审批流转后生成的审批实例、审批任务、审批抄送数据同步到审批中心。;;用户可以在审批中心中浏览三方系统同步过来的实例、任务、抄送信息,并且可以跳转回三方系统进行更详细的查看和操作,其中实例信息在【已发起】列表,任务信息在【待审批】和【已审批】列表,抄送信息在【抄送我】列表;;:::html;;;;;;;;:::;;对于审批任务,三方系统也可以配置审批任务的回调接口,这样审批人可以在审批中心中直接进行审批操作,审批中心会回调三方系统,三方系统收到回调后更新任务信息,并将新的任务信息同步回审批中心,形成闭环。;;:::html;;:::;
+ *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/external_instance/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateExternalInstanceSample.java ; + */ + public CreateExternalInstanceResp create(CreateExternalInstanceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/external_instances" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateExternalInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExternalInstanceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/external_instances" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/ExternalTask.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/ExternalTask.java new file mode 100644 index 000000000..99adea1d1 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/ExternalTask.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.approval.v4.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.approval.v4.model.ListExternalTaskReq; +import com.lark.oapi.service.approval.v4.model.ListExternalTaskResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ExternalTask { + private static final Logger log = LoggerFactory.getLogger(ExternalTask.class); + private final Config config; + + public ExternalTask(Config config) { + this.config = config; + } + + + /** + * 获取三方审批任务状态,该接口用于获取三方审批的状态。用户传入查询条件,接口返回满足条件的审批实例的状态。该接口支持多种参数的组合,包括如下组合:;;1.通过 instance_ids 获取指定实例的任务状态;;2.通过 user_ids 获取指定用户的任务状态;;3.通过 status 获取指定状态的所有任务;;4.通过page_token获取下一批数据 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/external_task/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ListExternalTaskSample.java ; + */ + public ListExternalTaskResp list(ListExternalTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/approval/v4/external_tasks" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListExternalTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListExternalTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/external_tasks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取三方审批任务状态,该接口用于获取三方审批的状态。用户传入查询条件,接口返回满足条件的审批实例的状态。该接口支持多种参数的组合,包括如下组合:;;1.通过 instance_ids 获取指定实例的任务状态;;2.通过 user_ids 获取指定用户的任务状态;;3.通过 status 获取指定状态的所有任务;;4.通过page_token获取下一批数据 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/external_task/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ListExternalTaskSample.java ; + */ + public ListExternalTaskResp list(ListExternalTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/approval/v4/external_tasks" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListExternalTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListExternalTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/external_tasks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/Instance.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/Instance.java new file mode 100644 index 000000000..6bbbdf17f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/Instance.java @@ -0,0 +1,698 @@ +// Code generated by lark suite 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 com.lark.oapi.service.approval.v4.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.approval.v4.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Instance { + private static final Logger log = LoggerFactory.getLogger(Instance.class); + private final Config config; + + public Instance(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/ukTM5UjL5ETO14SOxkTN/approval-task-addsign ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/AddSignInstanceSample.java ; + */ + public AddSignInstanceResp addSign(AddSignInstanceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/instances/add_sign" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + AddSignInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddSignInstanceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/add_sign" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/ukTM5UjL5ETO14SOxkTN/approval-task-addsign ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/AddSignInstanceSample.java ; + */ + public AddSignInstanceResp addSign(AddSignInstanceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/instances/add_sign" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + AddSignInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddSignInstanceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/add_sign" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 审批实例撤回,对于状态为“审批中”的单个审批实例进行撤销操作,撤销后审批流程结束 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/cancel ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CancelInstanceSample.java ; + */ + public CancelInstanceResp cancel(CancelInstanceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/instances/cancel" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CancelInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CancelInstanceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/cancel" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 审批实例撤回,对于状态为“审批中”的单个审批实例进行撤销操作,撤销后审批流程结束 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/cancel ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CancelInstanceSample.java ; + */ + public CancelInstanceResp cancel(CancelInstanceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/instances/cancel" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CancelInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CancelInstanceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/cancel" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 审批实例抄送,通过接口可以将当前审批实例抄送给其他人。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/cc ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CcInstanceSample.java ; + */ + public CcInstanceResp cc(CcInstanceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/instances/cc" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CcInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CcInstanceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/cc" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 审批实例抄送,通过接口可以将当前审批实例抄送给其他人。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/cc ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CcInstanceSample.java ; + */ + public CcInstanceResp cc(CcInstanceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/instances/cc" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CcInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CcInstanceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/cc" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建审批实例,创建一个审批实例,调用方需对审批定义的表单有详细了解,将按照定义的表单结构,将表单 Value 通过接口传入 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateInstanceSample.java ; + */ + public CreateInstanceResp create(CreateInstanceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/instances" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateInstanceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建审批实例,创建一个审批实例,调用方需对审批定义的表单有详细了解,将按照定义的表单结构,将表单 Value 通过接口传入 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateInstanceSample.java ; + */ + public CreateInstanceResp create(CreateInstanceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/instances" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateInstanceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取单个审批实例详情,通过审批实例 Instance Code 获取审批实例详情。Instance Code 由 [批量获取审批实例](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/list) 接口获取。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/GetInstanceSample.java ; + */ + public GetInstanceResp get(GetInstanceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/approval/v4/instances/:instance_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetInstanceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/:instance_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取单个审批实例详情,通过审批实例 Instance Code 获取审批实例详情。Instance Code 由 [批量获取审批实例](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/list) 接口获取。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/GetInstanceSample.java ; + */ + public GetInstanceResp get(GetInstanceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/approval/v4/instances/:instance_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetInstanceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/:instance_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量获取审批实例ID,根据 approval_code 批量获取审批实例的 instance_code,用于拉取租户下某个审批定义的全部审批实例。默认以审批创建时间先后顺序排列 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ListInstanceSample.java ; + */ + public ListInstanceResp list(ListInstanceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/approval/v4/instances" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListInstanceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量获取审批实例ID,根据 approval_code 批量获取审批实例的 instance_code,用于拉取租户下某个审批定义的全部审批实例。默认以审批创建时间先后顺序排列 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ListInstanceSample.java ; + */ + public ListInstanceResp list(ListInstanceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/approval/v4/instances" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListInstanceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/ukTM5UjL5ETO14SOxkTN/approval-preview ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/PreviewInstanceSample.java ; + */ + public PreviewInstanceResp preview(PreviewInstanceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/instances/preview" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PreviewInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PreviewInstanceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/preview" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/ukTM5UjL5ETO14SOxkTN/approval-preview ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/PreviewInstanceSample.java ; + */ + public PreviewInstanceResp preview(PreviewInstanceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/instances/preview" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PreviewInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PreviewInstanceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/preview" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询实例列表,该接口通过不同条件查询审批系统中符合条件的审批实例列表。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/QueryInstanceSample.java ; + */ + public QueryInstanceResp query(QueryInstanceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/instances/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryInstanceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询实例列表,该接口通过不同条件查询审批系统中符合条件的审批实例列表。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/QueryInstanceSample.java ; + */ + public QueryInstanceResp query(QueryInstanceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/instances/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryInstanceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询抄送列表,该接口通过不同条件查询审批系统中符合条件的审批抄送列表。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/search_cc ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SearchCcInstanceSample.java ; + */ + public SearchCcInstanceResp searchCc(SearchCcInstanceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/instances/search_cc" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchCcInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchCcInstanceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/search_cc" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询抄送列表,该接口通过不同条件查询审批系统中符合条件的审批抄送列表。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/search_cc ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SearchCcInstanceSample.java ; + */ + public SearchCcInstanceResp searchCc(SearchCcInstanceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/instances/search_cc" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchCcInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchCcInstanceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/search_cc" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 审批任务退回,从当前审批任务,退回到已审批的一个或多个任务节点。退回后,已审批节点重新生成审批任务 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/specified_rollback ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SpecifiedRollbackInstanceSample.java ; + */ + public SpecifiedRollbackInstanceResp specifiedRollback(SpecifiedRollbackInstanceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/instances/specified_rollback" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SpecifiedRollbackInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SpecifiedRollbackInstanceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/specified_rollback" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 审批任务退回,从当前审批任务,退回到已审批的一个或多个任务节点。退回后,已审批节点重新生成审批任务 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/specified_rollback ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SpecifiedRollbackInstanceSample.java ; + */ + public SpecifiedRollbackInstanceResp specifiedRollback(SpecifiedRollbackInstanceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/instances/specified_rollback" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SpecifiedRollbackInstanceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SpecifiedRollbackInstanceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/specified_rollback" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/InstanceComment.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/InstanceComment.java new file mode 100644 index 000000000..16b55a25b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/InstanceComment.java @@ -0,0 +1,302 @@ +// Code generated by lark suite 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 com.lark.oapi.service.approval.v4.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.approval.v4.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class InstanceComment { + private static final Logger log = LoggerFactory.getLogger(InstanceComment.class); + private final Config config; + + public InstanceComment(Config config) { + this.config = config; + } + + + /** + * 创建评论,在某审批实例下创建、修改评论或评论回复(不包含审批同意、拒绝、转交等附加的理由或意见)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance-comment/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateInstanceCommentSample.java ; + */ + public CreateInstanceCommentResp create(CreateInstanceCommentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/instances/:instance_id/comments" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateInstanceCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateInstanceCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/:instance_id/comments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建评论,在某审批实例下创建、修改评论或评论回复(不包含审批同意、拒绝、转交等附加的理由或意见)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance-comment/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateInstanceCommentSample.java ; + */ + public CreateInstanceCommentResp create(CreateInstanceCommentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/instances/:instance_id/comments" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateInstanceCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateInstanceCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/:instance_id/comments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除评论,逻辑删除某审批实例下的一条评论或评论回复(不包含审批同意、拒绝、转交等附加的理由或意见)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance-comment/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/DeleteInstanceCommentSample.java ; + */ + public DeleteInstanceCommentResp delete(DeleteInstanceCommentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/approval/v4/instances/:instance_id/comments/:comment_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteInstanceCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteInstanceCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/:instance_id/comments/:comment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除评论,逻辑删除某审批实例下的一条评论或评论回复(不包含审批同意、拒绝、转交等附加的理由或意见)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance-comment/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/DeleteInstanceCommentSample.java ; + */ + public DeleteInstanceCommentResp delete(DeleteInstanceCommentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/approval/v4/instances/:instance_id/comments/:comment_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteInstanceCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteInstanceCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/:instance_id/comments/:comment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取评论,根据 Instance Code 获取某个审批实例下的全部评论与评论回复(不包含审批同意、拒绝、转交等附加的理由或意见)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance-comment/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ListInstanceCommentSample.java ; + */ + public ListInstanceCommentResp list(ListInstanceCommentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/approval/v4/instances/:instance_id/comments" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListInstanceCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListInstanceCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/:instance_id/comments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取评论,根据 Instance Code 获取某个审批实例下的全部评论与评论回复(不包含审批同意、拒绝、转交等附加的理由或意见)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance-comment/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ListInstanceCommentSample.java ; + */ + public ListInstanceCommentResp list(ListInstanceCommentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/approval/v4/instances/:instance_id/comments" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListInstanceCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListInstanceCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/:instance_id/comments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 清空评论,删除某审批实例下的全部评论与评论回复。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance-comment/remove ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/RemoveInstanceCommentSample.java ; + */ + public RemoveInstanceCommentResp remove(RemoveInstanceCommentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/instances/:instance_id/comments/remove" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RemoveInstanceCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RemoveInstanceCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/:instance_id/comments/remove" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 清空评论,删除某审批实例下的全部评论与评论回复。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance-comment/remove ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/RemoveInstanceCommentSample.java ; + */ + public RemoveInstanceCommentResp remove(RemoveInstanceCommentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/instances/:instance_id/comments/remove" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RemoveInstanceCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RemoveInstanceCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/instances/:instance_id/comments/remove" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/Task.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/Task.java new file mode 100644 index 000000000..5a8c0f71d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/approval/v4/resource/Task.java @@ -0,0 +1,434 @@ +// Code generated by lark suite 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 com.lark.oapi.service.approval.v4.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.approval.v4.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Task { + private static final Logger log = LoggerFactory.getLogger(Task.class); + private final Config config; + + public Task(Config config) { + this.config = config; + } + + + /** + * 审批任务同意,对于单个审批任务进行同意操作。同意后审批流程会流转到下一个审批人。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/approve ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ApproveTaskSample.java ; + */ + public ApproveTaskResp approve(ApproveTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/tasks/approve" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ApproveTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ApproveTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/tasks/approve" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 审批任务同意,对于单个审批任务进行同意操作。同意后审批流程会流转到下一个审批人。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/approve ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ApproveTaskSample.java ; + */ + public ApproveTaskResp approve(ApproveTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/tasks/approve" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ApproveTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ApproveTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/tasks/approve" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 用户角度列出任务,根据用户和任务分组查询任务列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/QueryTaskSample.java ; + */ + public QueryTaskResp query(QueryTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/approval/v4/tasks/query" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + QueryTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/tasks/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 用户角度列出任务,根据用户和任务分组查询任务列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/QueryTaskSample.java ; + */ + public QueryTaskResp query(QueryTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/approval/v4/tasks/query" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + QueryTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/tasks/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 审批任务拒绝,对于单个审批任务进行拒绝操作。拒绝后审批流程结束。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/reject ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/RejectTaskSample.java ; + */ + public RejectTaskResp reject(RejectTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/tasks/reject" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RejectTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RejectTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/tasks/reject" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 审批任务拒绝,对于单个审批任务进行拒绝操作。拒绝后审批流程结束。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/reject ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/RejectTaskSample.java ; + */ + public RejectTaskResp reject(RejectTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/tasks/reject" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RejectTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RejectTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/tasks/reject" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 审批任务重新提交,对于单个退回到发起人的审批任务进行重新发起操作。发起后审批流程会流转到下一个审批人。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/resubmit ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ResubmitTaskSample.java ; + */ + public ResubmitTaskResp resubmit(ResubmitTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/tasks/resubmit" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ResubmitTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ResubmitTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/tasks/resubmit" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 审批任务重新提交,对于单个退回到发起人的审批任务进行重新发起操作。发起后审批流程会流转到下一个审批人。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/resubmit ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ResubmitTaskSample.java ; + */ + public ResubmitTaskResp resubmit(ResubmitTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/tasks/resubmit" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ResubmitTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ResubmitTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/tasks/resubmit" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询任务列表,该接口通过不同条件查询审批系统中符合条件的审批任务列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/search ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SearchTaskSample.java ; + */ + public SearchTaskResp search(SearchTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/tasks/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/tasks/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询任务列表,该接口通过不同条件查询审批系统中符合条件的审批任务列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/search ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SearchTaskSample.java ; + */ + public SearchTaskResp search(SearchTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/tasks/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/tasks/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 审批任务转交,对于单个审批任务进行转交操作。转交后审批流程流转给被转交人。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/transfer ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/TransferTaskSample.java ; + */ + public TransferTaskResp transfer(TransferTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/tasks/transfer" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + TransferTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TransferTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/tasks/transfer" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 审批任务转交,对于单个审批任务进行转交操作。转交后审批流程流转给被转交人。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/transfer ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/TransferTaskSample.java ; + */ + public TransferTaskResp transfer(TransferTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/approval/v4/tasks/transfer" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + TransferTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TransferTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/approval/v4/tasks/transfer" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/AttendanceService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/AttendanceService.java new file mode 100644 index 000000000..45e7d46fa --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/AttendanceService.java @@ -0,0 +1,119 @@ +// Code generated by lark suite 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 com.lark.oapi.service.attendance; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.attendance.v1.V1; +import com.lark.oapi.service.attendance.v1.resource.*; + +public class AttendanceService { + private final V1 v1; + private final ApprovalInfo approvalInfo; // approval_info + private final File file; // 文件 + private final Group group; // 考勤组管理 + private final LeaveAccrualRecord leaveAccrualRecord; // leave_accrual_record + private final LeaveEmployExpireRecord leaveEmployExpireRecord; // leave_employ_expire_record + private final Shift shift; // 考勤班次 + private final UserApproval userApproval; // 假勤审批 + private final UserDailyShift userDailyShift; // 考勤排班 + private final UserFlow userFlow; // user_flow + private final UserSetting userSetting; // 用户设置 + private final UserStatsData userStatsData; // 考勤统计 + private final UserStatsField userStatsField; // user_stats_field + private final UserStatsView userStatsView; // user_stats_view + private final UserTask userTask; // 考勤记录 + private final UserTaskRemedy userTaskRemedy; // 考勤补卡 + + public AttendanceService(Config config) { + this.v1 = new V1(config); + this.approvalInfo = new ApprovalInfo(config); + this.file = new File(config); + this.group = new Group(config); + this.leaveAccrualRecord = new LeaveAccrualRecord(config); + this.leaveEmployExpireRecord = new LeaveEmployExpireRecord(config); + this.shift = new Shift(config); + this.userApproval = new UserApproval(config); + this.userDailyShift = new UserDailyShift(config); + this.userFlow = new UserFlow(config); + this.userSetting = new UserSetting(config); + this.userStatsData = new UserStatsData(config); + this.userStatsField = new UserStatsField(config); + this.userStatsView = new UserStatsView(config); + this.userTask = new UserTask(config); + this.userTaskRemedy = new UserTaskRemedy(config); + } + + public V1 v1() { + return v1; + } + + public ApprovalInfo approvalInfo() { + return approvalInfo; + } + + public File file() { + return file; + } + + public Group group() { + return group; + } + + public LeaveAccrualRecord leaveAccrualRecord() { + return leaveAccrualRecord; + } + + public LeaveEmployExpireRecord leaveEmployExpireRecord() { + return leaveEmployExpireRecord; + } + + public Shift shift() { + return shift; + } + + public UserApproval userApproval() { + return userApproval; + } + + public UserDailyShift userDailyShift() { + return userDailyShift; + } + + public UserFlow userFlow() { + return userFlow; + } + + public UserSetting userSetting() { + return userSetting; + } + + public UserStatsData userStatsData() { + return userStatsData; + } + + public UserStatsField userStatsField() { + return userStatsField; + } + + public UserStatsView userStatsView() { + return userStatsView; + } + + public UserTask userTask() { + return userTask; + } + + public UserTaskRemedy userTaskRemedy() { + return userTaskRemedy; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/AttendanceService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/AttendanceService.java deleted file mode 100644 index e156ad8be..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/AttendanceService.java +++ /dev/null @@ -1,2475 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.attendance.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.attendance.v1.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.ByteArrayOutputStream; -import java.nio.charset.StandardCharsets; - -public class AttendanceService { - private static final Logger log = LoggerFactory.getLogger(AttendanceService.class); - private final ApprovalInfo approvalInfo; // approval_info - private final File file; // 文件 - private final Group group; // 考勤组管理 - private final LeaveAccrualRecord leaveAccrualRecord; // leave_accrual_record - private final LeaveEmployExpireRecord leaveEmployExpireRecord; // leave_employ_expire_record - private final Shift shift; // 考勤班次 - private final UserApproval userApproval; // 假勤审批 - private final UserDailyShift userDailyShift; // 考勤排班 - private final UserFlow userFlow; // user_flow - private final UserSetting userSetting; // 用户设置 - private final UserStatsData userStatsData; // 考勤统计 - private final UserStatsField userStatsField; // user_stats_field - private final UserStatsView userStatsView; // user_stats_view - private final UserTask userTask; // 考勤记录 - private final UserTaskRemedy userTaskRemedy; // 考勤补卡 - - public AttendanceService(Config config) { - this.approvalInfo = new ApprovalInfo(config); - this.file = new File(config); - this.group = new Group(config); - this.leaveAccrualRecord = new LeaveAccrualRecord(config); - this.leaveEmployExpireRecord = new LeaveEmployExpireRecord(config); - this.shift = new Shift(config); - this.userApproval = new UserApproval(config); - this.userDailyShift = new UserDailyShift(config); - this.userFlow = new UserFlow(config); - this.userSetting = new UserSetting(config); - this.userStatsData = new UserStatsData(config); - this.userStatsField = new UserStatsField(config); - this.userStatsView = new UserStatsView(config); - this.userTask = new UserTask(config); - this.userTaskRemedy = new UserTaskRemedy(config); - } - - /** - * approval_info - * - * @return - */ - public ApprovalInfo approvalInfo() { - return approvalInfo; - } - - /** - * 文件 - * - * @return - */ - public File file() { - return file; - } - - /** - * 考勤组管理 - * - * @return - */ - public Group group() { - return group; - } - - /** - * leave_accrual_record - * - * @return - */ - public LeaveAccrualRecord leaveAccrualRecord() { - return leaveAccrualRecord; - } - - /** - * leave_employ_expire_record - * - * @return - */ - public LeaveEmployExpireRecord leaveEmployExpireRecord() { - return leaveEmployExpireRecord; - } - - /** - * 考勤班次 - * - * @return - */ - public Shift shift() { - return shift; - } - - /** - * 假勤审批 - * - * @return - */ - public UserApproval userApproval() { - return userApproval; - } - - /** - * 考勤排班 - * - * @return - */ - public UserDailyShift userDailyShift() { - return userDailyShift; - } - - /** - * user_flow - * - * @return - */ - public UserFlow userFlow() { - return userFlow; - } - - /** - * 用户设置 - * - * @return - */ - public UserSetting userSetting() { - return userSetting; - } - - /** - * 考勤统计 - * - * @return - */ - public UserStatsData userStatsData() { - return userStatsData; - } - - /** - * user_stats_field - * - * @return - */ - public UserStatsField userStatsField() { - return userStatsField; - } - - /** - * user_stats_view - * - * @return - */ - public UserStatsView userStatsView() { - return userStatsView; - } - - /** - * 考勤记录 - * - * @return - */ - public UserTask userTask() { - return userTask; - } - - /** - * 考勤补卡 - * - * @return - */ - public UserTaskRemedy userTaskRemedy() { - return userTaskRemedy; - } - - public static class ApprovalInfo { - private final Config config; - - public ApprovalInfo(Config config) { - this.config = config; - } - - /** - * 通知审批状态更新,对于只使用飞书考勤系统而未使用飞书审批系统的企业,可以通过该接口更新写入飞书考勤系统中的三方系统审批状态,例如请假、加班、外出、出差、补卡等审批,状态包括通过、不通过、撤销等。 - *

发起状态的审批才可以被更新为通过、不通过,已经通过的审批才可以被更新为撤销。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/approval_info/process ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ProcessApprovalInfoSample.java ; - */ - public ProcessApprovalInfoResp process(ProcessApprovalInfoReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/approval_infos/process" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ProcessApprovalInfoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ProcessApprovalInfoResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/approval_infos/process" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 通知审批状态更新,对于只使用飞书考勤系统而未使用飞书审批系统的企业,可以通过该接口更新写入飞书考勤系统中的三方系统审批状态,例如请假、加班、外出、出差、补卡等审批,状态包括通过、不通过、撤销等。 - *

发起状态的审批才可以被更新为通过、不通过,已经通过的审批才可以被更新为撤销。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/approval_info/process ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ProcessApprovalInfoSample.java ; - */ - public ProcessApprovalInfoResp process(ProcessApprovalInfoReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/approval_infos/process" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ProcessApprovalInfoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ProcessApprovalInfoResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/approval_infos/process" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class File { - private final Config config; - - public File(Config config) { - this.config = config; - } - - /** - * 下载文件,通过文件 ID 下载指定的文件。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/file/download ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/DownloadFileSample.java ; - */ - public DownloadFileResp download(DownloadFileReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/attendance/v1/files/:file_id/download" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - if (httpResponse.getStatusCode() == 200) { - DownloadFileResp resp = new DownloadFileResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - DownloadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/files/:file_id/download" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 下载文件,通过文件 ID 下载指定的文件。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/file/download ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/DownloadFileSample.java ; - */ - public DownloadFileResp download(DownloadFileReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/attendance/v1/files/:file_id/download" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 下载请求,返回流 - if (httpResponse.getStatusCode() == 200) { - DownloadFileResp resp = new DownloadFileResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - DownloadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/files/:file_id/download" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 上传文件,上传文件并获取文件 ID,可用于“修改用户设置”接口中的 face_key 参数。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/file/upload ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/UploadFileSample.java ; - */ - public UploadFileResp upload(UploadFileReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/files/upload" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UploadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/files/upload" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 上传文件,上传文件并获取文件 ID,可用于“修改用户设置”接口中的 face_key 参数。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/file/upload ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/UploadFileSample.java ; - */ - public UploadFileResp upload(UploadFileReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/files/upload" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UploadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/files/upload" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Group { - private final Config config; - - public Group(Config config) { - this.config = config; - } - - /** - * 创建或修改考勤组,考勤组,是对部门或者员工在某个特定场所及特定时间段内的出勤情况(包括上下班、迟到、早退、病假、婚假、丧假、公休、工作时间、加班情况等)的一种规则设定。;;通过设置考勤组,可以从部门、员工两个维度,来设定考勤方式、考勤时间、考勤地点等考勤规则。 - *

出于安全考虑,目前通过该接口只允许修改自己创建的考勤组。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateGroupSample.java ; - */ - public CreateGroupResp create(CreateGroupReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/groups" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateGroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/groups" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建或修改考勤组,考勤组,是对部门或者员工在某个特定场所及特定时间段内的出勤情况(包括上下班、迟到、早退、病假、婚假、丧假、公休、工作时间、加班情况等)的一种规则设定。;;通过设置考勤组,可以从部门、员工两个维度,来设定考勤方式、考勤时间、考勤地点等考勤规则。 - *

出于安全考虑,目前通过该接口只允许修改自己创建的考勤组。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateGroupSample.java ; - */ - public CreateGroupResp create(CreateGroupReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/groups" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateGroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/groups" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除考勤组,通过班次 ID 删除班次。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/DeleteGroupSample.java ; - */ - public DeleteGroupResp delete(DeleteGroupReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/attendance/v1/groups/:group_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteGroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/groups/:group_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除考勤组,通过班次 ID 删除班次。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/DeleteGroupSample.java ; - */ - public DeleteGroupResp delete(DeleteGroupReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/attendance/v1/groups/:group_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteGroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/groups/:group_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取考勤组详情,通过考勤组 ID 获取考勤组详情。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetGroupSample.java ; - */ - public GetGroupResp get(GetGroupReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/attendance/v1/groups/:group_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetGroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/groups/:group_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取考勤组详情,通过考勤组 ID 获取考勤组详情。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetGroupSample.java ; - */ - public GetGroupResp get(GetGroupReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/attendance/v1/groups/:group_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetGroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/groups/:group_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取考勤组列表,翻页获取所有考勤组列表。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ListGroupSample.java ; - */ - public ListGroupResp list(ListGroupReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/attendance/v1/groups" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListGroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/groups" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取考勤组列表,翻页获取所有考勤组列表。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ListGroupSample.java ; - */ - public ListGroupResp list(ListGroupReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/attendance/v1/groups" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListGroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/groups" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 按名称查询考勤组,按考勤组名称查询考勤组摘要信息。查询条件支持名称精确匹配和模糊匹配两种方式。查询结果按考勤组修改时间 desc 排序,且最大记录数为 10 条。 - *

该接口依赖的数据和考勤组主数据间存在数据同步延时(正常数据同步 2 秒以内),因此在使用该接口时需注意评估数据延迟潜在风险。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/search ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/SearchGroupSample.java ; - */ - public SearchGroupResp search(SearchGroupReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/groups/search" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SearchGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchGroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/groups/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 按名称查询考勤组,按考勤组名称查询考勤组摘要信息。查询条件支持名称精确匹配和模糊匹配两种方式。查询结果按考勤组修改时间 desc 排序,且最大记录数为 10 条。 - *

该接口依赖的数据和考勤组主数据间存在数据同步延时(正常数据同步 2 秒以内),因此在使用该接口时需注意评估数据延迟潜在风险。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/search ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/SearchGroupSample.java ; - */ - public SearchGroupResp search(SearchGroupReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/groups/search" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SearchGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchGroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/groups/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class LeaveAccrualRecord { - private final Config config; - - public LeaveAccrualRecord(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=attendance&resource=leave_accrual_record&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/PatchLeaveAccrualRecordSample.java ; - */ - public PatchLeaveAccrualRecordResp patch(PatchLeaveAccrualRecordReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/attendance/v1/leave_accrual_record/:leave_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchLeaveAccrualRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchLeaveAccrualRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/leave_accrual_record/:leave_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=attendance&resource=leave_accrual_record&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/PatchLeaveAccrualRecordSample.java ; - */ - public PatchLeaveAccrualRecordResp patch(PatchLeaveAccrualRecordReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/attendance/v1/leave_accrual_record/:leave_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchLeaveAccrualRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchLeaveAccrualRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/leave_accrual_record/:leave_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class LeaveEmployExpireRecord { - private final Config config; - - public LeaveEmployExpireRecord(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=attendance&resource=leave_employ_expire_record&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetLeaveEmployExpireRecordSample.java ; - */ - public GetLeaveEmployExpireRecordResp get(GetLeaveEmployExpireRecordReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/attendance/v1/leave_employ_expire_records/:leave_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetLeaveEmployExpireRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetLeaveEmployExpireRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/leave_employ_expire_records/:leave_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=attendance&resource=leave_employ_expire_record&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetLeaveEmployExpireRecordSample.java ; - */ - public GetLeaveEmployExpireRecordResp get(GetLeaveEmployExpireRecordReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/attendance/v1/leave_employ_expire_records/:leave_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetLeaveEmployExpireRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetLeaveEmployExpireRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/leave_employ_expire_records/:leave_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Shift { - private final Config config; - - public Shift(Config config) { - this.config = config; - } - - /** - * 创建班次,班次是描述一次考勤任务时间规则的统称,比如一天打多少次卡,每次卡的上下班时间,晚到多长时间算迟到,晚到多长时间算缺卡等。 - *

- 创建一个考勤组前,必须先创建一个或者多个班次。;- 一个公司内的班次是共享的,你可以直接引用他人创建的班次,但是需要注意的是,若他人修改了班次,会影响到你的考勤组及其考勤结果。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateShiftSample.java ; - */ - public CreateShiftResp create(CreateShiftReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/shifts" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateShiftResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/shifts" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建班次,班次是描述一次考勤任务时间规则的统称,比如一天打多少次卡,每次卡的上下班时间,晚到多长时间算迟到,晚到多长时间算缺卡等。 - *

- 创建一个考勤组前,必须先创建一个或者多个班次。;- 一个公司内的班次是共享的,你可以直接引用他人创建的班次,但是需要注意的是,若他人修改了班次,会影响到你的考勤组及其考勤结果。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateShiftSample.java ; - */ - public CreateShiftResp create(CreateShiftReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/shifts" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateShiftResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/shifts" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除班次,通过班次 ID 删除班次。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/DeleteShiftSample.java ; - */ - public DeleteShiftResp delete(DeleteShiftReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/attendance/v1/shifts/:shift_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteShiftResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/shifts/:shift_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除班次,通过班次 ID 删除班次。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/DeleteShiftSample.java ; - */ - public DeleteShiftResp delete(DeleteShiftReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/attendance/v1/shifts/:shift_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteShiftResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/shifts/:shift_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取班次详情,通过班次 ID 获取班次详情。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetShiftSample.java ; - */ - public GetShiftResp get(GetShiftReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/attendance/v1/shifts/:shift_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetShiftResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/shifts/:shift_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取班次详情,通过班次 ID 获取班次详情。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetShiftSample.java ; - */ - public GetShiftResp get(GetShiftReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/attendance/v1/shifts/:shift_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetShiftResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/shifts/:shift_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取班次列表,翻页获取所有班次列表。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ListShiftSample.java ; - */ - public ListShiftResp list(ListShiftReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/attendance/v1/shifts" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListShiftResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/shifts" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取班次列表,翻页获取所有班次列表。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ListShiftSample.java ; - */ - public ListShiftResp list(ListShiftReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/attendance/v1/shifts" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListShiftResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/shifts" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 按名称查询班次,通过班次的名称查询班次信息。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryShiftSample.java ; - */ - public QueryShiftResp query(QueryShiftReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/shifts/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryShiftResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/shifts/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 按名称查询班次,通过班次的名称查询班次信息。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryShiftSample.java ; - */ - public QueryShiftResp query(QueryShiftReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/shifts/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryShiftResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/shifts/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class UserApproval { - private final Config config; - - public UserApproval(Config config) { - this.config = config; - } - - /** - * 写入审批结果,由于部分企业使用的是自己的审批系统,而不是飞书审批系统,因此员工的请假、加班等数据无法流入到飞书考勤系统中,导致员工在请假时间段内依然收到打卡提醒,并且被记为缺卡。;;对于这些只使用飞书考勤系统,而未使用飞书审批系统的企业,可以通过考勤开放接口的形式,将三方审批结果数据回写到飞书考勤系统中。 - *

目前支持写入加班、请假、出差和外出这四种审批结果,写入只会追加(insert),不会覆盖(update)(开放接口导入的加班假期记录,在管理后台的假期加班里查不到,只能通过[获取审批通过数据](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_approval/query)来查询) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_approval/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateUserApprovalSample.java ; - */ - public CreateUserApprovalResp create(CreateUserApprovalReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_approvals" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateUserApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateUserApprovalResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_approvals" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 写入审批结果,由于部分企业使用的是自己的审批系统,而不是飞书审批系统,因此员工的请假、加班等数据无法流入到飞书考勤系统中,导致员工在请假时间段内依然收到打卡提醒,并且被记为缺卡。;;对于这些只使用飞书考勤系统,而未使用飞书审批系统的企业,可以通过考勤开放接口的形式,将三方审批结果数据回写到飞书考勤系统中。 - *

目前支持写入加班、请假、出差和外出这四种审批结果,写入只会追加(insert),不会覆盖(update)(开放接口导入的加班假期记录,在管理后台的假期加班里查不到,只能通过[获取审批通过数据](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_approval/query)来查询) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_approval/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateUserApprovalSample.java ; - */ - public CreateUserApprovalResp create(CreateUserApprovalReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_approvals" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateUserApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateUserApprovalResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_approvals" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取审批通过数据,获取员工在某段时间内的请假、加班、外出和出差四种审批的通过数据。 - *

请假的假期时长字段,暂未开放提供,待后续提供。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_approval/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserApprovalSample.java ; - */ - public QueryUserApprovalResp query(QueryUserApprovalReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_approvals/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryUserApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserApprovalResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_approvals/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取审批通过数据,获取员工在某段时间内的请假、加班、外出和出差四种审批的通过数据。 - *

请假的假期时长字段,暂未开放提供,待后续提供。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_approval/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserApprovalSample.java ; - */ - public QueryUserApprovalResp query(QueryUserApprovalReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_approvals/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryUserApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserApprovalResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_approvals/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class UserDailyShift { - private final Config config; - - public UserDailyShift(Config config) { - this.config = config; - } - - /** - * 创建或修改班表,班表是用来描述考勤组内人员每天按哪个班次进行上班。目前班表支持按一个整月对一位或多位人员进行排班。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_daily_shift/batch_create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/BatchCreateUserDailyShiftSample.java ; - */ - public BatchCreateUserDailyShiftResp batchCreate(BatchCreateUserDailyShiftReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_daily_shifts/batch_create" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchCreateUserDailyShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateUserDailyShiftResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_daily_shifts/batch_create" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建或修改班表,班表是用来描述考勤组内人员每天按哪个班次进行上班。目前班表支持按一个整月对一位或多位人员进行排班。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_daily_shift/batch_create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/BatchCreateUserDailyShiftSample.java ; - */ - public BatchCreateUserDailyShiftResp batchCreate(BatchCreateUserDailyShiftReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_daily_shifts/batch_create" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchCreateUserDailyShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateUserDailyShiftResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_daily_shifts/batch_create" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询班表信息,支持查询多个用户的排班情况,查询的时间跨度不能超过 30 天。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_daily_shift/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserDailyShiftSample.java ; - */ - public QueryUserDailyShiftResp query(QueryUserDailyShiftReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_daily_shifts/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryUserDailyShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserDailyShiftResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_daily_shifts/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询班表信息,支持查询多个用户的排班情况,查询的时间跨度不能超过 30 天。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_daily_shift/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserDailyShiftSample.java ; - */ - public QueryUserDailyShiftResp query(QueryUserDailyShiftReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_daily_shifts/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryUserDailyShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserDailyShiftResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_daily_shifts/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class UserFlow { - private final Config config; - - public UserFlow(Config config) { - this.config = config; - } - - /** - * 导入打卡流水记录,导入授权内员工的打卡流水记录。导入后,会根据员工所在的考勤组班次规则,计算最终的打卡状态与结果。 - *

适用于考勤机数据导入等场景。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_flow/batch_create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/BatchCreateUserFlowSample.java ; - */ - public BatchCreateUserFlowResp batchCreate(BatchCreateUserFlowReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_flows/batch_create" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchCreateUserFlowResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateUserFlowResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_flows/batch_create" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 导入打卡流水记录,导入授权内员工的打卡流水记录。导入后,会根据员工所在的考勤组班次规则,计算最终的打卡状态与结果。 - *

适用于考勤机数据导入等场景。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_flow/batch_create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/BatchCreateUserFlowSample.java ; - */ - public BatchCreateUserFlowResp batchCreate(BatchCreateUserFlowReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_flows/batch_create" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchCreateUserFlowResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateUserFlowResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_flows/batch_create" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取打卡流水记录,通过打卡记录 ID 获取用户的打卡流水记录。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_flow/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetUserFlowSample.java ; - */ - public GetUserFlowResp get(GetUserFlowReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/attendance/v1/user_flows/:user_flow_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetUserFlowResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetUserFlowResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_flows/:user_flow_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取打卡流水记录,通过打卡记录 ID 获取用户的打卡流水记录。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_flow/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetUserFlowSample.java ; - */ - public GetUserFlowResp get(GetUserFlowReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/attendance/v1/user_flows/:user_flow_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetUserFlowResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetUserFlowResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_flows/:user_flow_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询打卡流水记录,批量查询授权内员工的实际打卡流水记录。例如,企业给一个员工设定的班次是上午 9 点和下午 6 点各打一次上下班卡,但是该员工在这期间打了多次卡,该接口会把所有的打卡记录都返回。 - *

如果只需获取打卡结果,而不需要详细的打卡数据,可使用“获取打卡结果”的接口。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_flow/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserFlowSample.java ; - */ - public QueryUserFlowResp query(QueryUserFlowReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_flows/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryUserFlowResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserFlowResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_flows/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询打卡流水记录,批量查询授权内员工的实际打卡流水记录。例如,企业给一个员工设定的班次是上午 9 点和下午 6 点各打一次上下班卡,但是该员工在这期间打了多次卡,该接口会把所有的打卡记录都返回。 - *

如果只需获取打卡结果,而不需要详细的打卡数据,可使用“获取打卡结果”的接口。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_flow/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserFlowSample.java ; - */ - public QueryUserFlowResp query(QueryUserFlowReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_flows/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryUserFlowResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserFlowResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_flows/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class UserSetting { - private final Config config; - - public UserSetting(Config config) { - this.config = config; - } - - /** - * 修改用户设置,修改授权内员工的用户设置信息,包括人脸照片文件 ID。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_setting/modify ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ModifyUserSettingSample.java ; - */ - public ModifyUserSettingResp modify(ModifyUserSettingReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_settings/modify" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ModifyUserSettingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ModifyUserSettingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_settings/modify" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改用户设置,修改授权内员工的用户设置信息,包括人脸照片文件 ID。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_setting/modify ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ModifyUserSettingSample.java ; - */ - public ModifyUserSettingResp modify(ModifyUserSettingReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_settings/modify" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ModifyUserSettingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ModifyUserSettingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_settings/modify" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询用户设置,批量查询授权内员工的用户设置信息,包括人脸照片文件 ID、人脸照片更新时间。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_setting/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserSettingSample.java ; - */ - public QueryUserSettingResp query(QueryUserSettingReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/attendance/v1/user_settings/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryUserSettingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserSettingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_settings/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询用户设置,批量查询授权内员工的用户设置信息,包括人脸照片文件 ID、人脸照片更新时间。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_setting/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserSettingSample.java ; - */ - public QueryUserSettingResp query(QueryUserSettingReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/attendance/v1/user_settings/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryUserSettingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserSettingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_settings/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class UserStatsData { - private final Config config; - - public UserStatsData(Config config) { - this.config = config; - } - - /** - * 查询统计数据,查询日度统计或月度统计的统计数据。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_stats_data/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserStatsDataSample.java ; - */ - public QueryUserStatsDataResp query(QueryUserStatsDataReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_stats_datas/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryUserStatsDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserStatsDataResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_stats_datas/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询统计数据,查询日度统计或月度统计的统计数据。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_stats_data/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserStatsDataSample.java ; - */ - public QueryUserStatsDataResp query(QueryUserStatsDataReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_stats_datas/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryUserStatsDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserStatsDataResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_stats_datas/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class UserStatsField { - private final Config config; - - public UserStatsField(Config config) { - this.config = config; - } - - /** - * 查询统计表头,查询考勤统计支持的日度统计或月度统计的统计表头。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_stats_field/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserStatsFieldSample.java ; - */ - public QueryUserStatsFieldResp query(QueryUserStatsFieldReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_stats_fields/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryUserStatsFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserStatsFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_stats_fields/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询统计表头,查询考勤统计支持的日度统计或月度统计的统计表头。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_stats_field/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserStatsFieldSample.java ; - */ - public QueryUserStatsFieldResp query(QueryUserStatsFieldReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_stats_fields/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryUserStatsFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserStatsFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_stats_fields/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class UserStatsView { - private final Config config; - - public UserStatsView(Config config) { - this.config = config; - } - - /** - * 查询统计设置,查询开发者定制的日度统计或月度统计的统计报表表头设置信息。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_stats_view/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserStatsViewSample.java ; - */ - public QueryUserStatsViewResp query(QueryUserStatsViewReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_stats_views/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryUserStatsViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserStatsViewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_stats_views/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询统计设置,查询开发者定制的日度统计或月度统计的统计报表表头设置信息。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_stats_view/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserStatsViewSample.java ; - */ - public QueryUserStatsViewResp query(QueryUserStatsViewReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_stats_views/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryUserStatsViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserStatsViewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_stats_views/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新统计设置,更新开发者定制的日度统计或月度统计的统计报表表头设置信息。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_stats_view/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/UpdateUserStatsViewSample.java ; - */ - public UpdateUserStatsViewResp update(UpdateUserStatsViewReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/attendance/v1/user_stats_views/:user_stats_view_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateUserStatsViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateUserStatsViewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_stats_views/:user_stats_view_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新统计设置,更新开发者定制的日度统计或月度统计的统计报表表头设置信息。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_stats_view/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/UpdateUserStatsViewSample.java ; - */ - public UpdateUserStatsViewResp update(UpdateUserStatsViewReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/attendance/v1/user_stats_views/:user_stats_view_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateUserStatsViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateUserStatsViewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_stats_views/:user_stats_view_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class UserTask { - private final Config config; - - public UserTask(Config config) { - this.config = config; - } - - /** - * 获取打卡结果,获取企业内员工的实际打卡结果,包括上班打卡结果和下班打卡结果。 - *

- 如果企业给一个员工设定的班次是上午 9 点和下午 6 点各打一次上下班卡,即使员工在这期间打了多次卡,该接口也只会返回 1 条记录。;- 如果要获取打卡的详细数据,如打卡位置等信息,可使用“获取打卡流水记录”或“批量查询打卡流水记录”的接口。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_task/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserTaskSample.java ; - */ - public QueryUserTaskResp query(QueryUserTaskReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_tasks/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryUserTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_tasks/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取打卡结果,获取企业内员工的实际打卡结果,包括上班打卡结果和下班打卡结果。 - *

- 如果企业给一个员工设定的班次是上午 9 点和下午 6 点各打一次上下班卡,即使员工在这期间打了多次卡,该接口也只会返回 1 条记录。;- 如果要获取打卡的详细数据,如打卡位置等信息,可使用“获取打卡流水记录”或“批量查询打卡流水记录”的接口。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_task/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserTaskSample.java ; - */ - public QueryUserTaskResp query(QueryUserTaskReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_tasks/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryUserTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_tasks/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class UserTaskRemedy { - private final Config config; - - public UserTaskRemedy(Config config) { - this.config = config; - } - - /** - * 通知补卡审批发起,对于只使用飞书考勤系统而未使用飞书审批系统的企业,可以通过该接口,将在三方审批系统中发起的补卡审批数据,写入到飞书考勤系统中,状态为审批中。写入后可以由[通知审批状态更新](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/approval_info/process) 进行状态更新 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_task_remedy/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateUserTaskRemedySample.java ; - */ - public CreateUserTaskRemedyResp create(CreateUserTaskRemedyReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_task_remedys" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateUserTaskRemedyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateUserTaskRemedyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_task_remedys" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 通知补卡审批发起,对于只使用飞书考勤系统而未使用飞书审批系统的企业,可以通过该接口,将在三方审批系统中发起的补卡审批数据,写入到飞书考勤系统中,状态为审批中。写入后可以由[通知审批状态更新](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/approval_info/process) 进行状态更新 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_task_remedy/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateUserTaskRemedySample.java ; - */ - public CreateUserTaskRemedyResp create(CreateUserTaskRemedyReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_task_remedys" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateUserTaskRemedyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateUserTaskRemedyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_task_remedys" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取补卡记录,获取授权内员工的补卡记录。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_task_remedy/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserTaskRemedySample.java ; - */ - public QueryUserTaskRemedyResp query(QueryUserTaskRemedyReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_task_remedys/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryUserTaskRemedyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserTaskRemedyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_task_remedys/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取补卡记录,获取授权内员工的补卡记录。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_task_remedy/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserTaskRemedySample.java ; - */ - public QueryUserTaskRemedyResp query(QueryUserTaskRemedyReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_task_remedys/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryUserTaskRemedyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserTaskRemedyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_task_remedys/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取用户可补卡时间,获取用户某天可以补的第几次上 / 下班卡的时间。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_task_remedy/query_user_allowed_remedys ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserAllowedRemedysUserTaskRemedySample.java ; - */ - public QueryUserAllowedRemedysUserTaskRemedyResp queryUserAllowedRemedys(QueryUserAllowedRemedysUserTaskRemedyReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_task_remedys/query_user_allowed_remedys" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryUserAllowedRemedysUserTaskRemedyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserAllowedRemedysUserTaskRemedyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_task_remedys/query_user_allowed_remedys" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取用户可补卡时间,获取用户某天可以补的第几次上 / 下班卡的时间。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_task_remedy/query_user_allowed_remedys ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserAllowedRemedysUserTaskRemedySample.java ; - */ - public QueryUserAllowedRemedysUserTaskRemedyResp queryUserAllowedRemedys(QueryUserAllowedRemedysUserTaskRemedyReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/attendance/v1/user_task_remedys/query_user_allowed_remedys" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryUserAllowedRemedysUserTaskRemedyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserAllowedRemedysUserTaskRemedyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_task_remedys/query_user_allowed_remedys" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/V1.java new file mode 100644 index 000000000..b7205f4c8 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/V1.java @@ -0,0 +1,113 @@ +// Code generated by lark suite 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 com.lark.oapi.service.attendance.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.attendance.v1.resource.*; + +public class V1 { + private final ApprovalInfo approvalInfo; // approval_info + private final File file; // 文件 + private final Group group; // 考勤组管理 + private final LeaveAccrualRecord leaveAccrualRecord; // leave_accrual_record + private final LeaveEmployExpireRecord leaveEmployExpireRecord; // leave_employ_expire_record + private final Shift shift; // 考勤班次 + private final UserApproval userApproval; // 假勤审批 + private final UserDailyShift userDailyShift; // 考勤排班 + private final UserFlow userFlow; // user_flow + private final UserSetting userSetting; // 用户设置 + private final UserStatsData userStatsData; // 考勤统计 + private final UserStatsField userStatsField; // user_stats_field + private final UserStatsView userStatsView; // user_stats_view + private final UserTask userTask; // 考勤记录 + private final UserTaskRemedy userTaskRemedy; // 考勤补卡 + + public V1(Config config) { + this.approvalInfo = new ApprovalInfo(config); + this.file = new File(config); + this.group = new Group(config); + this.leaveAccrualRecord = new LeaveAccrualRecord(config); + this.leaveEmployExpireRecord = new LeaveEmployExpireRecord(config); + this.shift = new Shift(config); + this.userApproval = new UserApproval(config); + this.userDailyShift = new UserDailyShift(config); + this.userFlow = new UserFlow(config); + this.userSetting = new UserSetting(config); + this.userStatsData = new UserStatsData(config); + this.userStatsField = new UserStatsField(config); + this.userStatsView = new UserStatsView(config); + this.userTask = new UserTask(config); + this.userTaskRemedy = new UserTaskRemedy(config); + } + + public ApprovalInfo approvalInfo() { + return approvalInfo; + } + + public File file() { + return file; + } + + public Group group() { + return group; + } + + public LeaveAccrualRecord leaveAccrualRecord() { + return leaveAccrualRecord; + } + + public LeaveEmployExpireRecord leaveEmployExpireRecord() { + return leaveEmployExpireRecord; + } + + public Shift shift() { + return shift; + } + + public UserApproval userApproval() { + return userApproval; + } + + public UserDailyShift userDailyShift() { + return userDailyShift; + } + + public UserFlow userFlow() { + return userFlow; + } + + public UserSetting userSetting() { + return userSetting; + } + + public UserStatsData userStatsData() { + return userStatsData; + } + + public UserStatsField userStatsField() { + return userStatsField; + } + + public UserStatsView userStatsView() { + return userStatsView; + } + + public UserTask userTask() { + return userTask; + } + + public UserTaskRemedy userTaskRemedy() { + return userTaskRemedy; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/GetGroupRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/GetGroupRespBody.java index 737d62c8c..c638de087 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/GetGroupRespBody.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/GetGroupRespBody.java @@ -399,6 +399,12 @@ public class GetGroupRespBody { */ @SerializedName("overtime_clock_cfg") private OvertimeClockCfg overtimeClockCfg; + /** + * 节假日id,(如果考勤组使用了自定义节假日,请用此参数传入节假日id) + *

示例值:通过查询考勤组接口获取的new_calendar_id,例如7302191700771358252 + */ + @SerializedName("new_calendar_id") + private String newCalendarId; public String getGroupId() { return this.groupId; @@ -912,4 +918,12 @@ public void setOvertimeClockCfg(OvertimeClockCfg overtimeClockCfg) { this.overtimeClockCfg = overtimeClockCfg; } + public String getNewCalendarId() { + return this.newCalendarId; + } + + public void setNewCalendarId(String newCalendarId) { + this.newCalendarId = newCalendarId; + } + } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/GetUserFlowRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/GetUserFlowRespBody.java index 48b75885e..2c507b4f9 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/GetUserFlowRespBody.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/GetUserFlowRespBody.java @@ -48,7 +48,7 @@ public class GetUserFlowRespBody { private String comment; /** * 打卡记录ID - *

示例值:6709359313699356941 + *

示例值:考勤内部的打卡记录ID, 6709359313699356941(导入时此参数无效) */ @SerializedName("record_id") private String recordId; @@ -94,6 +94,12 @@ public class GetUserFlowRespBody { */ @SerializedName("check_result") private String checkResult; + /** + * 用户导入的外部打卡记录ID + *

示例值:record_123 + */ + @SerializedName("external_id") + private String externalId; public String getUserId() { return this.userId; @@ -201,4 +207,12 @@ public void setCheckResult(String checkResult) { this.checkResult = checkResult; } + public String getExternalId() { + return this.externalId; + } + + public void setExternalId(String externalId) { + this.externalId = externalId; + } + } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/Group.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/Group.java index b1ab78fe9..1ddded13c 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/Group.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/Group.java @@ -406,6 +406,12 @@ public class Group { */ @SerializedName("overtime_clock_cfg") private OvertimeClockCfg overtimeClockCfg; + /** + * 节假日id,(如果考勤组使用了自定义节假日,请用此参数传入节假日id) + *

示例值:通过查询考勤组接口获取的new_calendar_id,例如7302191700771358252 + */ + @SerializedName("new_calendar_id") + private String newCalendarId; // builder 开始 public Group() { @@ -737,6 +743,11 @@ public Group(Builder builder) { *

示例值: */ this.overtimeClockCfg = builder.overtimeClockCfg; + /** + * 节假日id,(如果考勤组使用了自定义节假日,请用此参数传入节假日id) + *

示例值:通过查询考勤组接口获取的new_calendar_id,例如7302191700771358252 + */ + this.newCalendarId = builder.newCalendarId; } public static Builder newBuilder() { @@ -1263,6 +1274,14 @@ public void setOvertimeClockCfg(OvertimeClockCfg overtimeClockCfg) { this.overtimeClockCfg = overtimeClockCfg; } + public String getNewCalendarId() { + return this.newCalendarId; + } + + public void setNewCalendarId(String newCalendarId) { + this.newCalendarId = newCalendarId; + } + public static class Builder { /** * 考勤组 ID(仅修改时提供), 需要从“获取打卡结果”的接口中获取 groupId @@ -1589,6 +1608,11 @@ public static class Builder { *

示例值: */ private OvertimeClockCfg overtimeClockCfg; + /** + * 节假日id,(如果考勤组使用了自定义节假日,请用此参数传入节假日id) + *

示例值:通过查询考勤组接口获取的new_calendar_id,例如7302191700771358252 + */ + private String newCalendarId; /** * 考勤组 ID(仅修改时提供), 需要从“获取打卡结果”的接口中获取 groupId @@ -2435,6 +2459,19 @@ public Builder overtimeClockCfg(OvertimeClockCfg overtimeClockCfg) { } + /** + * 节假日id,(如果考勤组使用了自定义节假日,请用此参数传入节假日id) + *

示例值:通过查询考勤组接口获取的new_calendar_id,例如7302191700771358252 + * + * @param newCalendarId + * @return + */ + public Builder newCalendarId(String newCalendarId) { + this.newCalendarId = newCalendarId; + return this; + } + + public Group build() { return new Group(this); } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/OpenApplyTimeRange.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/OpenApplyTimeRange.java new file mode 100644 index 000000000..0d1723c1a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/OpenApplyTimeRange.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.attendance.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class OpenApplyTimeRange { + /** + * 加班所属日期 + *

示例值:2023-09-25 + */ + @SerializedName("overtime_attribution_date") + private String overtimeAttributionDate; + /** + * 时段信息 + *

示例值: + */ + @SerializedName("time_range") + private OvertimeTimeRange timeRange; + + // builder 开始 + public OpenApplyTimeRange() { + } + + public OpenApplyTimeRange(Builder builder) { + /** + * 加班所属日期 + *

示例值:2023-09-25 + */ + this.overtimeAttributionDate = builder.overtimeAttributionDate; + /** + * 时段信息 + *

示例值: + */ + this.timeRange = builder.timeRange; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getOvertimeAttributionDate() { + return this.overtimeAttributionDate; + } + + public void setOvertimeAttributionDate(String overtimeAttributionDate) { + this.overtimeAttributionDate = overtimeAttributionDate; + } + + public OvertimeTimeRange getTimeRange() { + return this.timeRange; + } + + public void setTimeRange(OvertimeTimeRange timeRange) { + this.timeRange = timeRange; + } + + public static class Builder { + /** + * 加班所属日期 + *

示例值:2023-09-25 + */ + private String overtimeAttributionDate; + /** + * 时段信息 + *

示例值: + */ + private OvertimeTimeRange timeRange; + + /** + * 加班所属日期 + *

示例值:2023-09-25 + * + * @param overtimeAttributionDate + * @return + */ + public Builder overtimeAttributionDate(String overtimeAttributionDate) { + this.overtimeAttributionDate = overtimeAttributionDate; + return this; + } + + + /** + * 时段信息 + *

示例值: + * + * @param timeRange + * @return + */ + public Builder timeRange(OvertimeTimeRange timeRange) { + this.timeRange = timeRange; + return this; + } + + + public OpenApplyTimeRange build() { + return new OpenApplyTimeRange(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/ShiftGroupUser.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/ShiftGroupUser.java new file mode 100644 index 000000000..772537988 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/ShiftGroupUser.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.attendance.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class ShiftGroupUser { + /** + * 班组ID + *

示例值:7275180303583281171 + */ + @SerializedName("shift_group_id") + private String shiftGroupId; + /** + * 用户ID,根据传参user_id_type确定 + *

示例值:52aa1fa1 + */ + @SerializedName("user_id") + private String userId; + + // builder 开始 + public ShiftGroupUser() { + } + + public ShiftGroupUser(Builder builder) { + /** + * 班组ID + *

示例值:7275180303583281171 + */ + this.shiftGroupId = builder.shiftGroupId; + /** + * 用户ID,根据传参user_id_type确定 + *

示例值:52aa1fa1 + */ + this.userId = builder.userId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getShiftGroupId() { + return this.shiftGroupId; + } + + public void setShiftGroupId(String shiftGroupId) { + this.shiftGroupId = shiftGroupId; + } + + public String getUserId() { + return this.userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public static class Builder { + /** + * 班组ID + *

示例值:7275180303583281171 + */ + private String shiftGroupId; + /** + * 用户ID,根据传参user_id_type确定 + *

示例值:52aa1fa1 + */ + private String userId; + + /** + * 班组ID + *

示例值:7275180303583281171 + * + * @param shiftGroupId + * @return + */ + public Builder shiftGroupId(String shiftGroupId) { + this.shiftGroupId = shiftGroupId; + return this; + } + + + /** + * 用户ID,根据传参user_id_type确定 + *

示例值:52aa1fa1 + * + * @param userId + * @return + */ + public Builder userId(String userId) { + this.userId = userId; + return this; + } + + + public ShiftGroupUser build() { + return new ShiftGroupUser(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/UserFlow.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/UserFlow.java index 0bdd6fca2..8461d10fa 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/UserFlow.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/UserFlow.java @@ -94,6 +94,12 @@ public class UserFlow { */ @SerializedName("check_result") private String checkResult; + /** + * 用户导入的外部打卡记录ID + *

示例值:record_123 + */ + @SerializedName("external_id") + private String externalId; // builder 开始 public UserFlow() { @@ -165,6 +171,11 @@ public UserFlow(Builder builder) { *

示例值:Invalid */ this.checkResult = builder.checkResult; + /** + * 用户导入的外部打卡记录ID + *

示例值:record_123 + */ + this.externalId = builder.externalId; } public static Builder newBuilder() { @@ -275,6 +286,14 @@ public void setCheckResult(String checkResult) { this.checkResult = checkResult; } + public String getExternalId() { + return this.externalId; + } + + public void setExternalId(String externalId) { + this.externalId = externalId; + } + public static class Builder { /** * 用户 ID @@ -341,6 +360,11 @@ public static class Builder { *

示例值:Invalid */ private String checkResult; + /** + * 用户导入的外部打卡记录ID + *

示例值:record_123 + */ + private String externalId; /** * 用户 ID @@ -535,6 +559,19 @@ public Builder checkResult(com.lark.oapi.service.attendance.v1.enums.UserFlowChe } + /** + * 用户导入的外部打卡记录ID + *

示例值:record_123 + * + * @param externalId + * @return + */ + public Builder externalId(String externalId) { + this.externalId = externalId; + return this; + } + + public UserFlow build() { return new UserFlow(this); } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/UserShiftGroupsList.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/UserShiftGroupsList.java new file mode 100644 index 000000000..0b23b89a0 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/model/UserShiftGroupsList.java @@ -0,0 +1,185 @@ +// Code generated by lark suite 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 com.lark.oapi.service.attendance.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class UserShiftGroupsList { + /** + * 班组ID + *

示例值:7301693071333261331 + */ + @SerializedName("shift_group_id") + private String shiftGroupId; + /** + * 班组名称 + *

示例值:飞书考勤班组 + */ + @SerializedName("shift_group_name") + private String shiftGroupName; + /** + * 考勤组ID + *

示例值:7299769369813319699 + */ + @SerializedName("group_id") + private String groupId; + /** + * 班组的最后更新时间 + *

示例值:2023-11-15 09:00:00 + */ + @SerializedName("update_time") + private String updateTime; + + // builder 开始 + public UserShiftGroupsList() { + } + + public UserShiftGroupsList(Builder builder) { + /** + * 班组ID + *

示例值:7301693071333261331 + */ + this.shiftGroupId = builder.shiftGroupId; + /** + * 班组名称 + *

示例值:飞书考勤班组 + */ + this.shiftGroupName = builder.shiftGroupName; + /** + * 考勤组ID + *

示例值:7299769369813319699 + */ + this.groupId = builder.groupId; + /** + * 班组的最后更新时间 + *

示例值:2023-11-15 09:00:00 + */ + this.updateTime = builder.updateTime; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getShiftGroupId() { + return this.shiftGroupId; + } + + public void setShiftGroupId(String shiftGroupId) { + this.shiftGroupId = shiftGroupId; + } + + public String getShiftGroupName() { + return this.shiftGroupName; + } + + public void setShiftGroupName(String shiftGroupName) { + this.shiftGroupName = shiftGroupName; + } + + public String getGroupId() { + return this.groupId; + } + + public void setGroupId(String groupId) { + this.groupId = groupId; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public static class Builder { + /** + * 班组ID + *

示例值:7301693071333261331 + */ + private String shiftGroupId; + /** + * 班组名称 + *

示例值:飞书考勤班组 + */ + private String shiftGroupName; + /** + * 考勤组ID + *

示例值:7299769369813319699 + */ + private String groupId; + /** + * 班组的最后更新时间 + *

示例值:2023-11-15 09:00:00 + */ + private String updateTime; + + /** + * 班组ID + *

示例值:7301693071333261331 + * + * @param shiftGroupId + * @return + */ + public Builder shiftGroupId(String shiftGroupId) { + this.shiftGroupId = shiftGroupId; + return this; + } + + + /** + * 班组名称 + *

示例值:飞书考勤班组 + * + * @param shiftGroupName + * @return + */ + public Builder shiftGroupName(String shiftGroupName) { + this.shiftGroupName = shiftGroupName; + return this; + } + + + /** + * 考勤组ID + *

示例值:7299769369813319699 + * + * @param groupId + * @return + */ + public Builder groupId(String groupId) { + this.groupId = groupId; + return this; + } + + + /** + * 班组的最后更新时间 + *

示例值:2023-11-15 09:00:00 + * + * @param updateTime + * @return + */ + public Builder updateTime(String updateTime) { + this.updateTime = updateTime; + return this; + } + + + public UserShiftGroupsList build() { + return new UserShiftGroupsList(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/ApprovalInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/ApprovalInfo.java new file mode 100644 index 000000000..76974adbe --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/ApprovalInfo.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.attendance.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.attendance.v1.model.ProcessApprovalInfoReq; +import com.lark.oapi.service.attendance.v1.model.ProcessApprovalInfoResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ApprovalInfo { + private static final Logger log = LoggerFactory.getLogger(ApprovalInfo.class); + private final Config config; + + public ApprovalInfo(Config config) { + this.config = config; + } + + + /** + * 通知审批状态更新,对于只使用飞书考勤系统而未使用飞书审批系统的企业,可以通过该接口更新写入飞书考勤系统中的三方系统审批状态,例如请假、加班、外出、出差、补卡等审批,状态包括通过、不通过、撤销等。 + *

发起状态的审批才可以被更新为通过、不通过,已经通过的审批才可以被更新为撤销。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/approval_info/process ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ProcessApprovalInfoSample.java ; + */ + public ProcessApprovalInfoResp process(ProcessApprovalInfoReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/approval_infos/process" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ProcessApprovalInfoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ProcessApprovalInfoResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/approval_infos/process" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 通知审批状态更新,对于只使用飞书考勤系统而未使用飞书审批系统的企业,可以通过该接口更新写入飞书考勤系统中的三方系统审批状态,例如请假、加班、外出、出差、补卡等审批,状态包括通过、不通过、撤销等。 + *

发起状态的审批才可以被更新为通过、不通过,已经通过的审批才可以被更新为撤销。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/approval_info/process ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ProcessApprovalInfoSample.java ; + */ + public ProcessApprovalInfoResp process(ProcessApprovalInfoReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/approval_infos/process" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ProcessApprovalInfoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ProcessApprovalInfoResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/approval_infos/process" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/File.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/File.java new file mode 100644 index 000000000..538a5528c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/File.java @@ -0,0 +1,197 @@ +// Code generated by lark suite 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 com.lark.oapi.service.attendance.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.attendance.v1.model.DownloadFileReq; +import com.lark.oapi.service.attendance.v1.model.DownloadFileResp; +import com.lark.oapi.service.attendance.v1.model.UploadFileReq; +import com.lark.oapi.service.attendance.v1.model.UploadFileResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.ByteArrayOutputStream; +import java.nio.charset.StandardCharsets; + +public class File { + private static final Logger log = LoggerFactory.getLogger(File.class); + private final Config config; + + public File(Config config) { + this.config = config; + } + + + /** + * 下载文件,通过文件 ID 下载指定的文件。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/file/download ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/DownloadFileSample.java ; + */ + public DownloadFileResp download(DownloadFileReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/attendance/v1/files/:file_id/download" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + if (httpResponse.getStatusCode() == 200) { + DownloadFileResp resp = new DownloadFileResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + DownloadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/files/:file_id/download" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 下载文件,通过文件 ID 下载指定的文件。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/file/download ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/DownloadFileSample.java ; + */ + public DownloadFileResp download(DownloadFileReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/attendance/v1/files/:file_id/download" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 下载请求,返回流 + if (httpResponse.getStatusCode() == 200) { + DownloadFileResp resp = new DownloadFileResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + DownloadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/files/:file_id/download" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 上传文件,上传文件并获取文件 ID,可用于“修改用户设置”接口中的 face_key 参数。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/file/upload ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/UploadFileSample.java ; + */ + public UploadFileResp upload(UploadFileReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/files/upload" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UploadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/files/upload" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 上传文件,上传文件并获取文件 ID,可用于“修改用户设置”接口中的 face_key 参数。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/file/upload ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/UploadFileSample.java ; + */ + public UploadFileResp upload(UploadFileReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/files/upload" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UploadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/files/upload" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/Group.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/Group.java new file mode 100644 index 000000000..a0c9f7152 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/Group.java @@ -0,0 +1,372 @@ +// Code generated by lark suite 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 com.lark.oapi.service.attendance.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.attendance.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Group { + private static final Logger log = LoggerFactory.getLogger(Group.class); + private final Config config; + + public Group(Config config) { + this.config = config; + } + + + /** + * 创建或修改考勤组,考勤组,是对部门或者员工在某个特定场所及特定时间段内的出勤情况(包括上下班、迟到、早退、病假、婚假、丧假、公休、工作时间、加班情况等)的一种规则设定。;;通过设置考勤组,可以从部门、员工两个维度,来设定考勤方式、考勤时间、考勤地点等考勤规则。 + *

出于安全考虑,目前通过该接口只允许修改自己创建的考勤组。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateGroupSample.java ; + */ + public CreateGroupResp create(CreateGroupReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/groups" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateGroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/groups" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建或修改考勤组,考勤组,是对部门或者员工在某个特定场所及特定时间段内的出勤情况(包括上下班、迟到、早退、病假、婚假、丧假、公休、工作时间、加班情况等)的一种规则设定。;;通过设置考勤组,可以从部门、员工两个维度,来设定考勤方式、考勤时间、考勤地点等考勤规则。 + *

出于安全考虑,目前通过该接口只允许修改自己创建的考勤组。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateGroupSample.java ; + */ + public CreateGroupResp create(CreateGroupReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/groups" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateGroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/groups" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除考勤组,通过班次 ID 删除班次。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/DeleteGroupSample.java ; + */ + public DeleteGroupResp delete(DeleteGroupReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/attendance/v1/groups/:group_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteGroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/groups/:group_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除考勤组,通过班次 ID 删除班次。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/DeleteGroupSample.java ; + */ + public DeleteGroupResp delete(DeleteGroupReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/attendance/v1/groups/:group_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteGroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/groups/:group_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取考勤组详情,通过考勤组 ID 获取考勤组详情。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetGroupSample.java ; + */ + public GetGroupResp get(GetGroupReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/attendance/v1/groups/:group_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetGroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/groups/:group_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取考勤组详情,通过考勤组 ID 获取考勤组详情。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetGroupSample.java ; + */ + public GetGroupResp get(GetGroupReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/attendance/v1/groups/:group_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetGroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/groups/:group_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取考勤组列表,翻页获取所有考勤组列表。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ListGroupSample.java ; + */ + public ListGroupResp list(ListGroupReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/attendance/v1/groups" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListGroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/groups" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取考勤组列表,翻页获取所有考勤组列表。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ListGroupSample.java ; + */ + public ListGroupResp list(ListGroupReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/attendance/v1/groups" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListGroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/groups" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 按名称查询考勤组,按考勤组名称查询考勤组摘要信息。查询条件支持名称精确匹配和模糊匹配两种方式。查询结果按考勤组修改时间 desc 排序,且最大记录数为 10 条。 + *

该接口依赖的数据和考勤组主数据间存在数据同步延时(正常数据同步 2 秒以内),因此在使用该接口时需注意评估数据延迟潜在风险。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/search ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/SearchGroupSample.java ; + */ + public SearchGroupResp search(SearchGroupReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/groups/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchGroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/groups/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 按名称查询考勤组,按考勤组名称查询考勤组摘要信息。查询条件支持名称精确匹配和模糊匹配两种方式。查询结果按考勤组修改时间 desc 排序,且最大记录数为 10 条。 + *

该接口依赖的数据和考勤组主数据间存在数据同步延时(正常数据同步 2 秒以内),因此在使用该接口时需注意评估数据延迟潜在风险。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/search ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/SearchGroupSample.java ; + */ + public SearchGroupResp search(SearchGroupReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/groups/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchGroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/groups/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/LeaveAccrualRecord.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/LeaveAccrualRecord.java new file mode 100644 index 000000000..88419fbd3 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/LeaveAccrualRecord.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.attendance.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.attendance.v1.model.PatchLeaveAccrualRecordReq; +import com.lark.oapi.service.attendance.v1.model.PatchLeaveAccrualRecordResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class LeaveAccrualRecord { + private static final Logger log = LoggerFactory.getLogger(LeaveAccrualRecord.class); + private final Config config; + + public LeaveAccrualRecord(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=attendance&resource=leave_accrual_record&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/PatchLeaveAccrualRecordSample.java ; + */ + public PatchLeaveAccrualRecordResp patch(PatchLeaveAccrualRecordReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/attendance/v1/leave_accrual_record/:leave_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchLeaveAccrualRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchLeaveAccrualRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/leave_accrual_record/:leave_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=attendance&resource=leave_accrual_record&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/PatchLeaveAccrualRecordSample.java ; + */ + public PatchLeaveAccrualRecordResp patch(PatchLeaveAccrualRecordReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/attendance/v1/leave_accrual_record/:leave_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchLeaveAccrualRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchLeaveAccrualRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/leave_accrual_record/:leave_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/LeaveEmployExpireRecord.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/LeaveEmployExpireRecord.java new file mode 100644 index 000000000..c8148b74d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/LeaveEmployExpireRecord.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.attendance.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.attendance.v1.model.GetLeaveEmployExpireRecordReq; +import com.lark.oapi.service.attendance.v1.model.GetLeaveEmployExpireRecordResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class LeaveEmployExpireRecord { + private static final Logger log = LoggerFactory.getLogger(LeaveEmployExpireRecord.class); + private final Config config; + + public LeaveEmployExpireRecord(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=attendance&resource=leave_employ_expire_record&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetLeaveEmployExpireRecordSample.java ; + */ + public GetLeaveEmployExpireRecordResp get(GetLeaveEmployExpireRecordReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/attendance/v1/leave_employ_expire_records/:leave_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetLeaveEmployExpireRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetLeaveEmployExpireRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/leave_employ_expire_records/:leave_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=attendance&resource=leave_employ_expire_record&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetLeaveEmployExpireRecordSample.java ; + */ + public GetLeaveEmployExpireRecordResp get(GetLeaveEmployExpireRecordReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/attendance/v1/leave_employ_expire_records/:leave_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetLeaveEmployExpireRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetLeaveEmployExpireRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/leave_employ_expire_records/:leave_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/Shift.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/Shift.java new file mode 100644 index 000000000..e0abc9980 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/Shift.java @@ -0,0 +1,370 @@ +// Code generated by lark suite 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 com.lark.oapi.service.attendance.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.attendance.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Shift { + private static final Logger log = LoggerFactory.getLogger(Shift.class); + private final Config config; + + public Shift(Config config) { + this.config = config; + } + + + /** + * 创建班次,班次是描述一次考勤任务时间规则的统称,比如一天打多少次卡,每次卡的上下班时间,晚到多长时间算迟到,晚到多长时间算缺卡等。 + *

- 创建一个考勤组前,必须先创建一个或者多个班次。;- 一个公司内的班次是共享的,你可以直接引用他人创建的班次,但是需要注意的是,若他人修改了班次,会影响到你的考勤组及其考勤结果。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateShiftSample.java ; + */ + public CreateShiftResp create(CreateShiftReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/shifts" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateShiftResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/shifts" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建班次,班次是描述一次考勤任务时间规则的统称,比如一天打多少次卡,每次卡的上下班时间,晚到多长时间算迟到,晚到多长时间算缺卡等。 + *

- 创建一个考勤组前,必须先创建一个或者多个班次。;- 一个公司内的班次是共享的,你可以直接引用他人创建的班次,但是需要注意的是,若他人修改了班次,会影响到你的考勤组及其考勤结果。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateShiftSample.java ; + */ + public CreateShiftResp create(CreateShiftReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/shifts" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateShiftResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/shifts" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除班次,通过班次 ID 删除班次。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/DeleteShiftSample.java ; + */ + public DeleteShiftResp delete(DeleteShiftReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/attendance/v1/shifts/:shift_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteShiftResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/shifts/:shift_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除班次,通过班次 ID 删除班次。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/DeleteShiftSample.java ; + */ + public DeleteShiftResp delete(DeleteShiftReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/attendance/v1/shifts/:shift_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteShiftResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/shifts/:shift_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取班次详情,通过班次 ID 获取班次详情。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetShiftSample.java ; + */ + public GetShiftResp get(GetShiftReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/attendance/v1/shifts/:shift_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetShiftResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/shifts/:shift_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取班次详情,通过班次 ID 获取班次详情。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetShiftSample.java ; + */ + public GetShiftResp get(GetShiftReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/attendance/v1/shifts/:shift_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetShiftResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/shifts/:shift_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取班次列表,翻页获取所有班次列表。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ListShiftSample.java ; + */ + public ListShiftResp list(ListShiftReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/attendance/v1/shifts" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListShiftResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/shifts" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取班次列表,翻页获取所有班次列表。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ListShiftSample.java ; + */ + public ListShiftResp list(ListShiftReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/attendance/v1/shifts" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListShiftResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/shifts" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 按名称查询班次,通过班次的名称查询班次信息。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryShiftSample.java ; + */ + public QueryShiftResp query(QueryShiftReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/shifts/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryShiftResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/shifts/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 按名称查询班次,通过班次的名称查询班次信息。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryShiftSample.java ; + */ + public QueryShiftResp query(QueryShiftReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/shifts/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryShiftResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/shifts/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserApproval.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserApproval.java new file mode 100644 index 000000000..a6bd12377 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserApproval.java @@ -0,0 +1,177 @@ +// Code generated by lark suite 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 com.lark.oapi.service.attendance.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.attendance.v1.model.CreateUserApprovalReq; +import com.lark.oapi.service.attendance.v1.model.CreateUserApprovalResp; +import com.lark.oapi.service.attendance.v1.model.QueryUserApprovalReq; +import com.lark.oapi.service.attendance.v1.model.QueryUserApprovalResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class UserApproval { + private static final Logger log = LoggerFactory.getLogger(UserApproval.class); + private final Config config; + + public UserApproval(Config config) { + this.config = config; + } + + + /** + * 写入审批结果,由于部分企业使用的是自己的审批系统,而不是飞书审批系统,因此员工的请假、加班等数据无法流入到飞书考勤系统中,导致员工在请假时间段内依然收到打卡提醒,并且被记为缺卡。;;对于这些只使用飞书考勤系统,而未使用飞书审批系统的企业,可以通过考勤开放接口的形式,将三方审批结果数据回写到飞书考勤系统中。 + *

目前支持写入加班、请假、出差和外出这四种审批结果,写入只会追加(insert),不会覆盖(update)(开放接口导入的加班假期记录,在管理后台的假期加班里查不到,只能通过[获取审批通过数据](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_approval/query)来查询) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_approval/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateUserApprovalSample.java ; + */ + public CreateUserApprovalResp create(CreateUserApprovalReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_approvals" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateUserApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateUserApprovalResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_approvals" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 写入审批结果,由于部分企业使用的是自己的审批系统,而不是飞书审批系统,因此员工的请假、加班等数据无法流入到飞书考勤系统中,导致员工在请假时间段内依然收到打卡提醒,并且被记为缺卡。;;对于这些只使用飞书考勤系统,而未使用飞书审批系统的企业,可以通过考勤开放接口的形式,将三方审批结果数据回写到飞书考勤系统中。 + *

目前支持写入加班、请假、出差和外出这四种审批结果,写入只会追加(insert),不会覆盖(update)(开放接口导入的加班假期记录,在管理后台的假期加班里查不到,只能通过[获取审批通过数据](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_approval/query)来查询) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_approval/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateUserApprovalSample.java ; + */ + public CreateUserApprovalResp create(CreateUserApprovalReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_approvals" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateUserApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateUserApprovalResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_approvals" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取审批通过数据,获取员工在某段时间内的请假、加班、外出和出差四种审批的通过数据。 + *

请假的假期时长字段,暂未开放提供,待后续提供。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_approval/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserApprovalSample.java ; + */ + public QueryUserApprovalResp query(QueryUserApprovalReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_approvals/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryUserApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserApprovalResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_approvals/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取审批通过数据,获取员工在某段时间内的请假、加班、外出和出差四种审批的通过数据。 + *

请假的假期时长字段,暂未开放提供,待后续提供。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_approval/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserApprovalSample.java ; + */ + public QueryUserApprovalResp query(QueryUserApprovalReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_approvals/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryUserApprovalResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserApprovalResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_approvals/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserDailyShift.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserDailyShift.java new file mode 100644 index 000000000..709cadbaf --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserDailyShift.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.attendance.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.attendance.v1.model.BatchCreateUserDailyShiftReq; +import com.lark.oapi.service.attendance.v1.model.BatchCreateUserDailyShiftResp; +import com.lark.oapi.service.attendance.v1.model.QueryUserDailyShiftReq; +import com.lark.oapi.service.attendance.v1.model.QueryUserDailyShiftResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class UserDailyShift { + private static final Logger log = LoggerFactory.getLogger(UserDailyShift.class); + private final Config config; + + public UserDailyShift(Config config) { + this.config = config; + } + + + /** + * 创建或修改班表,班表是用来描述考勤组内人员每天按哪个班次进行上班。目前班表支持按一个整月对一位或多位人员进行排班。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_daily_shift/batch_create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/BatchCreateUserDailyShiftSample.java ; + */ + public BatchCreateUserDailyShiftResp batchCreate(BatchCreateUserDailyShiftReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_daily_shifts/batch_create" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchCreateUserDailyShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateUserDailyShiftResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_daily_shifts/batch_create" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建或修改班表,班表是用来描述考勤组内人员每天按哪个班次进行上班。目前班表支持按一个整月对一位或多位人员进行排班。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_daily_shift/batch_create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/BatchCreateUserDailyShiftSample.java ; + */ + public BatchCreateUserDailyShiftResp batchCreate(BatchCreateUserDailyShiftReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_daily_shifts/batch_create" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchCreateUserDailyShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateUserDailyShiftResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_daily_shifts/batch_create" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询班表信息,支持查询多个用户的排班情况,查询的时间跨度不能超过 30 天。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_daily_shift/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserDailyShiftSample.java ; + */ + public QueryUserDailyShiftResp query(QueryUserDailyShiftReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_daily_shifts/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryUserDailyShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserDailyShiftResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_daily_shifts/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询班表信息,支持查询多个用户的排班情况,查询的时间跨度不能超过 30 天。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_daily_shift/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserDailyShiftSample.java ; + */ + public QueryUserDailyShiftResp query(QueryUserDailyShiftReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_daily_shifts/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryUserDailyShiftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserDailyShiftResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_daily_shifts/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserFlow.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserFlow.java new file mode 100644 index 000000000..e46638494 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserFlow.java @@ -0,0 +1,240 @@ +// Code generated by lark suite 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 com.lark.oapi.service.attendance.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.attendance.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class UserFlow { + private static final Logger log = LoggerFactory.getLogger(UserFlow.class); + private final Config config; + + public UserFlow(Config config) { + this.config = config; + } + + + /** + * 导入打卡流水记录,导入授权内员工的打卡流水记录。导入后,会根据员工所在的考勤组班次规则,计算最终的打卡状态与结果。 + *

适用于考勤机数据导入等场景。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_flow/batch_create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/BatchCreateUserFlowSample.java ; + */ + public BatchCreateUserFlowResp batchCreate(BatchCreateUserFlowReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_flows/batch_create" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchCreateUserFlowResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateUserFlowResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_flows/batch_create" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 导入打卡流水记录,导入授权内员工的打卡流水记录。导入后,会根据员工所在的考勤组班次规则,计算最终的打卡状态与结果。 + *

适用于考勤机数据导入等场景。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_flow/batch_create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/BatchCreateUserFlowSample.java ; + */ + public BatchCreateUserFlowResp batchCreate(BatchCreateUserFlowReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_flows/batch_create" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchCreateUserFlowResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateUserFlowResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_flows/batch_create" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取打卡流水记录,通过打卡记录 ID 获取用户的打卡流水记录。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_flow/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetUserFlowSample.java ; + */ + public GetUserFlowResp get(GetUserFlowReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/attendance/v1/user_flows/:user_flow_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetUserFlowResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetUserFlowResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_flows/:user_flow_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取打卡流水记录,通过打卡记录 ID 获取用户的打卡流水记录。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_flow/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetUserFlowSample.java ; + */ + public GetUserFlowResp get(GetUserFlowReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/attendance/v1/user_flows/:user_flow_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetUserFlowResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetUserFlowResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_flows/:user_flow_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询打卡流水记录,批量查询授权内员工的实际打卡流水记录。例如,企业给一个员工设定的班次是上午 9 点和下午 6 点各打一次上下班卡,但是该员工在这期间打了多次卡,该接口会把所有的打卡记录都返回。 + *

如果只需获取打卡结果,而不需要详细的打卡数据,可使用“获取打卡结果”的接口。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_flow/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserFlowSample.java ; + */ + public QueryUserFlowResp query(QueryUserFlowReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_flows/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryUserFlowResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserFlowResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_flows/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询打卡流水记录,批量查询授权内员工的实际打卡流水记录。例如,企业给一个员工设定的班次是上午 9 点和下午 6 点各打一次上下班卡,但是该员工在这期间打了多次卡,该接口会把所有的打卡记录都返回。 + *

如果只需获取打卡结果,而不需要详细的打卡数据,可使用“获取打卡结果”的接口。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_flow/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserFlowSample.java ; + */ + public QueryUserFlowResp query(QueryUserFlowReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_flows/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryUserFlowResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserFlowResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_flows/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserSetting.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserSetting.java new file mode 100644 index 000000000..748225487 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserSetting.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.attendance.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.attendance.v1.model.ModifyUserSettingReq; +import com.lark.oapi.service.attendance.v1.model.ModifyUserSettingResp; +import com.lark.oapi.service.attendance.v1.model.QueryUserSettingReq; +import com.lark.oapi.service.attendance.v1.model.QueryUserSettingResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class UserSetting { + private static final Logger log = LoggerFactory.getLogger(UserSetting.class); + private final Config config; + + public UserSetting(Config config) { + this.config = config; + } + + + /** + * 修改用户设置,修改授权内员工的用户设置信息,包括人脸照片文件 ID。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_setting/modify ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ModifyUserSettingSample.java ; + */ + public ModifyUserSettingResp modify(ModifyUserSettingReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_settings/modify" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ModifyUserSettingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ModifyUserSettingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_settings/modify" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改用户设置,修改授权内员工的用户设置信息,包括人脸照片文件 ID。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_setting/modify ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ModifyUserSettingSample.java ; + */ + public ModifyUserSettingResp modify(ModifyUserSettingReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_settings/modify" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ModifyUserSettingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ModifyUserSettingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_settings/modify" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询用户设置,批量查询授权内员工的用户设置信息,包括人脸照片文件 ID、人脸照片更新时间。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_setting/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserSettingSample.java ; + */ + public QueryUserSettingResp query(QueryUserSettingReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/attendance/v1/user_settings/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryUserSettingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserSettingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_settings/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询用户设置,批量查询授权内员工的用户设置信息,包括人脸照片文件 ID、人脸照片更新时间。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_setting/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserSettingSample.java ; + */ + public QueryUserSettingResp query(QueryUserSettingReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/attendance/v1/user_settings/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryUserSettingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserSettingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_settings/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserStatsData.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserStatsData.java new file mode 100644 index 000000000..03f81d584 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserStatsData.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.attendance.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.attendance.v1.model.QueryUserStatsDataReq; +import com.lark.oapi.service.attendance.v1.model.QueryUserStatsDataResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class UserStatsData { + private static final Logger log = LoggerFactory.getLogger(UserStatsData.class); + private final Config config; + + public UserStatsData(Config config) { + this.config = config; + } + + + /** + * 查询统计数据,查询日度统计或月度统计的统计数据。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_stats_data/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserStatsDataSample.java ; + */ + public QueryUserStatsDataResp query(QueryUserStatsDataReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_stats_datas/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryUserStatsDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserStatsDataResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_stats_datas/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询统计数据,查询日度统计或月度统计的统计数据。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_stats_data/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserStatsDataSample.java ; + */ + public QueryUserStatsDataResp query(QueryUserStatsDataReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_stats_datas/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryUserStatsDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserStatsDataResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_stats_datas/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserStatsField.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserStatsField.java new file mode 100644 index 000000000..08c601888 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserStatsField.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.attendance.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.attendance.v1.model.QueryUserStatsFieldReq; +import com.lark.oapi.service.attendance.v1.model.QueryUserStatsFieldResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class UserStatsField { + private static final Logger log = LoggerFactory.getLogger(UserStatsField.class); + private final Config config; + + public UserStatsField(Config config) { + this.config = config; + } + + + /** + * 查询统计表头,查询考勤统计支持的日度统计或月度统计的统计表头。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_stats_field/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserStatsFieldSample.java ; + */ + public QueryUserStatsFieldResp query(QueryUserStatsFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_stats_fields/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryUserStatsFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserStatsFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_stats_fields/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询统计表头,查询考勤统计支持的日度统计或月度统计的统计表头。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_stats_field/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserStatsFieldSample.java ; + */ + public QueryUserStatsFieldResp query(QueryUserStatsFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_stats_fields/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryUserStatsFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserStatsFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_stats_fields/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserStatsView.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserStatsView.java new file mode 100644 index 000000000..5c1975ec1 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserStatsView.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.attendance.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.attendance.v1.model.QueryUserStatsViewReq; +import com.lark.oapi.service.attendance.v1.model.QueryUserStatsViewResp; +import com.lark.oapi.service.attendance.v1.model.UpdateUserStatsViewReq; +import com.lark.oapi.service.attendance.v1.model.UpdateUserStatsViewResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class UserStatsView { + private static final Logger log = LoggerFactory.getLogger(UserStatsView.class); + private final Config config; + + public UserStatsView(Config config) { + this.config = config; + } + + + /** + * 查询统计设置,查询开发者定制的日度统计或月度统计的统计报表表头设置信息。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_stats_view/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserStatsViewSample.java ; + */ + public QueryUserStatsViewResp query(QueryUserStatsViewReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_stats_views/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryUserStatsViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserStatsViewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_stats_views/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询统计设置,查询开发者定制的日度统计或月度统计的统计报表表头设置信息。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_stats_view/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserStatsViewSample.java ; + */ + public QueryUserStatsViewResp query(QueryUserStatsViewReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_stats_views/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryUserStatsViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserStatsViewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_stats_views/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新统计设置,更新开发者定制的日度统计或月度统计的统计报表表头设置信息。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_stats_view/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/UpdateUserStatsViewSample.java ; + */ + public UpdateUserStatsViewResp update(UpdateUserStatsViewReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/attendance/v1/user_stats_views/:user_stats_view_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateUserStatsViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateUserStatsViewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_stats_views/:user_stats_view_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新统计设置,更新开发者定制的日度统计或月度统计的统计报表表头设置信息。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_stats_view/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/UpdateUserStatsViewSample.java ; + */ + public UpdateUserStatsViewResp update(UpdateUserStatsViewReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/attendance/v1/user_stats_views/:user_stats_view_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateUserStatsViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateUserStatsViewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_stats_views/:user_stats_view_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserTask.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserTask.java new file mode 100644 index 000000000..3bec2ed17 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserTask.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.attendance.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.attendance.v1.model.QueryUserTaskReq; +import com.lark.oapi.service.attendance.v1.model.QueryUserTaskResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class UserTask { + private static final Logger log = LoggerFactory.getLogger(UserTask.class); + private final Config config; + + public UserTask(Config config) { + this.config = config; + } + + + /** + * 获取打卡结果,获取企业内员工的实际打卡结果,包括上班打卡结果和下班打卡结果。 + *

- 如果企业给一个员工设定的班次是上午 9 点和下午 6 点各打一次上下班卡,即使员工在这期间打了多次卡,该接口也只会返回 1 条记录。;- 如果要获取打卡的详细数据,如打卡位置等信息,可使用“获取打卡流水记录”或“批量查询打卡流水记录”的接口。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_task/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserTaskSample.java ; + */ + public QueryUserTaskResp query(QueryUserTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_tasks/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryUserTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_tasks/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取打卡结果,获取企业内员工的实际打卡结果,包括上班打卡结果和下班打卡结果。 + *

- 如果企业给一个员工设定的班次是上午 9 点和下午 6 点各打一次上下班卡,即使员工在这期间打了多次卡,该接口也只会返回 1 条记录。;- 如果要获取打卡的详细数据,如打卡位置等信息,可使用“获取打卡流水记录”或“批量查询打卡流水记录”的接口。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_task/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserTaskSample.java ; + */ + public QueryUserTaskResp query(QueryUserTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_tasks/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryUserTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_tasks/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserTaskRemedy.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserTaskRemedy.java new file mode 100644 index 000000000..b37ba23bb --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/attendance/v1/resource/UserTaskRemedy.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.attendance.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.attendance.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class UserTaskRemedy { + private static final Logger log = LoggerFactory.getLogger(UserTaskRemedy.class); + private final Config config; + + public UserTaskRemedy(Config config) { + this.config = config; + } + + + /** + * 通知补卡审批发起,对于只使用飞书考勤系统而未使用飞书审批系统的企业,可以通过该接口,将在三方审批系统中发起的补卡审批数据,写入到飞书考勤系统中,状态为审批中。写入后可以由[通知审批状态更新](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/approval_info/process) 进行状态更新 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_task_remedy/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateUserTaskRemedySample.java ; + */ + public CreateUserTaskRemedyResp create(CreateUserTaskRemedyReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_task_remedys" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateUserTaskRemedyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateUserTaskRemedyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_task_remedys" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 通知补卡审批发起,对于只使用飞书考勤系统而未使用飞书审批系统的企业,可以通过该接口,将在三方审批系统中发起的补卡审批数据,写入到飞书考勤系统中,状态为审批中。写入后可以由[通知审批状态更新](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/approval_info/process) 进行状态更新 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_task_remedy/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateUserTaskRemedySample.java ; + */ + public CreateUserTaskRemedyResp create(CreateUserTaskRemedyReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_task_remedys" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateUserTaskRemedyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateUserTaskRemedyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_task_remedys" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取补卡记录,获取授权内员工的补卡记录。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_task_remedy/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserTaskRemedySample.java ; + */ + public QueryUserTaskRemedyResp query(QueryUserTaskRemedyReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_task_remedys/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryUserTaskRemedyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserTaskRemedyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_task_remedys/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取补卡记录,获取授权内员工的补卡记录。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_task_remedy/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserTaskRemedySample.java ; + */ + public QueryUserTaskRemedyResp query(QueryUserTaskRemedyReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_task_remedys/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryUserTaskRemedyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserTaskRemedyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_task_remedys/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取用户可补卡时间,获取用户某天可以补的第几次上 / 下班卡的时间。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_task_remedy/query_user_allowed_remedys ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserAllowedRemedysUserTaskRemedySample.java ; + */ + public QueryUserAllowedRemedysUserTaskRemedyResp queryUserAllowedRemedys(QueryUserAllowedRemedysUserTaskRemedyReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_task_remedys/query_user_allowed_remedys" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryUserAllowedRemedysUserTaskRemedyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserAllowedRemedysUserTaskRemedyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_task_remedys/query_user_allowed_remedys" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取用户可补卡时间,获取用户某天可以补的第几次上 / 下班卡的时间。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_task_remedy/query_user_allowed_remedys ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserAllowedRemedysUserTaskRemedySample.java ; + */ + public QueryUserAllowedRemedysUserTaskRemedyResp queryUserAllowedRemedys(QueryUserAllowedRemedysUserTaskRemedyReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/attendance/v1/user_task_remedys/query_user_allowed_remedys" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryUserAllowedRemedysUserTaskRemedyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserAllowedRemedysUserTaskRemedyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/attendance/v1/user_task_remedys/query_user_allowed_remedys" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/auth/AuthService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/auth/AuthService.java new file mode 100644 index 000000000..d44279679 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/auth/AuthService.java @@ -0,0 +1,49 @@ +// Code generated by lark suite 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 com.lark.oapi.service.auth; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.auth.v3.V3; +import com.lark.oapi.service.auth.v3.resource.AppAccessToken; +import com.lark.oapi.service.auth.v3.resource.AppTicket; +import com.lark.oapi.service.auth.v3.resource.TenantAccessToken; + +public class AuthService { + private final V3 v3; + private final AppAccessToken appAccessToken; // app_access_token + private final AppTicket appTicket; // app_ticket + private final TenantAccessToken tenantAccessToken; // tenant_access_token + + public AuthService(Config config) { + this.v3 = new V3(config); + this.appAccessToken = new AppAccessToken(config); + this.appTicket = new AppTicket(config); + this.tenantAccessToken = new TenantAccessToken(config); + } + + public V3 v3() { + return v3; + } + + public AppAccessToken appAccessToken() { + return appAccessToken; + } + + public AppTicket appTicket() { + return appTicket; + } + + public TenantAccessToken tenantAccessToken() { + return tenantAccessToken; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/auth/v3/AuthService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/auth/v3/AuthService.java deleted file mode 100644 index ffcf5725a..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/auth/v3/AuthService.java +++ /dev/null @@ -1,422 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.auth.v3; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.auth.v3.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class AuthService { - private static final Logger log = LoggerFactory.getLogger(AuthService.class); - private final AppAccessToken appAccessToken; // app_access_token - private final AppTicket appTicket; // app_ticket - private final TenantAccessToken tenantAccessToken; // tenant_access_token - - public AuthService(Config config) { - this.appAccessToken = new AppAccessToken(config); - this.appTicket = new AppTicket(config); - this.tenantAccessToken = new TenantAccessToken(config); - } - - /** - * app_access_token - * - * @return - */ - public AppAccessToken appAccessToken() { - return appAccessToken; - } - - /** - * app_ticket - * - * @return - */ - public AppTicket appTicket() { - return appTicket; - } - - /** - * tenant_access_token - * - * @return - */ - public TenantAccessToken tenantAccessToken() { - return tenantAccessToken; - } - - public static class AppAccessToken { - private final Config config; - - public AppAccessToken(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=auth&resource=app_access_token&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/CreateAppAccessTokenSample.java ; - */ - public CreateAppAccessTokenResp create(CreateAppAccessTokenReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/auth/v3/app_access_token" - , Sets.newHashSet() - , req); - - // 反序列化 - CreateAppAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppAccessTokenResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/auth/v3/app_access_token" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=auth&resource=app_access_token&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/CreateAppAccessTokenSample.java ; - */ - public CreateAppAccessTokenResp create(CreateAppAccessTokenReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/auth/v3/app_access_token" - , Sets.newHashSet() - , req); - - // 反序列化 - CreateAppAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppAccessTokenResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/auth/v3/app_access_token" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=internal&project=auth&resource=app_access_token&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/InternalAppAccessTokenSample.java ; - */ - public InternalAppAccessTokenResp internal(InternalAppAccessTokenReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/auth/v3/app_access_token/internal" - , Sets.newHashSet() - , req); - - // 反序列化 - InternalAppAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, InternalAppAccessTokenResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/auth/v3/app_access_token/internal" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=internal&project=auth&resource=app_access_token&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/InternalAppAccessTokenSample.java ; - */ - public InternalAppAccessTokenResp internal(InternalAppAccessTokenReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/auth/v3/app_access_token/internal" - , Sets.newHashSet() - , req); - - // 反序列化 - InternalAppAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, InternalAppAccessTokenResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/auth/v3/app_access_token/internal" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class AppTicket { - private final Config config; - - public AppTicket(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=resend&project=auth&resource=app_ticket&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/ResendAppTicketSample.java ; - */ - public ResendAppTicketResp resend(ResendAppTicketReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/auth/v3/app_ticket/resend" - , Sets.newHashSet() - , req); - - // 反序列化 - ResendAppTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ResendAppTicketResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/auth/v3/app_ticket/resend" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=resend&project=auth&resource=app_ticket&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/ResendAppTicketSample.java ; - */ - public ResendAppTicketResp resend(ResendAppTicketReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/auth/v3/app_ticket/resend" - , Sets.newHashSet() - , req); - - // 反序列化 - ResendAppTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ResendAppTicketResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/auth/v3/app_ticket/resend" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class TenantAccessToken { - private final Config config; - - public TenantAccessToken(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=auth&resource=tenant_access_token&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/CreateTenantAccessTokenSample.java ; - */ - public CreateTenantAccessTokenResp create(CreateTenantAccessTokenReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/auth/v3/tenant_access_token" - , Sets.newHashSet() - , req); - - // 反序列化 - CreateTenantAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTenantAccessTokenResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/auth/v3/tenant_access_token" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=auth&resource=tenant_access_token&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/CreateTenantAccessTokenSample.java ; - */ - public CreateTenantAccessTokenResp create(CreateTenantAccessTokenReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/auth/v3/tenant_access_token" - , Sets.newHashSet() - , req); - - // 反序列化 - CreateTenantAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTenantAccessTokenResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/auth/v3/tenant_access_token" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=internal&project=auth&resource=tenant_access_token&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/InternalTenantAccessTokenSample.java ; - */ - public InternalTenantAccessTokenResp internal(InternalTenantAccessTokenReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/auth/v3/tenant_access_token/internal" - , Sets.newHashSet() - , req); - - // 反序列化 - InternalTenantAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, InternalTenantAccessTokenResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/auth/v3/tenant_access_token/internal" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=internal&project=auth&resource=tenant_access_token&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/InternalTenantAccessTokenSample.java ; - */ - public InternalTenantAccessTokenResp internal(InternalTenantAccessTokenReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/auth/v3/tenant_access_token/internal" - , Sets.newHashSet() - , req); - - // 反序列化 - InternalTenantAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, InternalTenantAccessTokenResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/auth/v3/tenant_access_token/internal" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/auth/v3/V3.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/auth/v3/V3.java new file mode 100644 index 000000000..ebd599f00 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/auth/v3/V3.java @@ -0,0 +1,43 @@ +// Code generated by lark suite 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 com.lark.oapi.service.auth.v3; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.auth.v3.resource.AppAccessToken; +import com.lark.oapi.service.auth.v3.resource.AppTicket; +import com.lark.oapi.service.auth.v3.resource.TenantAccessToken; + +public class V3 { + private final AppAccessToken appAccessToken; // app_access_token + private final AppTicket appTicket; // app_ticket + private final TenantAccessToken tenantAccessToken; // tenant_access_token + + public V3(Config config) { + this.appAccessToken = new AppAccessToken(config); + this.appTicket = new AppTicket(config); + this.tenantAccessToken = new TenantAccessToken(config); + } + + public AppAccessToken appAccessToken() { + return appAccessToken; + } + + public AppTicket appTicket() { + return appTicket; + } + + public TenantAccessToken tenantAccessToken() { + return tenantAccessToken; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/auth/v3/resource/AppAccessToken.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/auth/v3/resource/AppAccessToken.java new file mode 100644 index 000000000..2a2547213 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/auth/v3/resource/AppAccessToken.java @@ -0,0 +1,172 @@ +// Code generated by lark suite 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 com.lark.oapi.service.auth.v3.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.auth.v3.model.CreateAppAccessTokenReq; +import com.lark.oapi.service.auth.v3.model.CreateAppAccessTokenResp; +import com.lark.oapi.service.auth.v3.model.InternalAppAccessTokenReq; +import com.lark.oapi.service.auth.v3.model.InternalAppAccessTokenResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class AppAccessToken { + private static final Logger log = LoggerFactory.getLogger(AppAccessToken.class); + private final Config config; + + public AppAccessToken(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=auth&resource=app_access_token&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/CreateAppAccessTokenSample.java ; + */ + public CreateAppAccessTokenResp create(CreateAppAccessTokenReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/auth/v3/app_access_token" + , Sets.newHashSet() + , req); + + // 反序列化 + CreateAppAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppAccessTokenResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/auth/v3/app_access_token" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=auth&resource=app_access_token&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/CreateAppAccessTokenSample.java ; + */ + public CreateAppAccessTokenResp create(CreateAppAccessTokenReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/auth/v3/app_access_token" + , Sets.newHashSet() + , req); + + // 反序列化 + CreateAppAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppAccessTokenResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/auth/v3/app_access_token" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=internal&project=auth&resource=app_access_token&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/InternalAppAccessTokenSample.java ; + */ + public InternalAppAccessTokenResp internal(InternalAppAccessTokenReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/auth/v3/app_access_token/internal" + , Sets.newHashSet() + , req); + + // 反序列化 + InternalAppAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, InternalAppAccessTokenResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/auth/v3/app_access_token/internal" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=internal&project=auth&resource=app_access_token&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/InternalAppAccessTokenSample.java ; + */ + public InternalAppAccessTokenResp internal(InternalAppAccessTokenReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/auth/v3/app_access_token/internal" + , Sets.newHashSet() + , req); + + // 反序列化 + InternalAppAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, InternalAppAccessTokenResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/auth/v3/app_access_token/internal" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/auth/v3/resource/AppTicket.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/auth/v3/resource/AppTicket.java new file mode 100644 index 000000000..73b279b6a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/auth/v3/resource/AppTicket.java @@ -0,0 +1,104 @@ +// Code generated by lark suite 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 com.lark.oapi.service.auth.v3.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.auth.v3.model.ResendAppTicketReq; +import com.lark.oapi.service.auth.v3.model.ResendAppTicketResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class AppTicket { + private static final Logger log = LoggerFactory.getLogger(AppTicket.class); + private final Config config; + + public AppTicket(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=resend&project=auth&resource=app_ticket&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/ResendAppTicketSample.java ; + */ + public ResendAppTicketResp resend(ResendAppTicketReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/auth/v3/app_ticket/resend" + , Sets.newHashSet() + , req); + + // 反序列化 + ResendAppTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ResendAppTicketResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/auth/v3/app_ticket/resend" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=resend&project=auth&resource=app_ticket&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/ResendAppTicketSample.java ; + */ + public ResendAppTicketResp resend(ResendAppTicketReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/auth/v3/app_ticket/resend" + , Sets.newHashSet() + , req); + + // 反序列化 + ResendAppTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ResendAppTicketResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/auth/v3/app_ticket/resend" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/auth/v3/resource/TenantAccessToken.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/auth/v3/resource/TenantAccessToken.java new file mode 100644 index 000000000..647fc4474 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/auth/v3/resource/TenantAccessToken.java @@ -0,0 +1,172 @@ +// Code generated by lark suite 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 com.lark.oapi.service.auth.v3.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.auth.v3.model.CreateTenantAccessTokenReq; +import com.lark.oapi.service.auth.v3.model.CreateTenantAccessTokenResp; +import com.lark.oapi.service.auth.v3.model.InternalTenantAccessTokenReq; +import com.lark.oapi.service.auth.v3.model.InternalTenantAccessTokenResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class TenantAccessToken { + private static final Logger log = LoggerFactory.getLogger(TenantAccessToken.class); + private final Config config; + + public TenantAccessToken(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=auth&resource=tenant_access_token&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/CreateTenantAccessTokenSample.java ; + */ + public CreateTenantAccessTokenResp create(CreateTenantAccessTokenReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/auth/v3/tenant_access_token" + , Sets.newHashSet() + , req); + + // 反序列化 + CreateTenantAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTenantAccessTokenResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/auth/v3/tenant_access_token" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=auth&resource=tenant_access_token&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/CreateTenantAccessTokenSample.java ; + */ + public CreateTenantAccessTokenResp create(CreateTenantAccessTokenReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/auth/v3/tenant_access_token" + , Sets.newHashSet() + , req); + + // 反序列化 + CreateTenantAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTenantAccessTokenResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/auth/v3/tenant_access_token" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=internal&project=auth&resource=tenant_access_token&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/InternalTenantAccessTokenSample.java ; + */ + public InternalTenantAccessTokenResp internal(InternalTenantAccessTokenReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/auth/v3/tenant_access_token/internal" + , Sets.newHashSet() + , req); + + // 反序列化 + InternalTenantAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, InternalTenantAccessTokenResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/auth/v3/tenant_access_token/internal" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=internal&project=auth&resource=tenant_access_token&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/InternalTenantAccessTokenSample.java ; + */ + public InternalTenantAccessTokenResp internal(InternalTenantAccessTokenReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/auth/v3/tenant_access_token/internal" + , Sets.newHashSet() + , req); + + // 反序列化 + InternalTenantAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, InternalTenantAccessTokenResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/auth/v3/tenant_access_token/internal" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/authen/AuthenService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/authen/AuthenService.java new file mode 100644 index 000000000..d560ed2de --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/authen/AuthenService.java @@ -0,0 +1,59 @@ +// Code generated by lark suite 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 com.lark.oapi.service.authen; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.authen.v1.V1; +import com.lark.oapi.service.authen.v1.resource.*; + +public class AuthenService { + private final V1 v1; + private final AccessToken accessToken; // access_token + private final OidcAccessToken oidcAccessToken; // oidc.access_token + private final OidcRefreshAccessToken oidcRefreshAccessToken; // oidc.refresh_access_token + private final RefreshAccessToken refreshAccessToken; // refresh_access_token + private final UserInfo userInfo; // user_info + + public AuthenService(Config config) { + this.v1 = new V1(config); + this.accessToken = new AccessToken(config); + this.oidcAccessToken = new OidcAccessToken(config); + this.oidcRefreshAccessToken = new OidcRefreshAccessToken(config); + this.refreshAccessToken = new RefreshAccessToken(config); + this.userInfo = new UserInfo(config); + } + + public V1 v1() { + return v1; + } + + public AccessToken accessToken() { + return accessToken; + } + + public OidcAccessToken oidcAccessToken() { + return oidcAccessToken; + } + + public OidcRefreshAccessToken oidcRefreshAccessToken() { + return oidcRefreshAccessToken; + } + + public RefreshAccessToken refreshAccessToken() { + return refreshAccessToken; + } + + public UserInfo userInfo() { + return userInfo; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/AuthenService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/AuthenService.java deleted file mode 100644 index 7b763fdcf..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/AuthenService.java +++ /dev/null @@ -1,544 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.authen.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.authen.v1.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class AuthenService { - private static final Logger log = LoggerFactory.getLogger(AuthenService.class); - private final AccessToken accessToken; // access_token - private final Authorize authorize; // authorize - private final OidcAccessToken oidcAccessToken; // oidc.access_token - private final OidcRefreshAccessToken oidcRefreshAccessToken; // oidc.refresh_access_token - private final RefreshAccessToken refreshAccessToken; // refresh_access_token - private final UserInfo userInfo; // user_info - - public AuthenService(Config config) { - this.accessToken = new AccessToken(config); - this.authorize = new Authorize(config); - this.oidcAccessToken = new OidcAccessToken(config); - this.oidcRefreshAccessToken = new OidcRefreshAccessToken(config); - this.refreshAccessToken = new RefreshAccessToken(config); - this.userInfo = new UserInfo(config); - } - - /** - * access_token - * - * @return - */ - public AccessToken accessToken() { - return accessToken; - } - - /** - * authorize - * - * @return - */ - public Authorize authorize() { - return authorize; - } - - /** - * oidc.access_token - * - * @return - */ - public OidcAccessToken oidcAccessToken() { - return oidcAccessToken; - } - - /** - * oidc.refresh_access_token - * - * @return - */ - public OidcRefreshAccessToken oidcRefreshAccessToken() { - return oidcRefreshAccessToken; - } - - /** - * refresh_access_token - * - * @return - */ - public RefreshAccessToken refreshAccessToken() { - return refreshAccessToken; - } - - /** - * user_info - * - * @return - */ - public UserInfo userInfo() { - return userInfo; - } - - public static class AccessToken { - private final Config config; - - public AccessToken(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=access_token&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateAccessTokenSample.java ; - */ - public CreateAccessTokenResp create(CreateAccessTokenReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/authen/v1/access_token" - , Sets.newHashSet(AccessTokenType.App) - , req); - - // 反序列化 - CreateAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAccessTokenResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/authen/v1/access_token" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=access_token&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateAccessTokenSample.java ; - */ - public CreateAccessTokenResp create(CreateAccessTokenReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/authen/v1/access_token" - , Sets.newHashSet(AccessTokenType.App) - , req); - - // 反序列化 - CreateAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAccessTokenResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/authen/v1/access_token" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Authorize { - private final Config config; - - public Authorize(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=authen&resource=authorize&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/GetAuthorizeSample.java ; - */ - public GetAuthorizeResp get(GetAuthorizeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/authen/v1/authorize" - , Sets.newHashSet() - , req); - - // 反序列化 - GetAuthorizeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAuthorizeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/authen/v1/authorize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=authen&resource=authorize&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/GetAuthorizeSample.java ; - */ - public GetAuthorizeResp get(GetAuthorizeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/authen/v1/authorize" - , Sets.newHashSet() - , req); - - // 反序列化 - GetAuthorizeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAuthorizeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/authen/v1/authorize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class OidcAccessToken { - private final Config config; - - public OidcAccessToken(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=oidc.access_token&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateOidcAccessTokenSample.java ; - */ - public CreateOidcAccessTokenResp create(CreateOidcAccessTokenReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/authen/v1/oidc/access_token" - , Sets.newHashSet(AccessTokenType.App) - , req); - - // 反序列化 - CreateOidcAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateOidcAccessTokenResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/authen/v1/oidc/access_token" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=oidc.access_token&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateOidcAccessTokenSample.java ; - */ - public CreateOidcAccessTokenResp create(CreateOidcAccessTokenReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/authen/v1/oidc/access_token" - , Sets.newHashSet(AccessTokenType.App) - , req); - - // 反序列化 - CreateOidcAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateOidcAccessTokenResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/authen/v1/oidc/access_token" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class OidcRefreshAccessToken { - private final Config config; - - public OidcRefreshAccessToken(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=oidc.refresh_access_token&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateOidcRefreshAccessTokenSample.java ; - */ - public CreateOidcRefreshAccessTokenResp create(CreateOidcRefreshAccessTokenReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/authen/v1/oidc/refresh_access_token" - , Sets.newHashSet(AccessTokenType.App) - , req); - - // 反序列化 - CreateOidcRefreshAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateOidcRefreshAccessTokenResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/authen/v1/oidc/refresh_access_token" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=oidc.refresh_access_token&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateOidcRefreshAccessTokenSample.java ; - */ - public CreateOidcRefreshAccessTokenResp create(CreateOidcRefreshAccessTokenReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/authen/v1/oidc/refresh_access_token" - , Sets.newHashSet(AccessTokenType.App) - , req); - - // 反序列化 - CreateOidcRefreshAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateOidcRefreshAccessTokenResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/authen/v1/oidc/refresh_access_token" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class RefreshAccessToken { - private final Config config; - - public RefreshAccessToken(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=refresh_access_token&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateRefreshAccessTokenSample.java ; - */ - public CreateRefreshAccessTokenResp create(CreateRefreshAccessTokenReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/authen/v1/refresh_access_token" - , Sets.newHashSet(AccessTokenType.App) - , req); - - // 反序列化 - CreateRefreshAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateRefreshAccessTokenResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/authen/v1/refresh_access_token" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=refresh_access_token&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateRefreshAccessTokenSample.java ; - */ - public CreateRefreshAccessTokenResp create(CreateRefreshAccessTokenReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/authen/v1/refresh_access_token" - , Sets.newHashSet(AccessTokenType.App) - , req); - - // 反序列化 - CreateRefreshAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateRefreshAccessTokenResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/authen/v1/refresh_access_token" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class UserInfo { - private final Config config; - - public UserInfo(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=authen&resource=user_info&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/GetUserInfoSample.java ; - */ - public GetUserInfoResp get(RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/authen/v1/user_info" - , Sets.newHashSet(AccessTokenType.User) - , null); - - // 反序列化 - GetUserInfoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetUserInfoResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/authen/v1/user_info" - , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=authen&resource=user_info&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/GetUserInfoSample.java ; - */ - public GetUserInfoResp get() throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/authen/v1/user_info" - , Sets.newHashSet(AccessTokenType.User) - , null); - - // 反序列化 - GetUserInfoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetUserInfoResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/authen/v1/user_info" - , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/V1.java new file mode 100644 index 000000000..bb6809768 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/V1.java @@ -0,0 +1,53 @@ +// Code generated by lark suite 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 com.lark.oapi.service.authen.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.authen.v1.resource.*; + +public class V1 { + private final AccessToken accessToken; // access_token + private final OidcAccessToken oidcAccessToken; // oidc.access_token + private final OidcRefreshAccessToken oidcRefreshAccessToken; // oidc.refresh_access_token + private final RefreshAccessToken refreshAccessToken; // refresh_access_token + private final UserInfo userInfo; // user_info + + public V1(Config config) { + this.accessToken = new AccessToken(config); + this.oidcAccessToken = new OidcAccessToken(config); + this.oidcRefreshAccessToken = new OidcRefreshAccessToken(config); + this.refreshAccessToken = new RefreshAccessToken(config); + this.userInfo = new UserInfo(config); + } + + public AccessToken accessToken() { + return accessToken; + } + + public OidcAccessToken oidcAccessToken() { + return oidcAccessToken; + } + + public OidcRefreshAccessToken oidcRefreshAccessToken() { + return oidcRefreshAccessToken; + } + + public RefreshAccessToken refreshAccessToken() { + return refreshAccessToken; + } + + public UserInfo userInfo() { + return userInfo; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/resource/AccessToken.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/resource/AccessToken.java new file mode 100644 index 000000000..892d26ff3 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/resource/AccessToken.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.authen.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.authen.v1.model.CreateAccessTokenReq; +import com.lark.oapi.service.authen.v1.model.CreateAccessTokenResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class AccessToken { + private static final Logger log = LoggerFactory.getLogger(AccessToken.class); + private final Config config; + + public AccessToken(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=access_token&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateAccessTokenSample.java ; + */ + public CreateAccessTokenResp create(CreateAccessTokenReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/authen/v1/access_token" + , Sets.newHashSet(AccessTokenType.App) + , req); + + // 反序列化 + CreateAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAccessTokenResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/authen/v1/access_token" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=access_token&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateAccessTokenSample.java ; + */ + public CreateAccessTokenResp create(CreateAccessTokenReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/authen/v1/access_token" + , Sets.newHashSet(AccessTokenType.App) + , req); + + // 反序列化 + CreateAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAccessTokenResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/authen/v1/access_token" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/resource/OidcAccessToken.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/resource/OidcAccessToken.java new file mode 100644 index 000000000..99acf3039 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/resource/OidcAccessToken.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.authen.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.authen.v1.model.CreateOidcAccessTokenReq; +import com.lark.oapi.service.authen.v1.model.CreateOidcAccessTokenResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class OidcAccessToken { + private static final Logger log = LoggerFactory.getLogger(OidcAccessToken.class); + private final Config config; + + public OidcAccessToken(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=oidc.access_token&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateOidcAccessTokenSample.java ; + */ + public CreateOidcAccessTokenResp create(CreateOidcAccessTokenReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/authen/v1/oidc/access_token" + , Sets.newHashSet(AccessTokenType.App) + , req); + + // 反序列化 + CreateOidcAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateOidcAccessTokenResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/authen/v1/oidc/access_token" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=oidc.access_token&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateOidcAccessTokenSample.java ; + */ + public CreateOidcAccessTokenResp create(CreateOidcAccessTokenReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/authen/v1/oidc/access_token" + , Sets.newHashSet(AccessTokenType.App) + , req); + + // 反序列化 + CreateOidcAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateOidcAccessTokenResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/authen/v1/oidc/access_token" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/resource/OidcRefreshAccessToken.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/resource/OidcRefreshAccessToken.java new file mode 100644 index 000000000..689a804ce --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/resource/OidcRefreshAccessToken.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.authen.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.authen.v1.model.CreateOidcRefreshAccessTokenReq; +import com.lark.oapi.service.authen.v1.model.CreateOidcRefreshAccessTokenResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class OidcRefreshAccessToken { + private static final Logger log = LoggerFactory.getLogger(OidcRefreshAccessToken.class); + private final Config config; + + public OidcRefreshAccessToken(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=oidc.refresh_access_token&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateOidcRefreshAccessTokenSample.java ; + */ + public CreateOidcRefreshAccessTokenResp create(CreateOidcRefreshAccessTokenReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/authen/v1/oidc/refresh_access_token" + , Sets.newHashSet(AccessTokenType.App) + , req); + + // 反序列化 + CreateOidcRefreshAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateOidcRefreshAccessTokenResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/authen/v1/oidc/refresh_access_token" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=oidc.refresh_access_token&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateOidcRefreshAccessTokenSample.java ; + */ + public CreateOidcRefreshAccessTokenResp create(CreateOidcRefreshAccessTokenReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/authen/v1/oidc/refresh_access_token" + , Sets.newHashSet(AccessTokenType.App) + , req); + + // 反序列化 + CreateOidcRefreshAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateOidcRefreshAccessTokenResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/authen/v1/oidc/refresh_access_token" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/resource/RefreshAccessToken.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/resource/RefreshAccessToken.java new file mode 100644 index 000000000..e028ed875 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/resource/RefreshAccessToken.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.authen.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.authen.v1.model.CreateRefreshAccessTokenReq; +import com.lark.oapi.service.authen.v1.model.CreateRefreshAccessTokenResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class RefreshAccessToken { + private static final Logger log = LoggerFactory.getLogger(RefreshAccessToken.class); + private final Config config; + + public RefreshAccessToken(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=refresh_access_token&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateRefreshAccessTokenSample.java ; + */ + public CreateRefreshAccessTokenResp create(CreateRefreshAccessTokenReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/authen/v1/refresh_access_token" + , Sets.newHashSet(AccessTokenType.App) + , req); + + // 反序列化 + CreateRefreshAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateRefreshAccessTokenResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/authen/v1/refresh_access_token" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=refresh_access_token&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateRefreshAccessTokenSample.java ; + */ + public CreateRefreshAccessTokenResp create(CreateRefreshAccessTokenReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/authen/v1/refresh_access_token" + , Sets.newHashSet(AccessTokenType.App) + , req); + + // 反序列化 + CreateRefreshAccessTokenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateRefreshAccessTokenResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/authen/v1/refresh_access_token" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/resource/UserInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/resource/UserInfo.java new file mode 100644 index 000000000..960690ac0 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/authen/v1/resource/UserInfo.java @@ -0,0 +1,102 @@ +// Code generated by lark suite 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 com.lark.oapi.service.authen.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.authen.v1.model.GetUserInfoResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class UserInfo { + private static final Logger log = LoggerFactory.getLogger(UserInfo.class); + private final Config config; + + public UserInfo(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=authen&resource=user_info&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/GetUserInfoSample.java ; + */ + public GetUserInfoResp get(RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/authen/v1/user_info" + , Sets.newHashSet(AccessTokenType.User) + , null); + + // 反序列化 + GetUserInfoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetUserInfoResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/authen/v1/user_info" + , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=authen&resource=user_info&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/GetUserInfoSample.java ; + */ + public GetUserInfoResp get() throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/authen/v1/user_info" + , Sets.newHashSet(AccessTokenType.User) + , null); + + // 反序列化 + GetUserInfoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetUserInfoResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/authen/v1/user_info" + , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/baike/BaikeService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/baike/BaikeService.java new file mode 100644 index 000000000..a85325c13 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/baike/BaikeService.java @@ -0,0 +1,56 @@ +// Code generated by lark suite 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 com.lark.oapi.service.baike; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.baike.v1.V1; +import com.lark.oapi.service.baike.v1.resource.Classification; +import com.lark.oapi.service.baike.v1.resource.Draft; +import com.lark.oapi.service.baike.v1.resource.Entity; +import com.lark.oapi.service.baike.v1.resource.File; + +public class BaikeService { + private final V1 v1; + private final Classification classification; // 分类 + private final Draft draft; // 草稿 + private final Entity entity; // 词条 + private final File file; // 文件 + + public BaikeService(Config config) { + this.v1 = new V1(config); + this.classification = new Classification(config); + this.draft = new Draft(config); + this.entity = new Entity(config); + this.file = new File(config); + } + + public V1 v1() { + return v1; + } + + public Classification classification() { + return classification; + } + + public Draft draft() { + return draft; + } + + public Entity entity() { + return entity; + } + + public File file() { + return file; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/baike/v1/BaikeService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/baike/v1/BaikeService.java deleted file mode 100644 index 55ae9fc03..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/baike/v1/BaikeService.java +++ /dev/null @@ -1,1000 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.baike.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.baike.v1.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.ByteArrayOutputStream; -import java.nio.charset.StandardCharsets; - -public class BaikeService { - private static final Logger log = LoggerFactory.getLogger(BaikeService.class); - private final Classification classification; // 分类 - private final Draft draft; // 草稿 - private final Entity entity; // 词条 - private final File file; // 文件 - - public BaikeService(Config config) { - this.classification = new Classification(config); - this.draft = new Draft(config); - this.entity = new Entity(config); - this.file = new File(config); - } - - /** - * 分类 - * - * @return - */ - public Classification classification() { - return classification; - } - - /** - * 草稿 - * - * @return - */ - public Draft draft() { - return draft; - } - - /** - * 词条 - * - * @return - */ - public Entity entity() { - return entity; - } - - /** - * 文件 - * - * @return - */ - public File file() { - return file; - } - - public static class Classification { - private final Config config; - - public Classification(Config config) { - this.config = config; - } - - /** - * 获取百科分类,获取企业百科当前分类。;企业百科目前为二级分类体系,每个词条可添加多个二级分类,但每个一级分类下只能添加一个分类。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/classification/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/ListClassificationSample.java ; - */ - public ListClassificationResp list(ListClassificationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/baike/v1/classifications" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListClassificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListClassificationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/classifications" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取百科分类,获取企业百科当前分类。;企业百科目前为二级分类体系,每个词条可添加多个二级分类,但每个一级分类下只能添加一个分类。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/classification/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/ListClassificationSample.java ; - */ - public ListClassificationResp list(ListClassificationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/baike/v1/classifications" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListClassificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListClassificationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/classifications" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Draft { - private final Config config; - - public Draft(Config config) { - this.config = config; - } - - /** - * 创建草稿,草稿并非百科词条,而是指通过 API 发起创建新词条或更新现有词条的申请。百科管理员审核通过后,草稿将变为新的词条或覆盖已有词条。 - *

以用户身份创建草稿(即 Authorization 使用 user_access_token),对应用户将收到由企业百科 Bot 发送的审核结果;以应用身份创建草稿(即 Authorization 使用 tenant_access_toke),不会收到任何通知。 ; - *

· 创建新的百科词条时,无需传入 entity_id 字段;· 更新已有百科词条时,请传入对应词条的 entity_id 或 outer_info ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/draft/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/CreateDraftSample.java ; - */ - public CreateDraftResp create(CreateDraftReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/baike/v1/drafts" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateDraftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDraftResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/drafts" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建草稿,草稿并非百科词条,而是指通过 API 发起创建新词条或更新现有词条的申请。百科管理员审核通过后,草稿将变为新的词条或覆盖已有词条。 - *

以用户身份创建草稿(即 Authorization 使用 user_access_token),对应用户将收到由企业百科 Bot 发送的审核结果;以应用身份创建草稿(即 Authorization 使用 tenant_access_toke),不会收到任何通知。 ; - *

· 创建新的百科词条时,无需传入 entity_id 字段;· 更新已有百科词条时,请传入对应词条的 entity_id 或 outer_info ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/draft/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/CreateDraftSample.java ; - */ - public CreateDraftResp create(CreateDraftReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/baike/v1/drafts" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateDraftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDraftResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/drafts" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新草稿,根据 draft_id 更新草稿内容,已审批的草稿无法编辑 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/draft/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/UpdateDraftSample.java ; - */ - public UpdateDraftResp update(UpdateDraftReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/baike/v1/drafts/:draft_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateDraftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateDraftResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/drafts/:draft_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新草稿,根据 draft_id 更新草稿内容,已审批的草稿无法编辑 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/draft/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/UpdateDraftSample.java ; - */ - public UpdateDraftResp update(UpdateDraftReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/baike/v1/drafts/:draft_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateDraftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateDraftResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/drafts/:draft_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Entity { - private final Config config; - - public Entity(Config config) { - this.config = config; - } - - /** - * 创建免审词条,通过此接口创建的词条,不需要百科管理员审核可直接写入词库,请慎重使用【租户管理员请慎重审批】。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/CreateEntitySample.java ; - */ - public CreateEntityResp create(CreateEntityReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/baike/v1/entities" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建免审词条,通过此接口创建的词条,不需要百科管理员审核可直接写入词库,请慎重使用【租户管理员请慎重审批】。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/CreateEntitySample.java ; - */ - public CreateEntityResp create(CreateEntityReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/baike/v1/entities" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 提取潜在的百科词条,提取文本中可能成为百科词条的词语,且不会过滤已经成为百科词条的词语。同时,会返回推荐的别名。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/extract ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/ExtractEntitySample.java ; - */ - public ExtractEntityResp extract(ExtractEntityReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/baike/v1/entities/extract" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ExtractEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ExtractEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities/extract" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 提取潜在的百科词条,提取文本中可能成为百科词条的词语,且不会过滤已经成为百科词条的词语。同时,会返回推荐的别名。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/extract ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/ExtractEntitySample.java ; - */ - public ExtractEntityResp extract(ExtractEntityReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/baike/v1/entities/extract" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ExtractEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ExtractEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities/extract" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取词条详情,通过词条 id 拉取对应的词条详情信息。 - *

也支持通过 provider 和 outer_id 返回对应实体的详情数据。此时路径中的 entity_id 为固定的 enterprise_0 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/GetEntitySample.java ; - */ - public GetEntityResp get(GetEntityReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/baike/v1/entities/:entity_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities/:entity_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取词条详情,通过词条 id 拉取对应的词条详情信息。 - *

也支持通过 provider 和 outer_id 返回对应实体的详情数据。此时路径中的 entity_id 为固定的 enterprise_0 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/GetEntitySample.java ; - */ - public GetEntityResp get(GetEntityReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/baike/v1/entities/:entity_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities/:entity_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 词条高亮,传入一句话,智能识别句中对应的词条,并返回词条位置和 entity_id,可在外部系统中快速实现百科词条智能高亮。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/highlight ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/HighlightEntitySample.java ; - */ - public HighlightEntityResp highlight(HighlightEntityReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/baike/v1/entities/highlight" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - HighlightEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, HighlightEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities/highlight" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 词条高亮,传入一句话,智能识别句中对应的词条,并返回词条位置和 entity_id,可在外部系统中快速实现百科词条智能高亮。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/highlight ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/HighlightEntitySample.java ; - */ - public HighlightEntityResp highlight(HighlightEntityReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/baike/v1/entities/highlight" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - HighlightEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, HighlightEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities/highlight" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取词条列表,分页拉取词条列表数据,支持拉取租户内的全部词条。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/ListEntitySample.java ; - */ - public ListEntityResp list(ListEntityReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/baike/v1/entities" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取词条列表,分页拉取词条列表数据,支持拉取租户内的全部词条。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/ListEntitySample.java ; - */ - public ListEntityResp list(ListEntityReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/baike/v1/entities" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 精准搜索词条,将关键词与词条名、别名精准匹配,并返回对应的 词条 ID。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/match ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/MatchEntitySample.java ; - */ - public MatchEntityResp match(MatchEntityReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/baike/v1/entities/match" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - MatchEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MatchEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities/match" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 精准搜索词条,将关键词与词条名、别名精准匹配,并返回对应的 词条 ID。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/match ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/MatchEntitySample.java ; - */ - public MatchEntityResp match(MatchEntityReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/baike/v1/entities/match" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - MatchEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MatchEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities/match" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 模糊搜索词条,传入关键词,与词条名、别名、释义等信息进行模糊匹配,返回搜到的词条信息。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/search ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/SearchEntitySample.java ; - */ - public SearchEntityResp search(SearchEntityReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/baike/v1/entities/search" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - SearchEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 模糊搜索词条,传入关键词,与词条名、别名、释义等信息进行模糊匹配,返回搜到的词条信息。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/search ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/SearchEntitySample.java ; - */ - public SearchEntityResp search(SearchEntityReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/baike/v1/entities/search" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - SearchEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新免审词条,通过此接口更新已有的词条,不需要百科管理员审核可直接写入词库,请慎重使用【租户管理员请慎重审批】。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/UpdateEntitySample.java ; - */ - public UpdateEntityResp update(UpdateEntityReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/baike/v1/entities/:entity_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UpdateEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities/:entity_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新免审词条,通过此接口更新已有的词条,不需要百科管理员审核可直接写入词库,请慎重使用【租户管理员请慎重审批】。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/UpdateEntitySample.java ; - */ - public UpdateEntityResp update(UpdateEntityReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/baike/v1/entities/:entity_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UpdateEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities/:entity_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class File { - private final Config config; - - public File(Config config) { - this.config = config; - } - - /** - * 图片下载,通过 file_token 下载原图片 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/file/download ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/DownloadFileSample.java ; - */ - public DownloadFileResp download(DownloadFileReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/baike/v1/files/:file_token/download" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - if (httpResponse.getStatusCode() == 200) { - DownloadFileResp resp = new DownloadFileResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - DownloadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/files/:file_token/download" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 图片下载,通过 file_token 下载原图片 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/file/download ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/DownloadFileSample.java ; - */ - public DownloadFileResp download(DownloadFileReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/baike/v1/files/:file_token/download" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 下载请求,返回流 - if (httpResponse.getStatusCode() == 200) { - DownloadFileResp resp = new DownloadFileResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - DownloadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/files/:file_token/download" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 图片上传,百科词条图片资源上传。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/file/upload ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/UploadFileSample.java ; - */ - public UploadFileResp upload(UploadFileReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/baike/v1/files/upload" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UploadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/files/upload" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 图片上传,百科词条图片资源上传。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/file/upload ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/UploadFileSample.java ; - */ - public UploadFileResp upload(UploadFileReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/baike/v1/files/upload" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UploadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/files/upload" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/baike/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/baike/v1/V1.java new file mode 100644 index 000000000..a2523f586 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/baike/v1/V1.java @@ -0,0 +1,50 @@ +// Code generated by lark suite 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 com.lark.oapi.service.baike.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.baike.v1.resource.Classification; +import com.lark.oapi.service.baike.v1.resource.Draft; +import com.lark.oapi.service.baike.v1.resource.Entity; +import com.lark.oapi.service.baike.v1.resource.File; + +public class V1 { + private final Classification classification; // 分类 + private final Draft draft; // 草稿 + private final Entity entity; // 词条 + private final File file; // 文件 + + public V1(Config config) { + this.classification = new Classification(config); + this.draft = new Draft(config); + this.entity = new Entity(config); + this.file = new File(config); + } + + public Classification classification() { + return classification; + } + + public Draft draft() { + return draft; + } + + public Entity entity() { + return entity; + } + + public File file() { + return file; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/baike/v1/resource/Classification.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/baike/v1/resource/Classification.java new file mode 100644 index 000000000..d4b915f5c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/baike/v1/resource/Classification.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.baike.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.baike.v1.model.ListClassificationReq; +import com.lark.oapi.service.baike.v1.model.ListClassificationResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Classification { + private static final Logger log = LoggerFactory.getLogger(Classification.class); + private final Config config; + + public Classification(Config config) { + this.config = config; + } + + + /** + * 获取百科分类,获取企业百科当前分类。;企业百科目前为二级分类体系,每个词条可添加多个二级分类,但每个一级分类下只能添加一个分类。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/classification/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/ListClassificationSample.java ; + */ + public ListClassificationResp list(ListClassificationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/baike/v1/classifications" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListClassificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListClassificationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/classifications" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取百科分类,获取企业百科当前分类。;企业百科目前为二级分类体系,每个词条可添加多个二级分类,但每个一级分类下只能添加一个分类。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/classification/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/ListClassificationSample.java ; + */ + public ListClassificationResp list(ListClassificationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/baike/v1/classifications" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListClassificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListClassificationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/classifications" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/baike/v1/resource/Draft.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/baike/v1/resource/Draft.java new file mode 100644 index 000000000..66e5378b6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/baike/v1/resource/Draft.java @@ -0,0 +1,177 @@ +// Code generated by lark suite 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 com.lark.oapi.service.baike.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.baike.v1.model.CreateDraftReq; +import com.lark.oapi.service.baike.v1.model.CreateDraftResp; +import com.lark.oapi.service.baike.v1.model.UpdateDraftReq; +import com.lark.oapi.service.baike.v1.model.UpdateDraftResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Draft { + private static final Logger log = LoggerFactory.getLogger(Draft.class); + private final Config config; + + public Draft(Config config) { + this.config = config; + } + + + /** + * 创建草稿,草稿并非百科词条,而是指通过 API 发起创建新词条或更新现有词条的申请。百科管理员审核通过后,草稿将变为新的词条或覆盖已有词条。 + *

以用户身份创建草稿(即 Authorization 使用 user_access_token),对应用户将收到由企业百科 Bot 发送的审核结果;以应用身份创建草稿(即 Authorization 使用 tenant_access_toke),不会收到任何通知。 ; + *

· 创建新的百科词条时,无需传入 entity_id 字段;· 更新已有百科词条时,请传入对应词条的 entity_id 或 outer_info ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/draft/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/CreateDraftSample.java ; + */ + public CreateDraftResp create(CreateDraftReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/baike/v1/drafts" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateDraftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDraftResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/drafts" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建草稿,草稿并非百科词条,而是指通过 API 发起创建新词条或更新现有词条的申请。百科管理员审核通过后,草稿将变为新的词条或覆盖已有词条。 + *

以用户身份创建草稿(即 Authorization 使用 user_access_token),对应用户将收到由企业百科 Bot 发送的审核结果;以应用身份创建草稿(即 Authorization 使用 tenant_access_toke),不会收到任何通知。 ; + *

· 创建新的百科词条时,无需传入 entity_id 字段;· 更新已有百科词条时,请传入对应词条的 entity_id 或 outer_info ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/draft/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/CreateDraftSample.java ; + */ + public CreateDraftResp create(CreateDraftReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/baike/v1/drafts" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateDraftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDraftResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/drafts" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新草稿,根据 draft_id 更新草稿内容,已审批的草稿无法编辑 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/draft/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/UpdateDraftSample.java ; + */ + public UpdateDraftResp update(UpdateDraftReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/baike/v1/drafts/:draft_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateDraftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateDraftResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/drafts/:draft_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新草稿,根据 draft_id 更新草稿内容,已审批的草稿无法编辑 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/draft/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/UpdateDraftSample.java ; + */ + public UpdateDraftResp update(UpdateDraftReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/baike/v1/drafts/:draft_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateDraftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateDraftResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/drafts/:draft_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/baike/v1/resource/Entity.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/baike/v1/resource/Entity.java new file mode 100644 index 000000000..7badce919 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/baike/v1/resource/Entity.java @@ -0,0 +1,568 @@ +// Code generated by lark suite 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 com.lark.oapi.service.baike.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.baike.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Entity { + private static final Logger log = LoggerFactory.getLogger(Entity.class); + private final Config config; + + public Entity(Config config) { + this.config = config; + } + + + /** + * 创建免审词条,通过此接口创建的词条,不需要百科管理员审核可直接写入词库,请慎重使用【租户管理员请慎重审批】。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/CreateEntitySample.java ; + */ + public CreateEntityResp create(CreateEntityReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/baike/v1/entities" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建免审词条,通过此接口创建的词条,不需要百科管理员审核可直接写入词库,请慎重使用【租户管理员请慎重审批】。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/CreateEntitySample.java ; + */ + public CreateEntityResp create(CreateEntityReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/baike/v1/entities" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 提取潜在的百科词条,提取文本中可能成为百科词条的词语,且不会过滤已经成为百科词条的词语。同时,会返回推荐的别名。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/extract ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/ExtractEntitySample.java ; + */ + public ExtractEntityResp extract(ExtractEntityReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/baike/v1/entities/extract" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ExtractEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ExtractEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities/extract" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 提取潜在的百科词条,提取文本中可能成为百科词条的词语,且不会过滤已经成为百科词条的词语。同时,会返回推荐的别名。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/extract ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/ExtractEntitySample.java ; + */ + public ExtractEntityResp extract(ExtractEntityReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/baike/v1/entities/extract" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ExtractEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ExtractEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities/extract" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取词条详情,通过词条 id 拉取对应的词条详情信息。 + *

也支持通过 provider 和 outer_id 返回对应实体的详情数据。此时路径中的 entity_id 为固定的 enterprise_0 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/GetEntitySample.java ; + */ + public GetEntityResp get(GetEntityReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/baike/v1/entities/:entity_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities/:entity_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取词条详情,通过词条 id 拉取对应的词条详情信息。 + *

也支持通过 provider 和 outer_id 返回对应实体的详情数据。此时路径中的 entity_id 为固定的 enterprise_0 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/GetEntitySample.java ; + */ + public GetEntityResp get(GetEntityReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/baike/v1/entities/:entity_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities/:entity_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 词条高亮,传入一句话,智能识别句中对应的词条,并返回词条位置和 entity_id,可在外部系统中快速实现百科词条智能高亮。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/highlight ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/HighlightEntitySample.java ; + */ + public HighlightEntityResp highlight(HighlightEntityReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/baike/v1/entities/highlight" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + HighlightEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, HighlightEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities/highlight" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 词条高亮,传入一句话,智能识别句中对应的词条,并返回词条位置和 entity_id,可在外部系统中快速实现百科词条智能高亮。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/highlight ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/HighlightEntitySample.java ; + */ + public HighlightEntityResp highlight(HighlightEntityReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/baike/v1/entities/highlight" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + HighlightEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, HighlightEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities/highlight" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取词条列表,分页拉取词条列表数据,支持拉取租户内的全部词条。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/ListEntitySample.java ; + */ + public ListEntityResp list(ListEntityReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/baike/v1/entities" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取词条列表,分页拉取词条列表数据,支持拉取租户内的全部词条。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/ListEntitySample.java ; + */ + public ListEntityResp list(ListEntityReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/baike/v1/entities" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 精准搜索词条,将关键词与词条名、别名精准匹配,并返回对应的 词条 ID。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/match ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/MatchEntitySample.java ; + */ + public MatchEntityResp match(MatchEntityReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/baike/v1/entities/match" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + MatchEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MatchEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities/match" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 精准搜索词条,将关键词与词条名、别名精准匹配,并返回对应的 词条 ID。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/match ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/MatchEntitySample.java ; + */ + public MatchEntityResp match(MatchEntityReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/baike/v1/entities/match" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + MatchEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MatchEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities/match" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 模糊搜索词条,传入关键词,与词条名、别名、释义等信息进行模糊匹配,返回搜到的词条信息。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/search ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/SearchEntitySample.java ; + */ + public SearchEntityResp search(SearchEntityReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/baike/v1/entities/search" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + SearchEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 模糊搜索词条,传入关键词,与词条名、别名、释义等信息进行模糊匹配,返回搜到的词条信息。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/search ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/SearchEntitySample.java ; + */ + public SearchEntityResp search(SearchEntityReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/baike/v1/entities/search" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + SearchEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新免审词条,通过此接口更新已有的词条,不需要百科管理员审核可直接写入词库,请慎重使用【租户管理员请慎重审批】。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/UpdateEntitySample.java ; + */ + public UpdateEntityResp update(UpdateEntityReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/baike/v1/entities/:entity_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UpdateEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities/:entity_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新免审词条,通过此接口更新已有的词条,不需要百科管理员审核可直接写入词库,请慎重使用【租户管理员请慎重审批】。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/UpdateEntitySample.java ; + */ + public UpdateEntityResp update(UpdateEntityReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/baike/v1/entities/:entity_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UpdateEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/entities/:entity_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/baike/v1/resource/File.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/baike/v1/resource/File.java new file mode 100644 index 000000000..e3f66a04d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/baike/v1/resource/File.java @@ -0,0 +1,197 @@ +// Code generated by lark suite 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 com.lark.oapi.service.baike.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.baike.v1.model.DownloadFileReq; +import com.lark.oapi.service.baike.v1.model.DownloadFileResp; +import com.lark.oapi.service.baike.v1.model.UploadFileReq; +import com.lark.oapi.service.baike.v1.model.UploadFileResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.ByteArrayOutputStream; +import java.nio.charset.StandardCharsets; + +public class File { + private static final Logger log = LoggerFactory.getLogger(File.class); + private final Config config; + + public File(Config config) { + this.config = config; + } + + + /** + * 图片下载,通过 file_token 下载原图片 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/file/download ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/DownloadFileSample.java ; + */ + public DownloadFileResp download(DownloadFileReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/baike/v1/files/:file_token/download" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + if (httpResponse.getStatusCode() == 200) { + DownloadFileResp resp = new DownloadFileResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + DownloadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/files/:file_token/download" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 图片下载,通过 file_token 下载原图片 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/file/download ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/DownloadFileSample.java ; + */ + public DownloadFileResp download(DownloadFileReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/baike/v1/files/:file_token/download" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 下载请求,返回流 + if (httpResponse.getStatusCode() == 200) { + DownloadFileResp resp = new DownloadFileResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + DownloadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/files/:file_token/download" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 图片上传,百科词条图片资源上传。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/file/upload ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/UploadFileSample.java ; + */ + public UploadFileResp upload(UploadFileReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/baike/v1/files/upload" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UploadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/files/upload" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 图片上传,百科词条图片资源上传。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/file/upload ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/UploadFileSample.java ; + */ + public UploadFileResp upload(UploadFileReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/baike/v1/files/upload" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UploadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/baike/v1/files/upload" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/BitableService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/BitableService.java new file mode 100644 index 000000000..32b5ca4f5 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/BitableService.java @@ -0,0 +1,89 @@ +// Code generated by lark suite 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 com.lark.oapi.service.bitable; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.bitable.v1.V1; +import com.lark.oapi.service.bitable.v1.resource.*; + +public class BitableService { + private final V1 v1; + private final App app; // 多维表格 + private final AppDashboard appDashboard; // 仪表盘 + private final AppRole appRole; // 自定义角色 + private final AppRoleMember appRoleMember; // 协作者 + private final AppTable appTable; // 数据表 + private final AppTableField appTableField; // 字段 + private final AppTableForm appTableForm; // 表单 + private final AppTableFormField appTableFormField; // 表单 + private final AppTableRecord appTableRecord; // 记录 + private final AppTableView appTableView; // 视图 + + public BitableService(Config config) { + this.v1 = new V1(config); + this.app = new App(config); + this.appDashboard = new AppDashboard(config); + this.appRole = new AppRole(config); + this.appRoleMember = new AppRoleMember(config); + this.appTable = new AppTable(config); + this.appTableField = new AppTableField(config); + this.appTableForm = new AppTableForm(config); + this.appTableFormField = new AppTableFormField(config); + this.appTableRecord = new AppTableRecord(config); + this.appTableView = new AppTableView(config); + } + + public V1 v1() { + return v1; + } + + public App app() { + return app; + } + + public AppDashboard appDashboard() { + return appDashboard; + } + + public AppRole appRole() { + return appRole; + } + + public AppRoleMember appRoleMember() { + return appRoleMember; + } + + public AppTable appTable() { + return appTable; + } + + public AppTableField appTableField() { + return appTableField; + } + + public AppTableForm appTableForm() { + return appTableForm; + } + + public AppTableFormField appTableFormField() { + return appTableFormField; + } + + public AppTableRecord appTableRecord() { + return appTableRecord; + } + + public AppTableView appTableView() { + return appTableView; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/BitableService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/BitableService.java deleted file mode 100644 index 84cefde1f..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/BitableService.java +++ /dev/null @@ -1,3056 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.bitable.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.bitable.v1.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class BitableService { - private static final Logger log = LoggerFactory.getLogger(BitableService.class); - private final App app; // 多维表格 - private final AppDashboard appDashboard; // 仪表盘 - private final AppRole appRole; // 自定义角色 - private final AppRoleMember appRoleMember; // 协作者 - private final AppTable appTable; // 数据表 - private final AppTableField appTableField; // 字段 - private final AppTableForm appTableForm; // 表单 - private final AppTableFormField appTableFormField; // 表单 - private final AppTableRecord appTableRecord; // 记录 - private final AppTableView appTableView; // 视图 - - public BitableService(Config config) { - this.app = new App(config); - this.appDashboard = new AppDashboard(config); - this.appRole = new AppRole(config); - this.appRoleMember = new AppRoleMember(config); - this.appTable = new AppTable(config); - this.appTableField = new AppTableField(config); - this.appTableForm = new AppTableForm(config); - this.appTableFormField = new AppTableFormField(config); - this.appTableRecord = new AppTableRecord(config); - this.appTableView = new AppTableView(config); - } - - /** - * 多维表格 - * - * @return - */ - public App app() { - return app; - } - - /** - * 仪表盘 - * - * @return - */ - public AppDashboard appDashboard() { - return appDashboard; - } - - /** - * 自定义角色 - * - * @return - */ - public AppRole appRole() { - return appRole; - } - - /** - * 协作者 - * - * @return - */ - public AppRoleMember appRoleMember() { - return appRoleMember; - } - - /** - * 数据表 - * - * @return - */ - public AppTable appTable() { - return appTable; - } - - /** - * 字段 - * - * @return - */ - public AppTableField appTableField() { - return appTableField; - } - - /** - * 表单 - * - * @return - */ - public AppTableForm appTableForm() { - return appTableForm; - } - - /** - * 表单 - * - * @return - */ - public AppTableFormField appTableFormField() { - return appTableFormField; - } - - /** - * 记录 - * - * @return - */ - public AppTableRecord appTableRecord() { - return appTableRecord; - } - - /** - * 视图 - * - * @return - */ - public AppTableView appTableView() { - return appTableView; - } - - public static class App { - private final Config config; - - public App(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=copy&project=bitable&resource=app&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CopyAppSample.java ; - */ - public CopyAppResp copy(CopyAppReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/copy" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CopyAppResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CopyAppResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/copy" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=copy&project=bitable&resource=app&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CopyAppSample.java ; - */ - public CopyAppResp copy(CopyAppReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/copy" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CopyAppResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CopyAppResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/copy" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=bitable&resource=app&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppSample.java ; - */ - public CreateAppResp create(CreateAppReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateAppResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=bitable&resource=app&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppSample.java ; - */ - public CreateAppResp create(CreateAppReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateAppResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取多维表格元数据,获取指定多维表格的元数据信息,包括多维表格名称,多维表格版本号,多维表格是否开启高级权限等。 - *

该接口支持调用频率上限为 20 QPS(Query Per Second,每秒请求率) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppSample.java ; - */ - public GetAppResp get(GetAppReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/bitable/v1/apps/:app_token" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetAppResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAppResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取多维表格元数据,获取指定多维表格的元数据信息,包括多维表格名称,多维表格版本号,多维表格是否开启高级权限等。 - *

该接口支持调用频率上限为 20 QPS(Query Per Second,每秒请求率) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppSample.java ; - */ - public GetAppResp get(GetAppReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/bitable/v1/apps/:app_token" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetAppResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAppResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新多维表格元数据,通过 app_token 更新多维表格元数据 - *

- 飞书文档、飞书表格、知识库中的多维表格不支持开启高级权限;- 此接口非原子操作,先修改多维表格名字,后开关高级权限。可能存在部分成功的情况 ; - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppSample.java ; - */ - public UpdateAppResp update(UpdateAppReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/bitable/v1/apps/:app_token" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateAppResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateAppResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新多维表格元数据,通过 app_token 更新多维表格元数据 - *

- 飞书文档、飞书表格、知识库中的多维表格不支持开启高级权限;- 此接口非原子操作,先修改多维表格名字,后开关高级权限。可能存在部分成功的情况 ; - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppSample.java ; - */ - public UpdateAppResp update(UpdateAppReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/bitable/v1/apps/:app_token" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateAppResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateAppResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class AppDashboard { - private final Config config; - - public AppDashboard(Config config) { - this.config = config; - } - - /** - * 复制仪表盘,该接口用于根据现有仪表盘复制出新的仪表盘 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-dashboard/copy ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CopyAppDashboardSample.java ; - */ - public CopyAppDashboardResp copy(CopyAppDashboardReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/dashboards/:block_id/copy" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CopyAppDashboardResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CopyAppDashboardResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/dashboards/:block_id/copy" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 复制仪表盘,该接口用于根据现有仪表盘复制出新的仪表盘 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-dashboard/copy ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CopyAppDashboardSample.java ; - */ - public CopyAppDashboardResp copy(CopyAppDashboardReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/dashboards/:block_id/copy" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CopyAppDashboardResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CopyAppDashboardResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/dashboards/:block_id/copy" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 列出仪表盘,根据 app_token,获取多维表格下的所有仪表盘 - *

该接口支持调用频率上限为 20 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-dashboard/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppDashboardSample.java ; - */ - public ListAppDashboardResp list(ListAppDashboardReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/bitable/v1/apps/:app_token/dashboards" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListAppDashboardResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppDashboardResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/dashboards" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 列出仪表盘,根据 app_token,获取多维表格下的所有仪表盘 - *

该接口支持调用频率上限为 20 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-dashboard/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppDashboardSample.java ; - */ - public ListAppDashboardResp list(ListAppDashboardReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/bitable/v1/apps/:app_token/dashboards" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListAppDashboardResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppDashboardResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/dashboards" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class AppRole { - private final Config config; - - public AppRole(Config config) { - this.config = config; - } - - /** - * 新增自定义角色,新增自定义角色 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppRoleSample.java ; - */ - public CreateAppRoleResp create(CreateAppRoleReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/roles" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateAppRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppRoleResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 新增自定义角色,新增自定义角色 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppRoleSample.java ; - */ - public CreateAppRoleResp create(CreateAppRoleReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/roles" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateAppRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppRoleResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除自定义角色,删除自定义角色 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppRoleSample.java ; - */ - public DeleteAppRoleResp delete(DeleteAppRoleReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteAppRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAppRoleResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除自定义角色,删除自定义角色 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppRoleSample.java ; - */ - public DeleteAppRoleResp delete(DeleteAppRoleReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteAppRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAppRoleResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 列出自定义角色,列出自定义角色 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppRoleSample.java ; - */ - public ListAppRoleResp list(ListAppRoleReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/bitable/v1/apps/:app_token/roles" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListAppRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppRoleResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 列出自定义角色,列出自定义角色 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppRoleSample.java ; - */ - public ListAppRoleResp list(ListAppRoleReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/bitable/v1/apps/:app_token/roles" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListAppRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppRoleResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新自定义角色,更新自定义角色 - *

更新自定义角色是全量更新,会完全覆盖旧的自定义角色设置 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppRoleSample.java ; - */ - public UpdateAppRoleResp update(UpdateAppRoleReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateAppRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateAppRoleResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新自定义角色,更新自定义角色 - *

更新自定义角色是全量更新,会完全覆盖旧的自定义角色设置 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppRoleSample.java ; - */ - public UpdateAppRoleResp update(UpdateAppRoleReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateAppRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateAppRoleResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class AppRoleMember { - private final Config config; - - public AppRoleMember(Config config) { - this.config = config; - } - - /** - * 批量新增协作者,批量新增自定义角色的协作者 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/batch_create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchCreateAppRoleMemberSample.java ; - */ - public BatchCreateAppRoleMemberResp batchCreate(BatchCreateAppRoleMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_create" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - BatchCreateAppRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateAppRoleMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_create" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量新增协作者,批量新增自定义角色的协作者 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/batch_create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchCreateAppRoleMemberSample.java ; - */ - public BatchCreateAppRoleMemberResp batchCreate(BatchCreateAppRoleMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_create" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - BatchCreateAppRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateAppRoleMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_create" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量删除协作者,批量删除自定义角色的协作者 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/batch_delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchDeleteAppRoleMemberSample.java ; - */ - public BatchDeleteAppRoleMemberResp batchDelete(BatchDeleteAppRoleMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_delete" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - BatchDeleteAppRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteAppRoleMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量删除协作者,批量删除自定义角色的协作者 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/batch_delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchDeleteAppRoleMemberSample.java ; - */ - public BatchDeleteAppRoleMemberResp batchDelete(BatchDeleteAppRoleMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_delete" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - BatchDeleteAppRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteAppRoleMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 新增协作者,新增自定义角色的协作者 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppRoleMemberSample.java ; - */ - public CreateAppRoleMemberResp create(CreateAppRoleMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateAppRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppRoleMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 新增协作者,新增自定义角色的协作者 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppRoleMemberSample.java ; - */ - public CreateAppRoleMemberResp create(CreateAppRoleMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateAppRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppRoleMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除协作者,删除自定义角色的协作者 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppRoleMemberSample.java ; - */ - public DeleteAppRoleMemberResp delete(DeleteAppRoleMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/:member_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteAppRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAppRoleMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/:member_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除协作者,删除自定义角色的协作者 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppRoleMemberSample.java ; - */ - public DeleteAppRoleMemberResp delete(DeleteAppRoleMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/:member_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteAppRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAppRoleMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/:member_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 列出协作者,列出自定义角色的协作者 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppRoleMemberSample.java ; - */ - public ListAppRoleMemberResp list(ListAppRoleMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListAppRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppRoleMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 列出协作者,列出自定义角色的协作者 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppRoleMemberSample.java ; - */ - public ListAppRoleMemberResp list(ListAppRoleMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListAppRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppRoleMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class AppTable { - private final Config config; - - public AppTable(Config config) { - this.config = config; - } - - /** - * 新增多个数据表,新增多个数据表 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/batch_create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchCreateAppTableSample.java ; - */ - public BatchCreateAppTableResp batchCreate(BatchCreateAppTableReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/tables/batch_create" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchCreateAppTableResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateAppTableResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/batch_create" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 新增多个数据表,新增多个数据表 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/batch_create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchCreateAppTableSample.java ; - */ - public BatchCreateAppTableResp batchCreate(BatchCreateAppTableReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/tables/batch_create" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchCreateAppTableResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateAppTableResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/batch_create" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除多个数据表,删除多个数据表 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/batch_delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchDeleteAppTableSample.java ; - */ - public BatchDeleteAppTableResp batchDelete(BatchDeleteAppTableReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/tables/batch_delete" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchDeleteAppTableResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteAppTableResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除多个数据表,删除多个数据表 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/batch_delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchDeleteAppTableSample.java ; - */ - public BatchDeleteAppTableResp batchDelete(BatchDeleteAppTableReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/tables/batch_delete" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchDeleteAppTableResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteAppTableResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 新增数据表,新增一个数据表 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableSample.java ; - */ - public CreateAppTableResp create(CreateAppTableReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/tables" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateAppTableResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppTableResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 新增数据表,新增一个数据表 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableSample.java ; - */ - public CreateAppTableResp create(CreateAppTableReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/tables" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateAppTableResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppTableResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除数据表,删除一个数据表 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableSample.java ; - */ - public DeleteAppTableResp delete(DeleteAppTableReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteAppTableResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAppTableResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除数据表,删除一个数据表 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableSample.java ; - */ - public DeleteAppTableResp delete(DeleteAppTableReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteAppTableResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAppTableResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 列出数据表,根据 app_token,获取多维表格下的所有数据表 - *

该接口支持调用频率上限为 20 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableSample.java ; - */ - public ListAppTableResp list(ListAppTableReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/bitable/v1/apps/:app_token/tables" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListAppTableResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppTableResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 列出数据表,根据 app_token,获取多维表格下的所有数据表 - *

该接口支持调用频率上限为 20 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableSample.java ; - */ - public ListAppTableResp list(ListAppTableReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/bitable/v1/apps/:app_token/tables" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListAppTableResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppTableResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableSample.java ; - */ - public PatchAppTableResp patch(PatchAppTableReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchAppTableResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAppTableResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableSample.java ; - */ - public PatchAppTableResp patch(PatchAppTableReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchAppTableResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAppTableResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class AppTableField { - private final Config config; - - public AppTableField(Config config) { - this.config = config; - } - - /** - * 新增字段,该接口用于在数据表中新增一个字段 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-field/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableFieldSample.java ; - */ - public CreateAppTableFieldResp create(CreateAppTableFieldReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateAppTableFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppTableFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 新增字段,该接口用于在数据表中新增一个字段 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-field/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableFieldSample.java ; - */ - public CreateAppTableFieldResp create(CreateAppTableFieldReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateAppTableFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppTableFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除字段,该接口用于在数据表中删除一个字段 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-field/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableFieldSample.java ; - */ - public DeleteAppTableFieldResp delete(DeleteAppTableFieldReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteAppTableFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAppTableFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除字段,该接口用于在数据表中删除一个字段 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-field/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableFieldSample.java ; - */ - public DeleteAppTableFieldResp delete(DeleteAppTableFieldReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteAppTableFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAppTableFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 列出字段,根据 app_token 和 table_id,获取数据表的所有字段 - *

该接口支持调用频率上限为 20 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-field/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableFieldSample.java ; - */ - public ListAppTableFieldResp list(ListAppTableFieldReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListAppTableFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppTableFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 列出字段,根据 app_token 和 table_id,获取数据表的所有字段 - *

该接口支持调用频率上限为 20 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-field/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableFieldSample.java ; - */ - public ListAppTableFieldResp list(ListAppTableFieldReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListAppTableFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppTableFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新字段,该接口用于在数据表中更新一个字段 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-field/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppTableFieldSample.java ; - */ - public UpdateAppTableFieldResp update(UpdateAppTableFieldReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateAppTableFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateAppTableFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新字段,该接口用于在数据表中更新一个字段 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-field/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppTableFieldSample.java ; - */ - public UpdateAppTableFieldResp update(UpdateAppTableFieldReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateAppTableFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateAppTableFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class AppTableForm { - private final Config config; - - public AppTableForm(Config config) { - this.config = config; - } - - /** - * 获取表单元数据,获取表单的所有元数据项 - *

该接口支持调用频率上限为 20 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-form/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppTableFormSample.java ; - */ - public GetAppTableFormResp get(GetAppTableFormReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetAppTableFormResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAppTableFormResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取表单元数据,获取表单的所有元数据项 - *

该接口支持调用频率上限为 20 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-form/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppTableFormSample.java ; - */ - public GetAppTableFormResp get(GetAppTableFormReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetAppTableFormResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAppTableFormResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新表单元数据,该接口用于更新表单中的元数据项 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-form/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableFormSample.java ; - */ - public PatchAppTableFormResp patch(PatchAppTableFormReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchAppTableFormResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAppTableFormResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新表单元数据,该接口用于更新表单中的元数据项 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-form/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableFormSample.java ; - */ - public PatchAppTableFormResp patch(PatchAppTableFormReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchAppTableFormResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAppTableFormResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class AppTableFormField { - private final Config config; - - public AppTableFormField(Config config) { - this.config = config; - } - - /** - * 列出表单问题,列出表单的所有问题项 - *

该接口支持调用频率上限为 20 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-form-field/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableFormFieldSample.java ; - */ - public ListAppTableFormFieldResp list(ListAppTableFormFieldReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListAppTableFormFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppTableFormFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 列出表单问题,列出表单的所有问题项 - *

该接口支持调用频率上限为 20 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-form-field/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableFormFieldSample.java ; - */ - public ListAppTableFormFieldResp list(ListAppTableFormFieldReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListAppTableFormFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppTableFormFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新表单问题,该接口用于更新表单中的问题项 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-form-field/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableFormFieldSample.java ; - */ - public PatchAppTableFormFieldResp patch(PatchAppTableFormFieldReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields/:field_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchAppTableFormFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAppTableFormFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields/:field_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新表单问题,该接口用于更新表单中的问题项 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-form-field/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableFormFieldSample.java ; - */ - public PatchAppTableFormFieldResp patch(PatchAppTableFormFieldReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields/:field_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchAppTableFormFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAppTableFormFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields/:field_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class AppTableRecord { - private final Config config; - - public AppTableRecord(Config config) { - this.config = config; - } - - /** - * 新增多条记录,该接口用于在数据表中新增多条记录,单次调用最多新增 500 条记录。 - *

该接口支持调用频率上限为 10 QPS(Query Per Second,每秒请求率) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/batch_create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchCreateAppTableRecordSample.java ; - */ - public BatchCreateAppTableRecordResp batchCreate(BatchCreateAppTableRecordReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_create" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchCreateAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateAppTableRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_create" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 新增多条记录,该接口用于在数据表中新增多条记录,单次调用最多新增 500 条记录。 - *

该接口支持调用频率上限为 10 QPS(Query Per Second,每秒请求率) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/batch_create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchCreateAppTableRecordSample.java ; - */ - public BatchCreateAppTableRecordResp batchCreate(BatchCreateAppTableRecordReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_create" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchCreateAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateAppTableRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_create" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除多条记录,该接口用于删除数据表中现有的多条记录,单次调用中最多删除 500 条记录。 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/batch_delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchDeleteAppTableRecordSample.java ; - */ - public BatchDeleteAppTableRecordResp batchDelete(BatchDeleteAppTableRecordReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_delete" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchDeleteAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteAppTableRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除多条记录,该接口用于删除数据表中现有的多条记录,单次调用中最多删除 500 条记录。 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/batch_delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchDeleteAppTableRecordSample.java ; - */ - public BatchDeleteAppTableRecordResp batchDelete(BatchDeleteAppTableRecordReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_delete" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchDeleteAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteAppTableRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新多条记录,该接口用于更新数据表中的多条记录,单次调用最多更新 500 条记录。 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/batch_update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchUpdateAppTableRecordSample.java ; - */ - public BatchUpdateAppTableRecordResp batchUpdate(BatchUpdateAppTableRecordReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_update" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchUpdateAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUpdateAppTableRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_update" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新多条记录,该接口用于更新数据表中的多条记录,单次调用最多更新 500 条记录。 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/batch_update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchUpdateAppTableRecordSample.java ; - */ - public BatchUpdateAppTableRecordResp batchUpdate(BatchUpdateAppTableRecordReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_update" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchUpdateAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUpdateAppTableRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_update" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 新增记录,该接口用于在数据表中新增一条记录 - *

该接口支持调用频率上限为 10 QPS(Query Per Second,每秒请求率) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableRecordSample.java ; - */ - public CreateAppTableRecordResp create(CreateAppTableRecordReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppTableRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 新增记录,该接口用于在数据表中新增一条记录 - *

该接口支持调用频率上限为 10 QPS(Query Per Second,每秒请求率) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableRecordSample.java ; - */ - public CreateAppTableRecordResp create(CreateAppTableRecordReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppTableRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除记录,该接口用于删除数据表中的一条记录 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableRecordSample.java ; - */ - public DeleteAppTableRecordResp delete(DeleteAppTableRecordReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAppTableRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除记录,该接口用于删除数据表中的一条记录 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableRecordSample.java ; - */ - public DeleteAppTableRecordResp delete(DeleteAppTableRecordReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAppTableRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 检索记录,该接口用于根据 record_id 的值检索现有记录 - *

该接口支持调用频率上限为 20 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppTableRecordSample.java ; - */ - public GetAppTableRecordResp get(GetAppTableRecordReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAppTableRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 检索记录,该接口用于根据 record_id 的值检索现有记录 - *

该接口支持调用频率上限为 20 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppTableRecordSample.java ; - */ - public GetAppTableRecordResp get(GetAppTableRecordReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAppTableRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 列出记录,该接口用于列出数据表中的现有记录,单次最多列出 500 行记录,支持分页获取。 - *

该接口支持调用频率上限为 10 QPS(Query Per Second,每秒请求率),1000 QPM(Query Per Minute,每分钟请求率) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableRecordSample.java ; - */ - public ListAppTableRecordResp list(ListAppTableRecordReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppTableRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 列出记录,该接口用于列出数据表中的现有记录,单次最多列出 500 行记录,支持分页获取。 - *

该接口支持调用频率上限为 10 QPS(Query Per Second,每秒请求率),1000 QPM(Query Per Minute,每分钟请求率) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableRecordSample.java ; - */ - public ListAppTableRecordResp list(ListAppTableRecordReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppTableRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新记录,该接口用于更新数据表中的一条记录 - *

该接口支持调用频率上限为 10 QPS(Query Per Second,每秒请求率) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppTableRecordSample.java ; - */ - public UpdateAppTableRecordResp update(UpdateAppTableRecordReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateAppTableRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新记录,该接口用于更新数据表中的一条记录 - *

该接口支持调用频率上限为 10 QPS(Query Per Second,每秒请求率) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppTableRecordSample.java ; - */ - public UpdateAppTableRecordResp update(UpdateAppTableRecordReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateAppTableRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class AppTableView { - private final Config config; - - public AppTableView(Config config) { - this.config = config; - } - - /** - * 新增视图,在数据表中新增一个视图 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableViewSample.java ; - */ - public CreateAppTableViewResp create(CreateAppTableViewReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateAppTableViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppTableViewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 新增视图,在数据表中新增一个视图 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableViewSample.java ; - */ - public CreateAppTableViewResp create(CreateAppTableViewReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateAppTableViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppTableViewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除视图,删除数据表中的视图 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableViewSample.java ; - */ - public DeleteAppTableViewResp delete(DeleteAppTableViewReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteAppTableViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAppTableViewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除视图,删除数据表中的视图 - *

该接口支持调用频率上限为 10 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableViewSample.java ; - */ - public DeleteAppTableViewResp delete(DeleteAppTableViewReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteAppTableViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAppTableViewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 检索视图,该接口根据 view_id 检索现有视图 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppTableViewSample.java ; - */ - public GetAppTableViewResp get(GetAppTableViewReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetAppTableViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAppTableViewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 检索视图,该接口根据 view_id 检索现有视图 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppTableViewSample.java ; - */ - public GetAppTableViewResp get(GetAppTableViewReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetAppTableViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAppTableViewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 列出视图,根据 app_token 和 table_id,获取数据表的所有视图 - *

该接口支持调用频率上限为 20 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableViewSample.java ; - */ - public ListAppTableViewResp list(ListAppTableViewReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListAppTableViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppTableViewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 列出视图,根据 app_token 和 table_id,获取数据表的所有视图 - *

该接口支持调用频率上限为 20 QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableViewSample.java ; - */ - public ListAppTableViewResp list(ListAppTableViewReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListAppTableViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppTableViewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新视图,该接口用于增量修改视图信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableViewSample.java ; - */ - public PatchAppTableViewResp patch(PatchAppTableViewReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchAppTableViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAppTableViewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新视图,该接口用于增量修改视图信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableViewSample.java ; - */ - public PatchAppTableViewResp patch(PatchAppTableViewReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchAppTableViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAppTableViewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/V1.java new file mode 100644 index 000000000..e1c5e2cf3 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/V1.java @@ -0,0 +1,83 @@ +// Code generated by lark suite 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 com.lark.oapi.service.bitable.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.bitable.v1.resource.*; + +public class V1 { + private final App app; // 多维表格 + private final AppDashboard appDashboard; // 仪表盘 + private final AppRole appRole; // 自定义角色 + private final AppRoleMember appRoleMember; // 协作者 + private final AppTable appTable; // 数据表 + private final AppTableField appTableField; // 字段 + private final AppTableForm appTableForm; // 表单 + private final AppTableFormField appTableFormField; // 表单 + private final AppTableRecord appTableRecord; // 记录 + private final AppTableView appTableView; // 视图 + + public V1(Config config) { + this.app = new App(config); + this.appDashboard = new AppDashboard(config); + this.appRole = new AppRole(config); + this.appRoleMember = new AppRoleMember(config); + this.appTable = new AppTable(config); + this.appTableField = new AppTableField(config); + this.appTableForm = new AppTableForm(config); + this.appTableFormField = new AppTableFormField(config); + this.appTableRecord = new AppTableRecord(config); + this.appTableView = new AppTableView(config); + } + + public App app() { + return app; + } + + public AppDashboard appDashboard() { + return appDashboard; + } + + public AppRole appRole() { + return appRole; + } + + public AppRoleMember appRoleMember() { + return appRoleMember; + } + + public AppTable appTable() { + return appTable; + } + + public AppTableField appTableField() { + return appTableField; + } + + public AppTableForm appTableForm() { + return appTableForm; + } + + public AppTableFormField appTableFormField() { + return appTableFormField; + } + + public AppTableRecord appTableRecord() { + return appTableRecord; + } + + public AppTableView appTableView() { + return appTableView; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/enums/ChildrenFilterConjunctionEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/enums/ChildrenFilterConjunctionEnum.java new file mode 100644 index 000000000..c32642031 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/enums/ChildrenFilterConjunctionEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.bitable.v1.enums; + +/** + * 条件逻辑连接词 + */ +public enum ChildrenFilterConjunctionEnum { + CONJUNCTIONAND("and"), // 满足全部条件 + CONJUNCTIONOR("or"), // 满足任一条件 + ; + private String value; + + ChildrenFilterConjunctionEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/enums/ConditionOperatorEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/enums/ConditionOperatorEnum.java new file mode 100644 index 000000000..3fed0d5a0 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/enums/ConditionOperatorEnum.java @@ -0,0 +1,42 @@ +// Code generated by lark suite 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 com.lark.oapi.service.bitable.v1.enums; + +/** + * 条件运算符 + */ +public enum ConditionOperatorEnum { + OPERATORIS("is"), // is + OPERATORISNOT("isNot"), // isNot + OPERATORCONTAINS("contains"), // contains + OPERATORDOESNOTCONTAIN("doesNotContain"), // doesNotContain + OPERATORISEMPTY("isEmpty"), // isEmpty + OPERATORISNOTEMPTY("isNotEmpty"), // isNotEmpty + OPERATORISGREATER("isGreater"), // isGreater + OPERATORISGREATEREQUAL("isGreaterEqual"), // isGreaterEqual + OPERATORISLESS("isLess"), // isLess + OPERATORISLESSEQUAL("isLessEqual"), // isLessEqual + OPERATORLIKE("like"), // like + OPERATORIN("in"), // in + ; + private String value; + + ConditionOperatorEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/enums/FilterInfoConjunctionEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/enums/FilterInfoConjunctionEnum.java new file mode 100644 index 000000000..7e4b4b55b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/enums/FilterInfoConjunctionEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.bitable.v1.enums; + +/** + * 条件逻辑连接词 + */ +public enum FilterInfoConjunctionEnum { + CONJUNCTIONAND("and"), // 满足全部条件 + CONJUNCTIONOR("or"), // 满足任一条件 + ; + private String value; + + FilterInfoConjunctionEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/AppWorkflow.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/AppWorkflow.java new file mode 100644 index 000000000..bec55ffe2 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/AppWorkflow.java @@ -0,0 +1,148 @@ +// Code generated by lark suite 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 com.lark.oapi.service.bitable.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class AppWorkflow { + /** + * 自动化工作流的id + *

示例值:72934597xxxx9998484 + */ + @SerializedName("workflow_id") + private String workflowId; + /** + * 自动化工作流的状态 + *

示例值:Enable + */ + @SerializedName("status") + private String status; + /** + * 自动化工作流的名称 + *

示例值:流程 + */ + @SerializedName("title") + private String title; + + // builder 开始 + public AppWorkflow() { + } + + public AppWorkflow(Builder builder) { + /** + * 自动化工作流的id + *

示例值:72934597xxxx9998484 + */ + this.workflowId = builder.workflowId; + /** + * 自动化工作流的状态 + *

示例值:Enable + */ + this.status = builder.status; + /** + * 自动化工作流的名称 + *

示例值:流程 + */ + this.title = builder.title; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getWorkflowId() { + return this.workflowId; + } + + public void setWorkflowId(String workflowId) { + this.workflowId = workflowId; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public static class Builder { + /** + * 自动化工作流的id + *

示例值:72934597xxxx9998484 + */ + private String workflowId; + /** + * 自动化工作流的状态 + *

示例值:Enable + */ + private String status; + /** + * 自动化工作流的名称 + *

示例值:流程 + */ + private String title; + + /** + * 自动化工作流的id + *

示例值:72934597xxxx9998484 + * + * @param workflowId + * @return + */ + public Builder workflowId(String workflowId) { + this.workflowId = workflowId; + return this; + } + + + /** + * 自动化工作流的状态 + *

示例值:Enable + * + * @param status + * @return + */ + public Builder status(String status) { + this.status = status; + return this; + } + + + /** + * 自动化工作流的名称 + *

示例值:流程 + * + * @param title + * @return + */ + public Builder title(String title) { + this.title = title; + return this; + } + + + public AppWorkflow build() { + return new AppWorkflow(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/BatchUpdateAppTableRecordReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/BatchUpdateAppTableRecordReq.java index e1e7fda35..62bc88088 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/BatchUpdateAppTableRecordReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/BatchUpdateAppTableRecordReq.java @@ -42,6 +42,7 @@ public class BatchUpdateAppTableRecordReq { private String tableId; @Body private BatchUpdateAppTableRecordReqBody body; + // builder 开始 public BatchUpdateAppTableRecordReq() { } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/ChildrenFilter.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/ChildrenFilter.java new file mode 100644 index 000000000..0e9b6def9 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/ChildrenFilter.java @@ -0,0 +1,123 @@ +// Code generated by lark suite 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 com.lark.oapi.service.bitable.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class ChildrenFilter { + /** + * 条件逻辑连接词 + *

示例值:and + */ + @SerializedName("conjunction") + private String conjunction; + /** + * 筛选条件集合 + *

示例值: + */ + @SerializedName("conditions") + private Condition[] conditions; + + // builder 开始 + public ChildrenFilter() { + } + + public ChildrenFilter(Builder builder) { + /** + * 条件逻辑连接词 + *

示例值:and + */ + this.conjunction = builder.conjunction; + /** + * 筛选条件集合 + *

示例值: + */ + this.conditions = builder.conditions; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getConjunction() { + return this.conjunction; + } + + public void setConjunction(String conjunction) { + this.conjunction = conjunction; + } + + public Condition[] getConditions() { + return this.conditions; + } + + public void setConditions(Condition[] conditions) { + this.conditions = conditions; + } + + public static class Builder { + /** + * 条件逻辑连接词 + *

示例值:and + */ + private String conjunction; + /** + * 筛选条件集合 + *

示例值: + */ + private Condition[] conditions; + + /** + * 条件逻辑连接词 + *

示例值:and + * + * @param conjunction + * @return + */ + public Builder conjunction(String conjunction) { + this.conjunction = conjunction; + return this; + } + + /** + * 条件逻辑连接词 + *

示例值:and + * + * @param conjunction {@link com.lark.oapi.service.bitable.v1.enums.ChildrenFilterConjunctionEnum} + * @return + */ + public Builder conjunction(com.lark.oapi.service.bitable.v1.enums.ChildrenFilterConjunctionEnum conjunction) { + this.conjunction = conjunction.getValue(); + return this; + } + + + /** + * 筛选条件集合 + *

示例值: + * + * @param conditions + * @return + */ + public Builder conditions(Condition[] conditions) { + this.conditions = conditions; + return this; + } + + + public ChildrenFilter build() { + return new ChildrenFilter(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/Condition.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/Condition.java new file mode 100644 index 000000000..a284e2c15 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/Condition.java @@ -0,0 +1,160 @@ +// Code generated by lark suite 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 com.lark.oapi.service.bitable.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class Condition { + /** + * 筛选条件的左值,值为字段的名称 + *

示例值:字段名称 + */ + @SerializedName("field_name") + private String fieldName; + /** + * 条件运算符 + *

示例值:is + */ + @SerializedName("operator") + private String operator; + /** + * 目标值 + *

示例值: + */ + @SerializedName("value") + private String[] value; + + // builder 开始 + public Condition() { + } + + public Condition(Builder builder) { + /** + * 筛选条件的左值,值为字段的名称 + *

示例值:字段名称 + */ + this.fieldName = builder.fieldName; + /** + * 条件运算符 + *

示例值:is + */ + this.operator = builder.operator; + /** + * 目标值 + *

示例值: + */ + this.value = builder.value; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getFieldName() { + return this.fieldName; + } + + public void setFieldName(String fieldName) { + this.fieldName = fieldName; + } + + public String getOperator() { + return this.operator; + } + + public void setOperator(String operator) { + this.operator = operator; + } + + public String[] getValue() { + return this.value; + } + + public void setValue(String[] value) { + this.value = value; + } + + public static class Builder { + /** + * 筛选条件的左值,值为字段的名称 + *

示例值:字段名称 + */ + private String fieldName; + /** + * 条件运算符 + *

示例值:is + */ + private String operator; + /** + * 目标值 + *

示例值: + */ + private String[] value; + + /** + * 筛选条件的左值,值为字段的名称 + *

示例值:字段名称 + * + * @param fieldName + * @return + */ + public Builder fieldName(String fieldName) { + this.fieldName = fieldName; + return this; + } + + + /** + * 条件运算符 + *

示例值:is + * + * @param operator + * @return + */ + public Builder operator(String operator) { + this.operator = operator; + return this; + } + + /** + * 条件运算符 + *

示例值:is + * + * @param operator {@link com.lark.oapi.service.bitable.v1.enums.ConditionOperatorEnum} + * @return + */ + public Builder operator(com.lark.oapi.service.bitable.v1.enums.ConditionOperatorEnum operator) { + this.operator = operator.getValue(); + return this; + } + + + /** + * 目标值 + *

示例值: + * + * @param value + * @return + */ + public Builder value(String[] value) { + this.value = value; + return this; + } + + + public Condition build() { + return new Condition(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/CreateAppRoleMemberReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/CreateAppRoleMemberReq.java index b43840516..05f4471c0 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/CreateAppRoleMemberReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/CreateAppRoleMemberReq.java @@ -42,6 +42,7 @@ public class CreateAppRoleMemberReq { private String roleId; @Body private AppRoleMember body; + // builder 开始 public CreateAppRoleMemberReq() { } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/CreateAppTableFieldReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/CreateAppTableFieldReq.java index a9dc3ade5..793c5c631 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/CreateAppTableFieldReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/CreateAppTableFieldReq.java @@ -42,6 +42,7 @@ public class CreateAppTableFieldReq { private String tableId; @Body private AppTableField body; + // builder 开始 public CreateAppTableFieldReq() { } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/DeleteAppRoleMemberReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/DeleteAppRoleMemberReq.java index 862f355d2..0b2fede3f 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/DeleteAppRoleMemberReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/DeleteAppRoleMemberReq.java @@ -46,9 +46,11 @@ public class DeleteAppRoleMemberReq { @Path @SerializedName("member_id") private String memberId; + // builder 开始 public DeleteAppRoleMemberReq() { } + public DeleteAppRoleMemberReq(Builder builder) { /** * 协作者id类型,与请求体中的member_id要对应 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/FilterInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/FilterInfo.java new file mode 100644 index 000000000..66d894fca --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/FilterInfo.java @@ -0,0 +1,123 @@ +// Code generated by lark suite 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 com.lark.oapi.service.bitable.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class FilterInfo { + /** + * 条件逻辑连接词 + *

示例值:and + */ + @SerializedName("conjunction") + private String conjunction; + /** + * 筛选条件集合 + *

示例值: + */ + @SerializedName("conditions") + private Condition[] conditions; + + // builder 开始 + public FilterInfo() { + } + + public FilterInfo(Builder builder) { + /** + * 条件逻辑连接词 + *

示例值:and + */ + this.conjunction = builder.conjunction; + /** + * 筛选条件集合 + *

示例值: + */ + this.conditions = builder.conditions; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getConjunction() { + return this.conjunction; + } + + public void setConjunction(String conjunction) { + this.conjunction = conjunction; + } + + public Condition[] getConditions() { + return this.conditions; + } + + public void setConditions(Condition[] conditions) { + this.conditions = conditions; + } + + public static class Builder { + /** + * 条件逻辑连接词 + *

示例值:and + */ + private String conjunction; + /** + * 筛选条件集合 + *

示例值: + */ + private Condition[] conditions; + + /** + * 条件逻辑连接词 + *

示例值:and + * + * @param conjunction + * @return + */ + public Builder conjunction(String conjunction) { + this.conjunction = conjunction; + return this; + } + + /** + * 条件逻辑连接词 + *

示例值:and + * + * @param conjunction {@link com.lark.oapi.service.bitable.v1.enums.FilterInfoConjunctionEnum} + * @return + */ + public Builder conjunction(com.lark.oapi.service.bitable.v1.enums.FilterInfoConjunctionEnum conjunction) { + this.conjunction = conjunction.getValue(); + return this; + } + + + /** + * 筛选条件集合 + *

示例值: + * + * @param conditions + * @return + */ + public Builder conditions(Condition[] conditions) { + this.conditions = conditions; + return this; + } + + + public FilterInfo build() { + return new FilterInfo(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/Sort.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/Sort.java new file mode 100644 index 000000000..d8f992137 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/Sort.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.bitable.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class Sort { + /** + * 字段名称 + *

示例值:多行文本 + */ + @SerializedName("field_name") + private String fieldName; + /** + * 是否倒序排序 + *

示例值:true + */ + @SerializedName("desc") + private Boolean desc; + + // builder 开始 + public Sort() { + } + + public Sort(Builder builder) { + /** + * 字段名称 + *

示例值:多行文本 + */ + this.fieldName = builder.fieldName; + /** + * 是否倒序排序 + *

示例值:true + */ + this.desc = builder.desc; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getFieldName() { + return this.fieldName; + } + + public void setFieldName(String fieldName) { + this.fieldName = fieldName; + } + + public Boolean getDesc() { + return this.desc; + } + + public void setDesc(Boolean desc) { + this.desc = desc; + } + + public static class Builder { + /** + * 字段名称 + *

示例值:多行文本 + */ + private String fieldName; + /** + * 是否倒序排序 + *

示例值:true + */ + private Boolean desc; + + /** + * 字段名称 + *

示例值:多行文本 + * + * @param fieldName + * @return + */ + public Builder fieldName(String fieldName) { + this.fieldName = fieldName; + return this; + } + + + /** + * 是否倒序排序 + *

示例值:true + * + * @param desc + * @return + */ + public Builder desc(Boolean desc) { + this.desc = desc; + return this; + } + + + public Sort build() { + return new Sort(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/UpdateAppTableRecordReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/UpdateAppTableRecordReq.java index 7559bd96c..51a0fb3d6 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/UpdateAppTableRecordReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/model/UpdateAppTableRecordReq.java @@ -49,6 +49,7 @@ public class UpdateAppTableRecordReq { private String recordId; @Body private AppTableRecord body; + // builder 开始 public UpdateAppTableRecordReq() { } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/App.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/App.java new file mode 100644 index 000000000..c21f6b9b0 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/App.java @@ -0,0 +1,308 @@ +// Code generated by lark suite 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 com.lark.oapi.service.bitable.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.bitable.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class App { + private static final Logger log = LoggerFactory.getLogger(App.class); + private final Config config; + + public App(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=copy&project=bitable&resource=app&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CopyAppSample.java ; + */ + public CopyAppResp copy(CopyAppReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/copy" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CopyAppResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CopyAppResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/copy" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=copy&project=bitable&resource=app&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CopyAppSample.java ; + */ + public CopyAppResp copy(CopyAppReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/copy" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CopyAppResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CopyAppResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/copy" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=bitable&resource=app&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppSample.java ; + */ + public CreateAppResp create(CreateAppReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateAppResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=bitable&resource=app&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppSample.java ; + */ + public CreateAppResp create(CreateAppReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateAppResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取多维表格元数据,获取指定多维表格的元数据信息,包括多维表格名称,多维表格版本号,多维表格是否开启高级权限等。 + *

该接口支持调用频率上限为 20 QPS(Query Per Second,每秒请求率) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppSample.java ; + */ + public GetAppResp get(GetAppReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/bitable/v1/apps/:app_token" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetAppResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAppResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取多维表格元数据,获取指定多维表格的元数据信息,包括多维表格名称,多维表格版本号,多维表格是否开启高级权限等。 + *

该接口支持调用频率上限为 20 QPS(Query Per Second,每秒请求率) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppSample.java ; + */ + public GetAppResp get(GetAppReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/bitable/v1/apps/:app_token" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetAppResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAppResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新多维表格元数据,通过 app_token 更新多维表格元数据 + *

- 飞书文档、飞书表格、知识库中的多维表格不支持开启高级权限;- 此接口非原子操作,先修改多维表格名字,后开关高级权限。可能存在部分成功的情况 ; + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppSample.java ; + */ + public UpdateAppResp update(UpdateAppReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/bitable/v1/apps/:app_token" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateAppResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateAppResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新多维表格元数据,通过 app_token 更新多维表格元数据 + *

- 飞书文档、飞书表格、知识库中的多维表格不支持开启高级权限;- 此接口非原子操作,先修改多维表格名字,后开关高级权限。可能存在部分成功的情况 ; + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppSample.java ; + */ + public UpdateAppResp update(UpdateAppReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/bitable/v1/apps/:app_token" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateAppResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateAppResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppDashboard.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppDashboard.java new file mode 100644 index 000000000..0c4918f70 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppDashboard.java @@ -0,0 +1,175 @@ +// Code generated by lark suite 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 com.lark.oapi.service.bitable.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.bitable.v1.model.CopyAppDashboardReq; +import com.lark.oapi.service.bitable.v1.model.CopyAppDashboardResp; +import com.lark.oapi.service.bitable.v1.model.ListAppDashboardReq; +import com.lark.oapi.service.bitable.v1.model.ListAppDashboardResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class AppDashboard { + private static final Logger log = LoggerFactory.getLogger(AppDashboard.class); + private final Config config; + + public AppDashboard(Config config) { + this.config = config; + } + + + /** + * 复制仪表盘,该接口用于根据现有仪表盘复制出新的仪表盘 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-dashboard/copy ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CopyAppDashboardSample.java ; + */ + public CopyAppDashboardResp copy(CopyAppDashboardReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/dashboards/:block_id/copy" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CopyAppDashboardResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CopyAppDashboardResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/dashboards/:block_id/copy" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 复制仪表盘,该接口用于根据现有仪表盘复制出新的仪表盘 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-dashboard/copy ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CopyAppDashboardSample.java ; + */ + public CopyAppDashboardResp copy(CopyAppDashboardReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/dashboards/:block_id/copy" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CopyAppDashboardResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CopyAppDashboardResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/dashboards/:block_id/copy" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 列出仪表盘,根据 app_token,获取多维表格下的所有仪表盘 + *

该接口支持调用频率上限为 20 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-dashboard/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppDashboardSample.java ; + */ + public ListAppDashboardResp list(ListAppDashboardReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/bitable/v1/apps/:app_token/dashboards" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListAppDashboardResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppDashboardResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/dashboards" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 列出仪表盘,根据 app_token,获取多维表格下的所有仪表盘 + *

该接口支持调用频率上限为 20 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-dashboard/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppDashboardSample.java ; + */ + public ListAppDashboardResp list(ListAppDashboardReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/bitable/v1/apps/:app_token/dashboards" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListAppDashboardResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppDashboardResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/dashboards" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppRole.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppRole.java new file mode 100644 index 000000000..04931ca55 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppRole.java @@ -0,0 +1,304 @@ +// Code generated by lark suite 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 com.lark.oapi.service.bitable.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.bitable.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class AppRole { + private static final Logger log = LoggerFactory.getLogger(AppRole.class); + private final Config config; + + public AppRole(Config config) { + this.config = config; + } + + + /** + * 新增自定义角色,新增自定义角色 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppRoleSample.java ; + */ + public CreateAppRoleResp create(CreateAppRoleReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/roles" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateAppRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppRoleResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 新增自定义角色,新增自定义角色 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppRoleSample.java ; + */ + public CreateAppRoleResp create(CreateAppRoleReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/roles" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateAppRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppRoleResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除自定义角色,删除自定义角色 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppRoleSample.java ; + */ + public DeleteAppRoleResp delete(DeleteAppRoleReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteAppRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAppRoleResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除自定义角色,删除自定义角色 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppRoleSample.java ; + */ + public DeleteAppRoleResp delete(DeleteAppRoleReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteAppRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAppRoleResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 列出自定义角色,列出自定义角色 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppRoleSample.java ; + */ + public ListAppRoleResp list(ListAppRoleReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/bitable/v1/apps/:app_token/roles" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListAppRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppRoleResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 列出自定义角色,列出自定义角色 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppRoleSample.java ; + */ + public ListAppRoleResp list(ListAppRoleReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/bitable/v1/apps/:app_token/roles" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListAppRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppRoleResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新自定义角色,更新自定义角色 + *

更新自定义角色是全量更新,会完全覆盖旧的自定义角色设置 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppRoleSample.java ; + */ + public UpdateAppRoleResp update(UpdateAppRoleReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateAppRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateAppRoleResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新自定义角色,更新自定义角色 + *

更新自定义角色是全量更新,会完全覆盖旧的自定义角色设置 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppRoleSample.java ; + */ + public UpdateAppRoleResp update(UpdateAppRoleReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateAppRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateAppRoleResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppRoleMember.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppRoleMember.java new file mode 100644 index 000000000..d8f96cc96 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppRoleMember.java @@ -0,0 +1,368 @@ +// Code generated by lark suite 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 com.lark.oapi.service.bitable.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.bitable.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class AppRoleMember { + private static final Logger log = LoggerFactory.getLogger(AppRoleMember.class); + private final Config config; + + public AppRoleMember(Config config) { + this.config = config; + } + + + /** + * 批量新增协作者,批量新增自定义角色的协作者 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/batch_create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchCreateAppRoleMemberSample.java ; + */ + public BatchCreateAppRoleMemberResp batchCreate(BatchCreateAppRoleMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_create" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + BatchCreateAppRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateAppRoleMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_create" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量新增协作者,批量新增自定义角色的协作者 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/batch_create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchCreateAppRoleMemberSample.java ; + */ + public BatchCreateAppRoleMemberResp batchCreate(BatchCreateAppRoleMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_create" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + BatchCreateAppRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateAppRoleMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_create" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量删除协作者,批量删除自定义角色的协作者 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/batch_delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchDeleteAppRoleMemberSample.java ; + */ + public BatchDeleteAppRoleMemberResp batchDelete(BatchDeleteAppRoleMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_delete" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + BatchDeleteAppRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteAppRoleMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量删除协作者,批量删除自定义角色的协作者 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/batch_delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchDeleteAppRoleMemberSample.java ; + */ + public BatchDeleteAppRoleMemberResp batchDelete(BatchDeleteAppRoleMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_delete" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + BatchDeleteAppRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteAppRoleMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 新增协作者,新增自定义角色的协作者 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppRoleMemberSample.java ; + */ + public CreateAppRoleMemberResp create(CreateAppRoleMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateAppRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppRoleMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 新增协作者,新增自定义角色的协作者 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppRoleMemberSample.java ; + */ + public CreateAppRoleMemberResp create(CreateAppRoleMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateAppRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppRoleMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除协作者,删除自定义角色的协作者 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppRoleMemberSample.java ; + */ + public DeleteAppRoleMemberResp delete(DeleteAppRoleMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/:member_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteAppRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAppRoleMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/:member_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除协作者,删除自定义角色的协作者 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppRoleMemberSample.java ; + */ + public DeleteAppRoleMemberResp delete(DeleteAppRoleMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/:member_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteAppRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAppRoleMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/:member_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 列出协作者,列出自定义角色的协作者 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppRoleMemberSample.java ; + */ + public ListAppRoleMemberResp list(ListAppRoleMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListAppRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppRoleMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 列出协作者,列出自定义角色的协作者 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppRoleMemberSample.java ; + */ + public ListAppRoleMemberResp list(ListAppRoleMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListAppRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppRoleMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppTable.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppTable.java new file mode 100644 index 000000000..b0fdbf2df --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppTable.java @@ -0,0 +1,444 @@ +// Code generated by lark suite 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 com.lark.oapi.service.bitable.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.bitable.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class AppTable { + private static final Logger log = LoggerFactory.getLogger(AppTable.class); + private final Config config; + + public AppTable(Config config) { + this.config = config; + } + + + /** + * 新增多个数据表,新增多个数据表 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/batch_create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchCreateAppTableSample.java ; + */ + public BatchCreateAppTableResp batchCreate(BatchCreateAppTableReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/tables/batch_create" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchCreateAppTableResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateAppTableResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/batch_create" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 新增多个数据表,新增多个数据表 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/batch_create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchCreateAppTableSample.java ; + */ + public BatchCreateAppTableResp batchCreate(BatchCreateAppTableReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/tables/batch_create" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchCreateAppTableResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateAppTableResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/batch_create" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除多个数据表,删除多个数据表 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/batch_delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchDeleteAppTableSample.java ; + */ + public BatchDeleteAppTableResp batchDelete(BatchDeleteAppTableReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/tables/batch_delete" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchDeleteAppTableResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteAppTableResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除多个数据表,删除多个数据表 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/batch_delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchDeleteAppTableSample.java ; + */ + public BatchDeleteAppTableResp batchDelete(BatchDeleteAppTableReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/tables/batch_delete" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchDeleteAppTableResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteAppTableResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 新增数据表,新增一个数据表 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableSample.java ; + */ + public CreateAppTableResp create(CreateAppTableReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/tables" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateAppTableResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppTableResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 新增数据表,新增一个数据表 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableSample.java ; + */ + public CreateAppTableResp create(CreateAppTableReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/tables" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateAppTableResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppTableResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除数据表,删除一个数据表 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableSample.java ; + */ + public DeleteAppTableResp delete(DeleteAppTableReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteAppTableResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAppTableResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除数据表,删除一个数据表 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableSample.java ; + */ + public DeleteAppTableResp delete(DeleteAppTableReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteAppTableResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAppTableResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 列出数据表,根据 app_token,获取多维表格下的所有数据表 + *

该接口支持调用频率上限为 20 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableSample.java ; + */ + public ListAppTableResp list(ListAppTableReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/bitable/v1/apps/:app_token/tables" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListAppTableResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppTableResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 列出数据表,根据 app_token,获取多维表格下的所有数据表 + *

该接口支持调用频率上限为 20 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableSample.java ; + */ + public ListAppTableResp list(ListAppTableReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/bitable/v1/apps/:app_token/tables" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListAppTableResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppTableResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableSample.java ; + */ + public PatchAppTableResp patch(PatchAppTableReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchAppTableResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAppTableResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableSample.java ; + */ + public PatchAppTableResp patch(PatchAppTableReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchAppTableResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAppTableResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppTableField.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppTableField.java new file mode 100644 index 000000000..d461c859b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppTableField.java @@ -0,0 +1,310 @@ +// Code generated by lark suite 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 com.lark.oapi.service.bitable.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.bitable.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class AppTableField { + private static final Logger log = LoggerFactory.getLogger(AppTableField.class); + private final Config config; + + public AppTableField(Config config) { + this.config = config; + } + + + /** + * 新增字段,该接口用于在数据表中新增一个字段 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-field/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableFieldSample.java ; + */ + public CreateAppTableFieldResp create(CreateAppTableFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateAppTableFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppTableFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 新增字段,该接口用于在数据表中新增一个字段 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-field/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableFieldSample.java ; + */ + public CreateAppTableFieldResp create(CreateAppTableFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateAppTableFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppTableFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除字段,该接口用于在数据表中删除一个字段 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-field/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableFieldSample.java ; + */ + public DeleteAppTableFieldResp delete(DeleteAppTableFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteAppTableFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAppTableFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除字段,该接口用于在数据表中删除一个字段 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-field/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableFieldSample.java ; + */ + public DeleteAppTableFieldResp delete(DeleteAppTableFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteAppTableFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAppTableFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 列出字段,根据 app_token 和 table_id,获取数据表的所有字段 + *

该接口支持调用频率上限为 20 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-field/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableFieldSample.java ; + */ + public ListAppTableFieldResp list(ListAppTableFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListAppTableFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppTableFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 列出字段,根据 app_token 和 table_id,获取数据表的所有字段 + *

该接口支持调用频率上限为 20 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-field/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableFieldSample.java ; + */ + public ListAppTableFieldResp list(ListAppTableFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListAppTableFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppTableFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新字段,该接口用于在数据表中更新一个字段 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-field/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppTableFieldSample.java ; + */ + public UpdateAppTableFieldResp update(UpdateAppTableFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateAppTableFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateAppTableFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新字段,该接口用于在数据表中更新一个字段 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-field/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppTableFieldSample.java ; + */ + public UpdateAppTableFieldResp update(UpdateAppTableFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateAppTableFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateAppTableFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppTableForm.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppTableForm.java new file mode 100644 index 000000000..e3fb5e476 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppTableForm.java @@ -0,0 +1,177 @@ +// Code generated by lark suite 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 com.lark.oapi.service.bitable.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.bitable.v1.model.GetAppTableFormReq; +import com.lark.oapi.service.bitable.v1.model.GetAppTableFormResp; +import com.lark.oapi.service.bitable.v1.model.PatchAppTableFormReq; +import com.lark.oapi.service.bitable.v1.model.PatchAppTableFormResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class AppTableForm { + private static final Logger log = LoggerFactory.getLogger(AppTableForm.class); + private final Config config; + + public AppTableForm(Config config) { + this.config = config; + } + + + /** + * 获取表单元数据,获取表单的所有元数据项 + *

该接口支持调用频率上限为 20 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-form/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppTableFormSample.java ; + */ + public GetAppTableFormResp get(GetAppTableFormReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetAppTableFormResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAppTableFormResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取表单元数据,获取表单的所有元数据项 + *

该接口支持调用频率上限为 20 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-form/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppTableFormSample.java ; + */ + public GetAppTableFormResp get(GetAppTableFormReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetAppTableFormResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAppTableFormResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新表单元数据,该接口用于更新表单中的元数据项 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-form/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableFormSample.java ; + */ + public PatchAppTableFormResp patch(PatchAppTableFormReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchAppTableFormResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAppTableFormResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新表单元数据,该接口用于更新表单中的元数据项 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-form/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableFormSample.java ; + */ + public PatchAppTableFormResp patch(PatchAppTableFormReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchAppTableFormResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAppTableFormResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppTableFormField.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppTableFormField.java new file mode 100644 index 000000000..f7ced1f5e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppTableFormField.java @@ -0,0 +1,177 @@ +// Code generated by lark suite 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 com.lark.oapi.service.bitable.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.bitable.v1.model.ListAppTableFormFieldReq; +import com.lark.oapi.service.bitable.v1.model.ListAppTableFormFieldResp; +import com.lark.oapi.service.bitable.v1.model.PatchAppTableFormFieldReq; +import com.lark.oapi.service.bitable.v1.model.PatchAppTableFormFieldResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class AppTableFormField { + private static final Logger log = LoggerFactory.getLogger(AppTableFormField.class); + private final Config config; + + public AppTableFormField(Config config) { + this.config = config; + } + + + /** + * 列出表单问题,列出表单的所有问题项 + *

该接口支持调用频率上限为 20 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-form-field/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableFormFieldSample.java ; + */ + public ListAppTableFormFieldResp list(ListAppTableFormFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListAppTableFormFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppTableFormFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 列出表单问题,列出表单的所有问题项 + *

该接口支持调用频率上限为 20 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-form-field/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableFormFieldSample.java ; + */ + public ListAppTableFormFieldResp list(ListAppTableFormFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListAppTableFormFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppTableFormFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新表单问题,该接口用于更新表单中的问题项 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-form-field/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableFormFieldSample.java ; + */ + public PatchAppTableFormFieldResp patch(PatchAppTableFormFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields/:field_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchAppTableFormFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAppTableFormFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields/:field_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新表单问题,该接口用于更新表单中的问题项 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-form-field/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableFormFieldSample.java ; + */ + public PatchAppTableFormFieldResp patch(PatchAppTableFormFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields/:field_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchAppTableFormFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAppTableFormFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields/:field_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppTableRecord.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppTableRecord.java new file mode 100644 index 000000000..369988066 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppTableRecord.java @@ -0,0 +1,582 @@ +// Code generated by lark suite 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 com.lark.oapi.service.bitable.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.bitable.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class AppTableRecord { + private static final Logger log = LoggerFactory.getLogger(AppTableRecord.class); + private final Config config; + + public AppTableRecord(Config config) { + this.config = config; + } + + + /** + * 新增多条记录,该接口用于在数据表中新增多条记录,单次调用最多新增 500 条记录。 + *

该接口支持调用频率上限为 10 QPS(Query Per Second,每秒请求率) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/batch_create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchCreateAppTableRecordSample.java ; + */ + public BatchCreateAppTableRecordResp batchCreate(BatchCreateAppTableRecordReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_create" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchCreateAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateAppTableRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_create" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 新增多条记录,该接口用于在数据表中新增多条记录,单次调用最多新增 500 条记录。 + *

该接口支持调用频率上限为 10 QPS(Query Per Second,每秒请求率) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/batch_create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchCreateAppTableRecordSample.java ; + */ + public BatchCreateAppTableRecordResp batchCreate(BatchCreateAppTableRecordReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_create" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchCreateAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateAppTableRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_create" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除多条记录,该接口用于删除数据表中现有的多条记录,单次调用中最多删除 500 条记录。 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/batch_delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchDeleteAppTableRecordSample.java ; + */ + public BatchDeleteAppTableRecordResp batchDelete(BatchDeleteAppTableRecordReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_delete" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchDeleteAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteAppTableRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除多条记录,该接口用于删除数据表中现有的多条记录,单次调用中最多删除 500 条记录。 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/batch_delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchDeleteAppTableRecordSample.java ; + */ + public BatchDeleteAppTableRecordResp batchDelete(BatchDeleteAppTableRecordReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_delete" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchDeleteAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteAppTableRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新多条记录,该接口用于更新数据表中的多条记录,单次调用最多更新 500 条记录。 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/batch_update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchUpdateAppTableRecordSample.java ; + */ + public BatchUpdateAppTableRecordResp batchUpdate(BatchUpdateAppTableRecordReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_update" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchUpdateAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUpdateAppTableRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_update" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新多条记录,该接口用于更新数据表中的多条记录,单次调用最多更新 500 条记录。 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/batch_update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchUpdateAppTableRecordSample.java ; + */ + public BatchUpdateAppTableRecordResp batchUpdate(BatchUpdateAppTableRecordReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_update" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchUpdateAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUpdateAppTableRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_update" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 新增记录,该接口用于在数据表中新增一条记录 + *

该接口支持调用频率上限为 10 QPS(Query Per Second,每秒请求率) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableRecordSample.java ; + */ + public CreateAppTableRecordResp create(CreateAppTableRecordReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppTableRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 新增记录,该接口用于在数据表中新增一条记录 + *

该接口支持调用频率上限为 10 QPS(Query Per Second,每秒请求率) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableRecordSample.java ; + */ + public CreateAppTableRecordResp create(CreateAppTableRecordReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppTableRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除记录,该接口用于删除数据表中的一条记录 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableRecordSample.java ; + */ + public DeleteAppTableRecordResp delete(DeleteAppTableRecordReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAppTableRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除记录,该接口用于删除数据表中的一条记录 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableRecordSample.java ; + */ + public DeleteAppTableRecordResp delete(DeleteAppTableRecordReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAppTableRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 检索记录,该接口用于根据 record_id 的值检索现有记录 + *

该接口支持调用频率上限为 20 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppTableRecordSample.java ; + */ + public GetAppTableRecordResp get(GetAppTableRecordReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAppTableRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 检索记录,该接口用于根据 record_id 的值检索现有记录 + *

该接口支持调用频率上限为 20 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppTableRecordSample.java ; + */ + public GetAppTableRecordResp get(GetAppTableRecordReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAppTableRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 列出记录,该接口用于列出数据表中的现有记录,单次最多列出 500 行记录,支持分页获取。 + *

该接口支持调用频率上限为 10 QPS(Query Per Second,每秒请求率),1000 QPM(Query Per Minute,每分钟请求率) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableRecordSample.java ; + */ + public ListAppTableRecordResp list(ListAppTableRecordReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppTableRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 列出记录,该接口用于列出数据表中的现有记录,单次最多列出 500 行记录,支持分页获取。 + *

该接口支持调用频率上限为 10 QPS(Query Per Second,每秒请求率),1000 QPM(Query Per Minute,每分钟请求率) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableRecordSample.java ; + */ + public ListAppTableRecordResp list(ListAppTableRecordReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppTableRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新记录,该接口用于更新数据表中的一条记录 + *

该接口支持调用频率上限为 10 QPS(Query Per Second,每秒请求率) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppTableRecordSample.java ; + */ + public UpdateAppTableRecordResp update(UpdateAppTableRecordReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateAppTableRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新记录,该接口用于更新数据表中的一条记录 + *

该接口支持调用频率上限为 10 QPS(Query Per Second,每秒请求率) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppTableRecordSample.java ; + */ + public UpdateAppTableRecordResp update(UpdateAppTableRecordReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateAppTableRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateAppTableRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppTableView.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppTableView.java new file mode 100644 index 000000000..97df2fbfd --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/bitable/v1/resource/AppTableView.java @@ -0,0 +1,374 @@ +// Code generated by lark suite 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 com.lark.oapi.service.bitable.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.bitable.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class AppTableView { + private static final Logger log = LoggerFactory.getLogger(AppTableView.class); + private final Config config; + + public AppTableView(Config config) { + this.config = config; + } + + + /** + * 新增视图,在数据表中新增一个视图 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableViewSample.java ; + */ + public CreateAppTableViewResp create(CreateAppTableViewReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateAppTableViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppTableViewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 新增视图,在数据表中新增一个视图 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableViewSample.java ; + */ + public CreateAppTableViewResp create(CreateAppTableViewReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateAppTableViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppTableViewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除视图,删除数据表中的视图 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableViewSample.java ; + */ + public DeleteAppTableViewResp delete(DeleteAppTableViewReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteAppTableViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAppTableViewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除视图,删除数据表中的视图 + *

该接口支持调用频率上限为 10 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableViewSample.java ; + */ + public DeleteAppTableViewResp delete(DeleteAppTableViewReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteAppTableViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAppTableViewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 检索视图,该接口根据 view_id 检索现有视图 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppTableViewSample.java ; + */ + public GetAppTableViewResp get(GetAppTableViewReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetAppTableViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAppTableViewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 检索视图,该接口根据 view_id 检索现有视图 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppTableViewSample.java ; + */ + public GetAppTableViewResp get(GetAppTableViewReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetAppTableViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAppTableViewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 列出视图,根据 app_token 和 table_id,获取数据表的所有视图 + *

该接口支持调用频率上限为 20 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableViewSample.java ; + */ + public ListAppTableViewResp list(ListAppTableViewReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListAppTableViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppTableViewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 列出视图,根据 app_token 和 table_id,获取数据表的所有视图 + *

该接口支持调用频率上限为 20 QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableViewSample.java ; + */ + public ListAppTableViewResp list(ListAppTableViewReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListAppTableViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAppTableViewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新视图,该接口用于增量修改视图信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableViewSample.java ; + */ + public PatchAppTableViewResp patch(PatchAppTableViewReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchAppTableViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAppTableViewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新视图,该接口用于增量修改视图信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableViewSample.java ; + */ + public PatchAppTableViewResp patch(PatchAppTableViewReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchAppTableViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAppTableViewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/block/BlockService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/block/BlockService.java new file mode 100644 index 000000000..bc73e8153 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/block/BlockService.java @@ -0,0 +1,42 @@ +// Code generated by lark suite 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 com.lark.oapi.service.block; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.block.v2.V2; +import com.lark.oapi.service.block.v2.resource.Entity; +import com.lark.oapi.service.block.v2.resource.Message; + +public class BlockService { + private final V2 v2; + private final Entity entity; // 服务端 API + private final Message message; // 服务端 API + + public BlockService(Config config) { + this.v2 = new V2(config); + this.entity = new Entity(config); + this.message = new Message(config); + } + + public V2 v2() { + return v2; + } + + public Entity entity() { + return entity; + } + + public Message message() { + return message; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/block/v2/BlockService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/block/v2/BlockService.java deleted file mode 100644 index 3b6372897..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/block/v2/BlockService.java +++ /dev/null @@ -1,272 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.block.v2; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.block.v2.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class BlockService { - private static final Logger log = LoggerFactory.getLogger(BlockService.class); - private final Entity entity; // 服务端 API - private final Message message; // 服务端 API - - public BlockService(Config config) { - this.entity = new Entity(config); - this.message = new Message(config); - } - - /** - * 服务端 API - * - * @return - */ - public Entity entity() { - return entity; - } - - /** - * 服务端 API - * - * @return - */ - public Message message() { - return message; - } - - public static class Entity { - private final Config config; - - public Entity(Config config) { - this.config = config; - } - - /** - * 创建 BlockEntity,开发者可以通过该接口将部分或全部数据存放于 BlockEntity。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/block-v2/entity/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/blockv2/CreateEntitySample.java ; - */ - public CreateEntityResp create(CreateEntityReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/block/v2/entities" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/block/v2/entities" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建 BlockEntity,开发者可以通过该接口将部分或全部数据存放于 BlockEntity。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/block-v2/entity/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/blockv2/CreateEntitySample.java ; - */ - public CreateEntityResp create(CreateEntityReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/block/v2/entities" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/block/v2/entities" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新BlockEntity,开发者通过该接口可以更新存储在BlockEntity中的数据,并实时推送到端侧。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/block-v2/entity/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/blockv2/UpdateEntitySample.java ; - */ - public UpdateEntityResp update(UpdateEntityReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/block/v2/entities/:block_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/block/v2/entities/:block_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新BlockEntity,开发者通过该接口可以更新存储在BlockEntity中的数据,并实时推送到端侧。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/block-v2/entity/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/blockv2/UpdateEntitySample.java ; - */ - public UpdateEntityResp update(UpdateEntityReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/block/v2/entities/:block_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/block/v2/entities/:block_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Message { - private final Config config; - - public Message(Config config) { - this.config = config; - } - - /** - * Block协同数据推送,根据BlockID向指定用户列表推送协同数据。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/block-v2/message/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/blockv2/CreateMessageSample.java ; - */ - public CreateMessageResp create(CreateMessageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/block/v2/message" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/block/v2/message" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * Block协同数据推送,根据BlockID向指定用户列表推送协同数据。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/block-v2/message/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/blockv2/CreateMessageSample.java ; - */ - public CreateMessageResp create(CreateMessageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/block/v2/message" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/block/v2/message" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/block/v2/V2.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/block/v2/V2.java new file mode 100644 index 000000000..97ddba12d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/block/v2/V2.java @@ -0,0 +1,36 @@ +// Code generated by lark suite 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 com.lark.oapi.service.block.v2; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.block.v2.resource.Entity; +import com.lark.oapi.service.block.v2.resource.Message; + +public class V2 { + private final Entity entity; // 服务端 API + private final Message message; // 服务端 API + + public V2(Config config) { + this.entity = new Entity(config); + this.message = new Message(config); + } + + public Entity entity() { + return entity; + } + + public Message message() { + return message; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/block/v2/resource/Entity.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/block/v2/resource/Entity.java new file mode 100644 index 000000000..925d4901a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/block/v2/resource/Entity.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.block.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.block.v2.model.CreateEntityReq; +import com.lark.oapi.service.block.v2.model.CreateEntityResp; +import com.lark.oapi.service.block.v2.model.UpdateEntityReq; +import com.lark.oapi.service.block.v2.model.UpdateEntityResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Entity { + private static final Logger log = LoggerFactory.getLogger(Entity.class); + private final Config config; + + public Entity(Config config) { + this.config = config; + } + + + /** + * 创建 BlockEntity,开发者可以通过该接口将部分或全部数据存放于 BlockEntity。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/block-v2/entity/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/blockv2/CreateEntitySample.java ; + */ + public CreateEntityResp create(CreateEntityReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/block/v2/entities" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/block/v2/entities" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建 BlockEntity,开发者可以通过该接口将部分或全部数据存放于 BlockEntity。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/block-v2/entity/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/blockv2/CreateEntitySample.java ; + */ + public CreateEntityResp create(CreateEntityReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/block/v2/entities" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/block/v2/entities" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新BlockEntity,开发者通过该接口可以更新存储在BlockEntity中的数据,并实时推送到端侧。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/block-v2/entity/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/blockv2/UpdateEntitySample.java ; + */ + public UpdateEntityResp update(UpdateEntityReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/block/v2/entities/:block_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/block/v2/entities/:block_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新BlockEntity,开发者通过该接口可以更新存储在BlockEntity中的数据,并实时推送到端侧。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/block-v2/entity/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/blockv2/UpdateEntitySample.java ; + */ + public UpdateEntityResp update(UpdateEntityReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/block/v2/entities/:block_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/block/v2/entities/:block_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/block/v2/resource/Message.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/block/v2/resource/Message.java new file mode 100644 index 000000000..d74afb3df --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/block/v2/resource/Message.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.block.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.block.v2.model.CreateMessageReq; +import com.lark.oapi.service.block.v2.model.CreateMessageResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Message { + private static final Logger log = LoggerFactory.getLogger(Message.class); + private final Config config; + + public Message(Config config) { + this.config = config; + } + + + /** + * Block协同数据推送,根据BlockID向指定用户列表推送协同数据。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/block-v2/message/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/blockv2/CreateMessageSample.java ; + */ + public CreateMessageResp create(CreateMessageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/block/v2/message" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/block/v2/message" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * Block协同数据推送,根据BlockID向指定用户列表推送协同数据。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/block-v2/message/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/blockv2/CreateMessageSample.java ; + */ + public CreateMessageResp create(CreateMessageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/block/v2/message" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/block/v2/message" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/CalendarService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/CalendarService.java new file mode 100644 index 000000000..89bde90f5 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/CalendarService.java @@ -0,0 +1,122 @@ +// Code generated by lark suite 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 com.lark.oapi.service.calendar; + +import com.lark.oapi.core.Config; +import com.lark.oapi.event.IEventHandler; +import com.lark.oapi.service.calendar.v4.V4; +import com.lark.oapi.service.calendar.v4.model.P2CalendarAclCreatedV4; +import com.lark.oapi.service.calendar.v4.model.P2CalendarAclDeletedV4; +import com.lark.oapi.service.calendar.v4.model.P2CalendarChangedV4; +import com.lark.oapi.service.calendar.v4.model.P2CalendarEventChangedV4; +import com.lark.oapi.service.calendar.v4.resource.*; + +public class CalendarService { + private final V4 v4; + private final Calendar calendar; // 日历管理 + private final CalendarAcl calendarAcl; // 日历访问控制 + private final CalendarEvent calendarEvent; // 日程 + private final CalendarEventAttendee calendarEventAttendee; // 日程参与人 + private final CalendarEventAttendeeChatMember calendarEventAttendeeChatMember; // 日程参与人群成员 + private final CalendarEventMeetingChat calendarEventMeetingChat; // calendar.event.meeting_chat + private final ExchangeBinding exchangeBinding; // Exchange绑定 + private final Freebusy freebusy; // freebusy + private final Setting setting; // 日历设置 + private final TimeoffEvent timeoffEvent; // 请假 + + public CalendarService(Config config) { + this.v4 = new V4(config); + this.calendar = new Calendar(config); + this.calendarAcl = new CalendarAcl(config); + this.calendarEvent = new CalendarEvent(config); + this.calendarEventAttendee = new CalendarEventAttendee(config); + this.calendarEventAttendeeChatMember = new CalendarEventAttendeeChatMember(config); + this.calendarEventMeetingChat = new CalendarEventMeetingChat(config); + this.exchangeBinding = new ExchangeBinding(config); + this.freebusy = new Freebusy(config); + this.setting = new Setting(config); + this.timeoffEvent = new TimeoffEvent(config); + } + + public V4 v4() { + return v4; + } + + public Calendar calendar() { + return calendar; + } + + public CalendarAcl calendarAcl() { + return calendarAcl; + } + + public CalendarEvent calendarEvent() { + return calendarEvent; + } + + public CalendarEventAttendee calendarEventAttendee() { + return calendarEventAttendee; + } + + public CalendarEventAttendeeChatMember calendarEventAttendeeChatMember() { + return calendarEventAttendeeChatMember; + } + + public CalendarEventMeetingChat calendarEventMeetingChat() { + return calendarEventMeetingChat; + } + + public ExchangeBinding exchangeBinding() { + return exchangeBinding; + } + + public Freebusy freebusy() { + return freebusy; + } + + public Setting setting() { + return setting; + } + + public TimeoffEvent timeoffEvent() { + return timeoffEvent; + } + + public abstract static class P2CalendarChangedV4Handler implements IEventHandler { + @Override + public P2CalendarChangedV4 getEvent() { + return new P2CalendarChangedV4(); + } + } + + public abstract static class P2CalendarAclCreatedV4Handler implements IEventHandler { + @Override + public P2CalendarAclCreatedV4 getEvent() { + return new P2CalendarAclCreatedV4(); + } + } + + public abstract static class P2CalendarAclDeletedV4Handler implements IEventHandler { + @Override + public P2CalendarAclDeletedV4 getEvent() { + return new P2CalendarAclDeletedV4(); + } + } + + public abstract static class P2CalendarEventChangedV4Handler implements IEventHandler { + @Override + public P2CalendarEventChangedV4 getEvent() { + return new P2CalendarEventChangedV4(); + } + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/CalendarService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/CalendarService.java deleted file mode 100644 index bca33f117..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/CalendarService.java +++ /dev/null @@ -1,2744 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.calendar.v4; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.event.IEventHandler; -import com.lark.oapi.service.calendar.v4.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class CalendarService { - private static final Logger log = LoggerFactory.getLogger(CalendarService.class); - private final Calendar calendar; // 日历管理 - private final CalendarAcl calendarAcl; // 日历访问控制 - private final CalendarEvent calendarEvent; // 日程 - private final CalendarEventAttendee calendarEventAttendee; // 日程参与人 - private final CalendarEventAttendeeChatMember calendarEventAttendeeChatMember; // 日程参与人群成员 - private final CalendarEventMeetingChat calendarEventMeetingChat; // calendar.event.meeting_chat - private final ExchangeBinding exchangeBinding; // Exchange绑定 - private final Freebusy freebusy; // freebusy - private final Setting setting; // 日历设置 - private final TimeoffEvent timeoffEvent; // 请假 - - public CalendarService(Config config) { - this.calendar = new Calendar(config); - this.calendarAcl = new CalendarAcl(config); - this.calendarEvent = new CalendarEvent(config); - this.calendarEventAttendee = new CalendarEventAttendee(config); - this.calendarEventAttendeeChatMember = new CalendarEventAttendeeChatMember(config); - this.calendarEventMeetingChat = new CalendarEventMeetingChat(config); - this.exchangeBinding = new ExchangeBinding(config); - this.freebusy = new Freebusy(config); - this.setting = new Setting(config); - this.timeoffEvent = new TimeoffEvent(config); - } - - /** - * 日历管理 - * - * @return - */ - public Calendar calendar() { - return calendar; - } - - /** - * 日历访问控制 - * - * @return - */ - public CalendarAcl calendarAcl() { - return calendarAcl; - } - - /** - * 日程 - * - * @return - */ - public CalendarEvent calendarEvent() { - return calendarEvent; - } - - /** - * 日程参与人 - * - * @return - */ - public CalendarEventAttendee calendarEventAttendee() { - return calendarEventAttendee; - } - - /** - * 日程参与人群成员 - * - * @return - */ - public CalendarEventAttendeeChatMember calendarEventAttendeeChatMember() { - return calendarEventAttendeeChatMember; - } - - /** - * calendar.event.meeting_chat - * - * @return - */ - public CalendarEventMeetingChat calendarEventMeetingChat() { - return calendarEventMeetingChat; - } - - /** - * Exchange绑定 - * - * @return - */ - public ExchangeBinding exchangeBinding() { - return exchangeBinding; - } - - /** - * freebusy - * - * @return - */ - public Freebusy freebusy() { - return freebusy; - } - - /** - * 日历设置 - * - * @return - */ - public Setting setting() { - return setting; - } - - /** - * 请假 - * - * @return - */ - public TimeoffEvent timeoffEvent() { - return timeoffEvent; - } - - public static class Calendar { - private final Config config; - - public Calendar(Config config) { - this.config = config; - } - - /** - * 创建共享日历,该接口用于为当前身份(应用 / 用户)创建一个共享日历。;;身份由 Header Authorization 的 Token 类型决定。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarSample.java ; - */ - public CreateCalendarResp create(CreateCalendarReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCalendarResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建共享日历,该接口用于为当前身份(应用 / 用户)创建一个共享日历。;;身份由 Header Authorization 的 Token 类型决定。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarSample.java ; - */ - public CreateCalendarResp create(CreateCalendarReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCalendarResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除共享日历,该接口用于以当前身份(应用 / 用户)删除一个共享日历。;;身份由 Header Authorization 的 Token 类型决定。 - *

当前身份必须对日历具有 owner 权限。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarSample.java ; - */ - public DeleteCalendarResp delete(DeleteCalendarReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/calendar/v4/calendars/:calendar_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteCalendarResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除共享日历,该接口用于以当前身份(应用 / 用户)删除一个共享日历。;;身份由 Header Authorization 的 Token 类型决定。 - *

当前身份必须对日历具有 owner 权限。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarSample.java ; - */ - public DeleteCalendarResp delete(DeleteCalendarReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/calendar/v4/calendars/:calendar_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteCalendarResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询日历信息,该接口用于以当前身份(应用 / 用户)根据日历 ID 获取日历信息。;;身份由 Header Authorization 的 Token 类型决定。 - *

当前身份必须对日历有访问权限。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GetCalendarSample.java ; - */ - public GetCalendarResp get(GetCalendarReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/calendar/v4/calendars/:calendar_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCalendarResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询日历信息,该接口用于以当前身份(应用 / 用户)根据日历 ID 获取日历信息。;;身份由 Header Authorization 的 Token 类型决定。 - *

当前身份必须对日历有访问权限。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GetCalendarSample.java ; - */ - public GetCalendarResp get(GetCalendarReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/calendar/v4/calendars/:calendar_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCalendarResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询日历列表,该接口用于分页获得当前身份(应用 / 用户)的日历列表。;;身份由 Header Authorization 的 Token 类型决定。 - *

调用时首先使用 page_token 分页拉取存量数据,之后使用 sync_token 增量同步变更数据。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarSample.java ; - */ - public ListCalendarResp list(ListCalendarReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/calendar/v4/calendars" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCalendarResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询日历列表,该接口用于分页获得当前身份(应用 / 用户)的日历列表。;;身份由 Header Authorization 的 Token 类型决定。 - *

调用时首先使用 page_token 分页拉取存量数据,之后使用 sync_token 增量同步变更数据。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarSample.java ; - */ - public ListCalendarResp list(ListCalendarReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/calendar/v4/calendars" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCalendarResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新日历信息,该接口用于以当前身份(应用 / 用户)修改日历信息。;;身份由 Header Authorization 的 Token 类型决定。 - *

当前身份对日历有 owner 权限时,可修改全局字段:summary, description, permission。;;当前身份对日历不具有 owner 权限时,仅可修改对自己生效的字段:color, summary_alias。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/PatchCalendarSample.java ; - */ - public PatchCalendarResp patch(PatchCalendarReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/calendar/v4/calendars/:calendar_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchCalendarResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新日历信息,该接口用于以当前身份(应用 / 用户)修改日历信息。;;身份由 Header Authorization 的 Token 类型决定。 - *

当前身份对日历有 owner 权限时,可修改全局字段:summary, description, permission。;;当前身份对日历不具有 owner 权限时,仅可修改对自己生效的字段:color, summary_alias。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/PatchCalendarSample.java ; - */ - public PatchCalendarResp patch(PatchCalendarReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/calendar/v4/calendars/:calendar_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchCalendarResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询主日历信息,获取当前身份的主日历信息。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/primary ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/PrimaryCalendarSample.java ; - */ - public PrimaryCalendarResp primary(PrimaryCalendarReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/primary" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PrimaryCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PrimaryCalendarResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/primary" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询主日历信息,获取当前身份的主日历信息。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/primary ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/PrimaryCalendarSample.java ; - */ - public PrimaryCalendarResp primary(PrimaryCalendarReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/primary" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PrimaryCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PrimaryCalendarResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/primary" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 搜索日历,该接口用于通过关键字查询公共日历或用户主日历。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/search ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SearchCalendarSample.java ; - */ - public SearchCalendarResp search(SearchCalendarReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/search" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - SearchCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchCalendarResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 搜索日历,该接口用于通过关键字查询公共日历或用户主日历。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/search ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SearchCalendarSample.java ; - */ - public SearchCalendarResp search(SearchCalendarReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/search" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - SearchCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchCalendarResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 订阅日历,该接口用于以当前身份(应用 / 用户)订阅某个日历。;;身份由 Header Authorization 的 Token 类型决定。 - *

- 仅可订阅类型为 primary 或 shared 的公开日历。;- 可订阅日历数量上限为1000。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/subscribe ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscribeCalendarSample.java ; - */ - public SubscribeCalendarResp subscribe(SubscribeCalendarReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/:calendar_id/subscribe" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - SubscribeCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscribeCalendarResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/subscribe" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 订阅日历,该接口用于以当前身份(应用 / 用户)订阅某个日历。;;身份由 Header Authorization 的 Token 类型决定。 - *

- 仅可订阅类型为 primary 或 shared 的公开日历。;- 可订阅日历数量上限为1000。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/subscribe ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscribeCalendarSample.java ; - */ - public SubscribeCalendarResp subscribe(SubscribeCalendarReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/:calendar_id/subscribe" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - SubscribeCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscribeCalendarResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/subscribe" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 订阅日历变更事件,该接口用于以用户身份订阅当前身份下日历列表中的所有日历变更。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/subscription ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscriptionCalendarSample.java ; - */ - public SubscriptionCalendarResp subscription(RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/subscription" - , Sets.newHashSet(AccessTokenType.User) - , null); - - // 反序列化 - SubscriptionCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscriptionCalendarResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/subscription" - , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - return resp; - } - - /** - * 订阅日历变更事件,该接口用于以用户身份订阅当前身份下日历列表中的所有日历变更。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/subscription ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscriptionCalendarSample.java ; - */ - public SubscriptionCalendarResp subscription() throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/subscription" - , Sets.newHashSet(AccessTokenType.User) - , null); - - // 反序列化 - SubscriptionCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscriptionCalendarResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/subscription" - , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - return resp; - } - - /** - * 取消订阅日历,该接口用于以当前身份(应用 / 用户)取消对某日历的订阅状态。;;身份由 Header Authorization 的 Token 类型决定。 - *

仅可操作已经被当前身份订阅的日历。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/unsubscribe ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscribeCalendarSample.java ; - */ - public UnsubscribeCalendarResp unsubscribe(UnsubscribeCalendarReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/:calendar_id/unsubscribe" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UnsubscribeCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnsubscribeCalendarResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/unsubscribe" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 取消订阅日历,该接口用于以当前身份(应用 / 用户)取消对某日历的订阅状态。;;身份由 Header Authorization 的 Token 类型决定。 - *

仅可操作已经被当前身份订阅的日历。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/unsubscribe ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscribeCalendarSample.java ; - */ - public UnsubscribeCalendarResp unsubscribe(UnsubscribeCalendarReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/:calendar_id/unsubscribe" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UnsubscribeCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnsubscribeCalendarResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/unsubscribe" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 取消订阅日历变更事件,该接口用于以用户身份取消订阅当前身份下日历列表中的日历变更事件。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/unsubscription ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscriptionCalendarSample.java ; - */ - public UnsubscriptionCalendarResp unsubscription(RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/unsubscription" - , Sets.newHashSet(AccessTokenType.User) - , null); - - // 反序列化 - UnsubscriptionCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnsubscriptionCalendarResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/unsubscription" - , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - return resp; - } - - /** - * 取消订阅日历变更事件,该接口用于以用户身份取消订阅当前身份下日历列表中的日历变更事件。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/unsubscription ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscriptionCalendarSample.java ; - */ - public UnsubscriptionCalendarResp unsubscription() throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/unsubscription" - , Sets.newHashSet(AccessTokenType.User) - , null); - - // 反序列化 - UnsubscriptionCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnsubscriptionCalendarResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/unsubscription" - , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - return resp; - } - } - - public static class CalendarAcl { - private final Config config; - - public CalendarAcl(Config config) { - this.config = config; - } - - /** - * 创建访问控制,该接口用于以当前身份(应用 / 用户)给日历添加访问控制权限,即日历成员。;;身份由 Header Authorization 的 Token 类型决定。 - *

当前身份需要有日历的 owner 权限,并且日历的类型只能为 primary 或 shared。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarAclSample.java ; - */ - public CreateCalendarAclResp create(CreateCalendarAclReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/:calendar_id/acls" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateCalendarAclResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCalendarAclResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/acls" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建访问控制,该接口用于以当前身份(应用 / 用户)给日历添加访问控制权限,即日历成员。;;身份由 Header Authorization 的 Token 类型决定。 - *

当前身份需要有日历的 owner 权限,并且日历的类型只能为 primary 或 shared。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarAclSample.java ; - */ - public CreateCalendarAclResp create(CreateCalendarAclReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/:calendar_id/acls" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateCalendarAclResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCalendarAclResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/acls" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除访问控制,该接口用于以当前身份(应用 / 用户)删除日历的控制权限,即日历成员。;;身份由 Header Authorization 的 Token 类型决定。 - *

当前身份需要有日历的 owner 权限,并且日历的类型只能为 primary 或 shared。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarAclSample.java ; - */ - public DeleteCalendarAclResp delete(DeleteCalendarAclReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/calendar/v4/calendars/:calendar_id/acls/:acl_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteCalendarAclResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteCalendarAclResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/acls/:acl_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除访问控制,该接口用于以当前身份(应用 / 用户)删除日历的控制权限,即日历成员。;;身份由 Header Authorization 的 Token 类型决定。 - *

当前身份需要有日历的 owner 权限,并且日历的类型只能为 primary 或 shared。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarAclSample.java ; - */ - public DeleteCalendarAclResp delete(DeleteCalendarAclReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/calendar/v4/calendars/:calendar_id/acls/:acl_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteCalendarAclResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteCalendarAclResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/acls/:acl_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取访问控制列表,该接口用于以当前身份(应用 / 用户)获取日历的控制权限列表。;;身份由 Header Authorization 的 Token 类型决定。 - *

当前身份需要有日历的 owner 权限,并且日历的类型只能为 primary 或 shared。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarAclSample.java ; - */ - public ListCalendarAclResp list(ListCalendarAclReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/calendar/v4/calendars/:calendar_id/acls" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListCalendarAclResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCalendarAclResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/acls" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取访问控制列表,该接口用于以当前身份(应用 / 用户)获取日历的控制权限列表。;;身份由 Header Authorization 的 Token 类型决定。 - *

当前身份需要有日历的 owner 权限,并且日历的类型只能为 primary 或 shared。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarAclSample.java ; - */ - public ListCalendarAclResp list(ListCalendarAclReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/calendar/v4/calendars/:calendar_id/acls" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListCalendarAclResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCalendarAclResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/acls" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 订阅日历访问控制变更事件;,该接口用于以用户身份订阅指定日历下的日历成员变更事件。 - *

用户必须对日历有访问权限。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/subscription ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscriptionCalendarAclSample.java ; - */ - public SubscriptionCalendarAclResp subscription(SubscriptionCalendarAclReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/:calendar_id/acls/subscription" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - SubscriptionCalendarAclResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscriptionCalendarAclResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/acls/subscription" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 订阅日历访问控制变更事件;,该接口用于以用户身份订阅指定日历下的日历成员变更事件。 - *

用户必须对日历有访问权限。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/subscription ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscriptionCalendarAclSample.java ; - */ - public SubscriptionCalendarAclResp subscription(SubscriptionCalendarAclReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/:calendar_id/acls/subscription" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - SubscriptionCalendarAclResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscriptionCalendarAclResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/acls/subscription" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 取消订阅日历访问控制变更事件,该接口用于以用户身份取消订阅指定日历下的日历成员变更事件。 - *

用户必须对日历有访问权限。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/unsubscription ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscriptionCalendarAclSample.java ; - */ - public UnsubscriptionCalendarAclResp unsubscription(UnsubscriptionCalendarAclReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/:calendar_id/acls/unsubscription" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - UnsubscriptionCalendarAclResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnsubscriptionCalendarAclResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/acls/unsubscription" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 取消订阅日历访问控制变更事件,该接口用于以用户身份取消订阅指定日历下的日历成员变更事件。 - *

用户必须对日历有访问权限。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/unsubscription ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscriptionCalendarAclSample.java ; - */ - public UnsubscriptionCalendarAclResp unsubscription(UnsubscriptionCalendarAclReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/:calendar_id/acls/unsubscription" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - UnsubscriptionCalendarAclResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnsubscriptionCalendarAclResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/acls/unsubscription" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class CalendarEvent { - private final Config config; - - public CalendarEvent(Config config) { - this.config = config; - } - - /** - * 创建日程,该接口用于以当前身份(应用 / 用户)在日历上创建一个日程。;;身份由 Header Authorization 的 Token 类型决定。 - *

当前身份必须对日历有 writer 或 owner 权限,并且日历的类型只能为 primary 或 shared。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarEventSample.java ; - */ - public CreateCalendarEventResp create(CreateCalendarEventReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/:calendar_id/events" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCalendarEventResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建日程,该接口用于以当前身份(应用 / 用户)在日历上创建一个日程。;;身份由 Header Authorization 的 Token 类型决定。 - *

当前身份必须对日历有 writer 或 owner 权限,并且日历的类型只能为 primary 或 shared。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarEventSample.java ; - */ - public CreateCalendarEventResp create(CreateCalendarEventReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/:calendar_id/events" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCalendarEventResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除日程,该接口用于以当前身份(应用 / 用户)删除日历上的一个日程。;;身份由 Header Authorization 的 Token 类型决定。 - *

当前身份必须对日历有 writer 或 owner 权限,并且日历的类型只能为 primary 或 shared。;;当前身份必须是日程的组织者。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarEventSample.java ; - */ - public DeleteCalendarEventResp delete(DeleteCalendarEventReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteCalendarEventResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除日程,该接口用于以当前身份(应用 / 用户)删除日历上的一个日程。;;身份由 Header Authorization 的 Token 类型决定。 - *

当前身份必须对日历有 writer 或 owner 权限,并且日历的类型只能为 primary 或 shared。;;当前身份必须是日程的组织者。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarEventSample.java ; - */ - public DeleteCalendarEventResp delete(DeleteCalendarEventReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteCalendarEventResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取日程,该接口用于以当前身份(应用 / 用户)获取日历上的一个日程。;身份由 Header Authorization 的 Token 类型决定。 - *

- 当前身份必须对日历有reader、writer或owner权限才会返回日程详细信息(调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口,role字段可查看权限)。;- [例外日程](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/introduction#71c5ec78)可通过event_id的非0时间戳后缀,来获取修改的重复性日程的哪一天日程的时间信息。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GetCalendarEventSample.java ; - */ - public GetCalendarEventResp get(GetCalendarEventReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCalendarEventResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取日程,该接口用于以当前身份(应用 / 用户)获取日历上的一个日程。;身份由 Header Authorization 的 Token 类型决定。 - *

- 当前身份必须对日历有reader、writer或owner权限才会返回日程详细信息(调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口,role字段可查看权限)。;- [例外日程](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/introduction#71c5ec78)可通过event_id的非0时间戳后缀,来获取修改的重复性日程的哪一天日程的时间信息。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GetCalendarEventSample.java ; - */ - public GetCalendarEventResp get(GetCalendarEventReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCalendarEventResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取日程列表,该接口用于以当前身份(应用 / 用户)获取日历下的日程列表。;身份由 Header Authorization 的 Token 类型决定。 - *

- 当前身份必须对日历有reader、writer或owner权限才会返回日程详细信息(调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口,role字段可查看权限)。;;- 仅支持primary、shared和resource类型的日历获取日程列表。;;- page_token 分页拉取存量数据,sync_token 增量同步变更数据;目前仅传anchor_time时,会返回page_token。;;- 为了确保调用方日程同步数据的一致性,在使用sync_token时,不能同时使用start_time和end_time,否则可能造成日程数据缺失。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarEventSample.java ; - */ - public ListCalendarEventResp list(ListCalendarEventReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/calendar/v4/calendars/:calendar_id/events" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCalendarEventResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取日程列表,该接口用于以当前身份(应用 / 用户)获取日历下的日程列表。;身份由 Header Authorization 的 Token 类型决定。 - *

- 当前身份必须对日历有reader、writer或owner权限才会返回日程详细信息(调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口,role字段可查看权限)。;;- 仅支持primary、shared和resource类型的日历获取日程列表。;;- page_token 分页拉取存量数据,sync_token 增量同步变更数据;目前仅传anchor_time时,会返回page_token。;;- 为了确保调用方日程同步数据的一致性,在使用sync_token时,不能同时使用start_time和end_time,否则可能造成日程数据缺失。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarEventSample.java ; - */ - public ListCalendarEventResp list(ListCalendarEventReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/calendar/v4/calendars/:calendar_id/events" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCalendarEventResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新日程,该接口用于以当前身份(应用 / 用户)更新日历上的一个日程。;;身份由 Header Authorization 的 Token 类型决定。 - *

当前身份必须对日历有 writer 或 owner 权限,并且日历的类型只能为 primary 或 shared。;;当前身份为日程组织者时,可修改所有可编辑字段。;;当前身份为日程参与者时,仅可编辑部分字段。(如:visibility, free_busy_status, color, reminders) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/PatchCalendarEventSample.java ; - */ - public PatchCalendarEventResp patch(PatchCalendarEventReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchCalendarEventResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新日程,该接口用于以当前身份(应用 / 用户)更新日历上的一个日程。;;身份由 Header Authorization 的 Token 类型决定。 - *

当前身份必须对日历有 writer 或 owner 权限,并且日历的类型只能为 primary 或 shared。;;当前身份为日程组织者时,可修改所有可编辑字段。;;当前身份为日程参与者时,仅可编辑部分字段。(如:visibility, free_busy_status, color, reminders) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/PatchCalendarEventSample.java ; - */ - public PatchCalendarEventResp patch(PatchCalendarEventReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchCalendarEventResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 搜索日程,该接口用于以用户身份搜索某日历下的相关日程。;;身份由 Header Authorization 的 Token 类型决定。 - *

当前身份必须对日历有reader、writer或owner权限(调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口,role字段可查看权限)。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/search ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SearchCalendarEventSample.java ; - */ - public SearchCalendarEventResp search(SearchCalendarEventReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/:calendar_id/events/search" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - SearchCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchCalendarEventResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 搜索日程,该接口用于以用户身份搜索某日历下的相关日程。;;身份由 Header Authorization 的 Token 类型决定。 - *

当前身份必须对日历有reader、writer或owner权限(调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口,role字段可查看权限)。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/search ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SearchCalendarEventSample.java ; - */ - public SearchCalendarEventResp search(SearchCalendarEventReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/:calendar_id/events/search" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - SearchCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchCalendarEventResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 订阅日程变更事件,该接口用于以用户身份订阅指定日历下的日程变更事件。 - *

当前身份必须对日历有reader、writer或owner权限(调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口,role字段可查看权限)。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/subscription ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscriptionCalendarEventSample.java ; - */ - public SubscriptionCalendarEventResp subscription(SubscriptionCalendarEventReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/:calendar_id/events/subscription" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - SubscriptionCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscriptionCalendarEventResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/subscription" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 订阅日程变更事件,该接口用于以用户身份订阅指定日历下的日程变更事件。 - *

当前身份必须对日历有reader、writer或owner权限(调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口,role字段可查看权限)。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/subscription ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscriptionCalendarEventSample.java ; - */ - public SubscriptionCalendarEventResp subscription(SubscriptionCalendarEventReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/:calendar_id/events/subscription" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - SubscriptionCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscriptionCalendarEventResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/subscription" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 取消订阅日程变更事件,该接口用于以用户身份取消订阅指定日历下的日程变更事件。 - *

当前身份必须对日历有reader、writer或owner权限(调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口,role字段可查看权限)。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/unsubscription ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscriptionCalendarEventSample.java ; - */ - public UnsubscriptionCalendarEventResp unsubscription(UnsubscriptionCalendarEventReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/:calendar_id/events/unsubscription" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - UnsubscriptionCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnsubscriptionCalendarEventResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/unsubscription" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 取消订阅日程变更事件,该接口用于以用户身份取消订阅指定日历下的日程变更事件。 - *

当前身份必须对日历有reader、writer或owner权限(调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口,role字段可查看权限)。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/unsubscription ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscriptionCalendarEventSample.java ; - */ - public UnsubscriptionCalendarEventResp unsubscription(UnsubscriptionCalendarEventReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/:calendar_id/events/unsubscription" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - UnsubscriptionCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnsubscriptionCalendarEventResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/unsubscription" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class CalendarEventAttendee { - private final Config config; - - public CalendarEventAttendee(Config config) { - this.config = config; - } - - /** - * 删除日程参与人,批量删除日程的参与人。 - *

- 当前身份需要有日历的 writer 或 owner 权限,并且日历的类型只能为 primary 或 shared。;;- 当前身份需要是日程的组织者。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee/batch_delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/BatchDeleteCalendarEventAttendeeSample.java ; - */ - public BatchDeleteCalendarEventAttendeeResp batchDelete(BatchDeleteCalendarEventAttendeeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/batch_delete" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - BatchDeleteCalendarEventAttendeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteCalendarEventAttendeeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除日程参与人,批量删除日程的参与人。 - *

- 当前身份需要有日历的 writer 或 owner 权限,并且日历的类型只能为 primary 或 shared。;;- 当前身份需要是日程的组织者。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee/batch_delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/BatchDeleteCalendarEventAttendeeSample.java ; - */ - public BatchDeleteCalendarEventAttendeeResp batchDelete(BatchDeleteCalendarEventAttendeeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/batch_delete" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - BatchDeleteCalendarEventAttendeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteCalendarEventAttendeeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建日程参与人;,批量给日程添加参与人。 - *

- 当前身份需要有日历的 writer 或 owner 权限,并且日历的类型只能为 primary 或 shared。;;- 当前身份需要是日程的组织者,或日程设置了「参与人可邀请其它参与人」权限。;;- 新添加的日程参与人必须与日程组织者在同一个企业内。;;- 使用该接口添加会议室后,会议室会进入异步的预约流程,请求结束不代表会议室预约成功,需后续再查询预约状态。;;- 每个日程最多只能有 3000 名参与人。;;- 开启管理员能力后预约会议室可不受会议室预约范围的限制(当前不支持用管理员身份给其他人的日程预约会议室) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarEventAttendeeSample.java ; - */ - public CreateCalendarEventAttendeeResp create(CreateCalendarEventAttendeeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateCalendarEventAttendeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCalendarEventAttendeeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建日程参与人;,批量给日程添加参与人。 - *

- 当前身份需要有日历的 writer 或 owner 权限,并且日历的类型只能为 primary 或 shared。;;- 当前身份需要是日程的组织者,或日程设置了「参与人可邀请其它参与人」权限。;;- 新添加的日程参与人必须与日程组织者在同一个企业内。;;- 使用该接口添加会议室后,会议室会进入异步的预约流程,请求结束不代表会议室预约成功,需后续再查询预约状态。;;- 每个日程最多只能有 3000 名参与人。;;- 开启管理员能力后预约会议室可不受会议室预约范围的限制(当前不支持用管理员身份给其他人的日程预约会议室) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarEventAttendeeSample.java ; - */ - public CreateCalendarEventAttendeeResp create(CreateCalendarEventAttendeeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateCalendarEventAttendeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCalendarEventAttendeeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取日程参与人列表,获取日程的参与人列表,若参与者列表中有群组,请使用 [获取参与人群成员列表](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee-chat_member/list) 。 - *

- 当前身份必须对日历有reader、writer或owner权限(调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口,role字段可查看权限)。;;- 当前身份必须有权限查看日程的参与人列表。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarEventAttendeeSample.java ; - */ - public ListCalendarEventAttendeeResp list(ListCalendarEventAttendeeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListCalendarEventAttendeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCalendarEventAttendeeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取日程参与人列表,获取日程的参与人列表,若参与者列表中有群组,请使用 [获取参与人群成员列表](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee-chat_member/list) 。 - *

- 当前身份必须对日历有reader、writer或owner权限(调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口,role字段可查看权限)。;;- 当前身份必须有权限查看日程的参与人列表。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarEventAttendeeSample.java ; - */ - public ListCalendarEventAttendeeResp list(ListCalendarEventAttendeeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListCalendarEventAttendeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCalendarEventAttendeeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class CalendarEventAttendeeChatMember { - private final Config config; - - public CalendarEventAttendeeChatMember(Config config) { - this.config = config; - } - - /** - * 获取日程参与群成员列表,获取日程的群参与人的群成员列表。 - *

- 当前身份必须有权限查看日程的参与人列表。;;- 当前身份必须在群聊中,或有权限查看群成员列表。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee-chat_member/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarEventAttendeeChatMemberSample.java ; - */ - public ListCalendarEventAttendeeChatMemberResp list(ListCalendarEventAttendeeChatMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListCalendarEventAttendeeChatMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCalendarEventAttendeeChatMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取日程参与群成员列表,获取日程的群参与人的群成员列表。 - *

- 当前身份必须有权限查看日程的参与人列表。;;- 当前身份必须在群聊中,或有权限查看群成员列表。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee-chat_member/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarEventAttendeeChatMemberSample.java ; - */ - public ListCalendarEventAttendeeChatMemberResp list(ListCalendarEventAttendeeChatMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListCalendarEventAttendeeChatMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCalendarEventAttendeeChatMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class CalendarEventMeetingChat { - private final Config config; - - public CalendarEventMeetingChat(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=calendar&resource=calendar.event.meeting_chat&version=v4 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarEventMeetingChatSample.java ; - */ - public CreateCalendarEventMeetingChatResp create(CreateCalendarEventMeetingChatReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateCalendarEventMeetingChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCalendarEventMeetingChatResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=calendar&resource=calendar.event.meeting_chat&version=v4 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarEventMeetingChatSample.java ; - */ - public CreateCalendarEventMeetingChatResp create(CreateCalendarEventMeetingChatReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateCalendarEventMeetingChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCalendarEventMeetingChatResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=calendar&resource=calendar.event.meeting_chat&version=v4 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarEventMeetingChatSample.java ; - */ - public DeleteCalendarEventMeetingChatResp delete(DeleteCalendarEventMeetingChatReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteCalendarEventMeetingChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteCalendarEventMeetingChatResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=calendar&resource=calendar.event.meeting_chat&version=v4 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarEventMeetingChatSample.java ; - */ - public DeleteCalendarEventMeetingChatResp delete(DeleteCalendarEventMeetingChatReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteCalendarEventMeetingChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteCalendarEventMeetingChatResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ExchangeBinding { - private final Config config; - - public ExchangeBinding(Config config) { - this.config = config; - } - - /** - * 创建Exchange绑定关系,本接口将Exchange账户绑定到飞书账户,进而支持Exchange日历的导入 - *

操作用户需要是企业超级管理员 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/exchange_binding/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateExchangeBindingSample.java ; - */ - public CreateExchangeBindingResp create(CreateExchangeBindingReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/exchange_bindings" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - CreateExchangeBindingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExchangeBindingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/exchange_bindings" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建Exchange绑定关系,本接口将Exchange账户绑定到飞书账户,进而支持Exchange日历的导入 - *

操作用户需要是企业超级管理员 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/exchange_binding/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateExchangeBindingSample.java ; - */ - public CreateExchangeBindingResp create(CreateExchangeBindingReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/exchange_bindings" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - CreateExchangeBindingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExchangeBindingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/exchange_bindings" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 解除Exchange绑定关系,本接口解除Exchange账户和飞书账户的绑定关系,Exchange账户解除绑定后才能绑定其他飞书账户 - *

操作用户需要是企业超级管理员 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/exchange_binding/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteExchangeBindingSample.java ; - */ - public DeleteExchangeBindingResp delete(DeleteExchangeBindingReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - DeleteExchangeBindingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteExchangeBindingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 解除Exchange绑定关系,本接口解除Exchange账户和飞书账户的绑定关系,Exchange账户解除绑定后才能绑定其他飞书账户 - *

操作用户需要是企业超级管理员 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/exchange_binding/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteExchangeBindingSample.java ; - */ - public DeleteExchangeBindingResp delete(DeleteExchangeBindingReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - DeleteExchangeBindingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteExchangeBindingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取绑定状态,本接口获取Exchange账户的绑定状态,包括exchange日历是否同步完成。 - *

操作用户需要是企业超级管理员 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/exchange_binding/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GetExchangeBindingSample.java ; - */ - public GetExchangeBindingResp get(GetExchangeBindingReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - GetExchangeBindingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetExchangeBindingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取绑定状态,本接口获取Exchange账户的绑定状态,包括exchange日历是否同步完成。 - *

操作用户需要是企业超级管理员 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/exchange_binding/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GetExchangeBindingSample.java ; - */ - public GetExchangeBindingResp get(GetExchangeBindingReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - GetExchangeBindingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetExchangeBindingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Freebusy { - private final Config config; - - public Freebusy(Config config) { - this.config = config; - } - - /** - * 查询主日历忙闲信息,查询用户主日历或会议室的忙闲信息。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/freebusy/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListFreebusySample.java ; - */ - public ListFreebusyResp list(ListFreebusyReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/freebusy/list" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListFreebusyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFreebusyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/freebusy/list" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询主日历忙闲信息,查询用户主日历或会议室的忙闲信息。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/freebusy/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListFreebusySample.java ; - */ - public ListFreebusyResp list(ListFreebusyReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/freebusy/list" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListFreebusyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFreebusyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/freebusy/list" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Setting { - private final Config config; - - public Setting(Config config) { - this.config = config; - } - - /** - * 生成CalDAV配置,用于为当前用户生成一个CalDAV账号密码,用于将飞书日历信息同步到本地设备日历。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/setting/generate_caldav_conf ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GenerateCaldavConfSettingSample.java ; - */ - public GenerateCaldavConfSettingResp generateCaldavConf(GenerateCaldavConfSettingReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/settings/generate_caldav_conf" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - GenerateCaldavConfSettingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GenerateCaldavConfSettingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/settings/generate_caldav_conf" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 生成CalDAV配置,用于为当前用户生成一个CalDAV账号密码,用于将飞书日历信息同步到本地设备日历。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/setting/generate_caldav_conf ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GenerateCaldavConfSettingSample.java ; - */ - public GenerateCaldavConfSettingResp generateCaldavConf(GenerateCaldavConfSettingReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/settings/generate_caldav_conf" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - GenerateCaldavConfSettingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GenerateCaldavConfSettingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/settings/generate_caldav_conf" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class TimeoffEvent { - private final Config config; - - public TimeoffEvent(Config config) { - this.config = config; - } - - /** - * 创建请假日程,为指定用户创建一个请假日程,可以是一个普通请假日程,也可以是一个全天日程。;创建请假日程后,会在相应时间内,在用户个人签名页展示请假信息。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/timeoff_event/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateTimeoffEventSample.java ; - */ - public CreateTimeoffEventResp create(CreateTimeoffEventReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/timeoff_events" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateTimeoffEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTimeoffEventResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/timeoff_events" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建请假日程,为指定用户创建一个请假日程,可以是一个普通请假日程,也可以是一个全天日程。;创建请假日程后,会在相应时间内,在用户个人签名页展示请假信息。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/timeoff_event/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateTimeoffEventSample.java ; - */ - public CreateTimeoffEventResp create(CreateTimeoffEventReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/calendar/v4/timeoff_events" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateTimeoffEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTimeoffEventResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/timeoff_events" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除请假日程,删除一个指定的请假日程,请假日程删除,用户个人签名页的请假信息也会消失。;一个应用只能删除自己创建的请假日程。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/timeoff_event/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteTimeoffEventSample.java ; - */ - public DeleteTimeoffEventResp delete(DeleteTimeoffEventReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/calendar/v4/timeoff_events/:timeoff_event_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteTimeoffEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTimeoffEventResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/timeoff_events/:timeoff_event_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除请假日程,删除一个指定的请假日程,请假日程删除,用户个人签名页的请假信息也会消失。;一个应用只能删除自己创建的请假日程。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/timeoff_event/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteTimeoffEventSample.java ; - */ - public DeleteTimeoffEventResp delete(DeleteTimeoffEventReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/calendar/v4/timeoff_events/:timeoff_event_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteTimeoffEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTimeoffEventResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/timeoff_events/:timeoff_event_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public abstract static class P2CalendarChangedV4Handler implements IEventHandler { - @Override - public P2CalendarChangedV4 getEvent() { - return new P2CalendarChangedV4(); - } - } - - public abstract static class P2CalendarAclCreatedV4Handler implements IEventHandler { - @Override - public P2CalendarAclCreatedV4 getEvent() { - return new P2CalendarAclCreatedV4(); - } - } - - public abstract static class P2CalendarAclDeletedV4Handler implements IEventHandler { - @Override - public P2CalendarAclDeletedV4 getEvent() { - return new P2CalendarAclDeletedV4(); - } - } - - public abstract static class P2CalendarEventChangedV4Handler implements IEventHandler { - @Override - public P2CalendarEventChangedV4 getEvent() { - return new P2CalendarEventChangedV4(); - } - } -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/V4.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/V4.java new file mode 100644 index 000000000..3f417aef3 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/V4.java @@ -0,0 +1,83 @@ +// Code generated by lark suite 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 com.lark.oapi.service.calendar.v4; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.calendar.v4.resource.*; + +public class V4 { + private final Calendar calendar; // 日历管理 + private final CalendarAcl calendarAcl; // 日历访问控制 + private final CalendarEvent calendarEvent; // 日程 + private final CalendarEventAttendee calendarEventAttendee; // 日程参与人 + private final CalendarEventAttendeeChatMember calendarEventAttendeeChatMember; // 日程参与人群成员 + private final CalendarEventMeetingChat calendarEventMeetingChat; // calendar.event.meeting_chat + private final ExchangeBinding exchangeBinding; // Exchange绑定 + private final Freebusy freebusy; // freebusy + private final Setting setting; // 日历设置 + private final TimeoffEvent timeoffEvent; // 请假 + + public V4(Config config) { + this.calendar = new Calendar(config); + this.calendarAcl = new CalendarAcl(config); + this.calendarEvent = new CalendarEvent(config); + this.calendarEventAttendee = new CalendarEventAttendee(config); + this.calendarEventAttendeeChatMember = new CalendarEventAttendeeChatMember(config); + this.calendarEventMeetingChat = new CalendarEventMeetingChat(config); + this.exchangeBinding = new ExchangeBinding(config); + this.freebusy = new Freebusy(config); + this.setting = new Setting(config); + this.timeoffEvent = new TimeoffEvent(config); + } + + public Calendar calendar() { + return calendar; + } + + public CalendarAcl calendarAcl() { + return calendarAcl; + } + + public CalendarEvent calendarEvent() { + return calendarEvent; + } + + public CalendarEventAttendee calendarEventAttendee() { + return calendarEventAttendee; + } + + public CalendarEventAttendeeChatMember calendarEventAttendeeChatMember() { + return calendarEventAttendeeChatMember; + } + + public CalendarEventMeetingChat calendarEventMeetingChat() { + return calendarEventMeetingChat; + } + + public ExchangeBinding exchangeBinding() { + return exchangeBinding; + } + + public Freebusy freebusy() { + return freebusy; + } + + public Setting setting() { + return setting; + } + + public TimeoffEvent timeoffEvent() { + return timeoffEvent; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/enums/InstanceEventStatusEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/enums/InstanceEventStatusEnum.java new file mode 100644 index 000000000..ea6e777d9 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/enums/InstanceEventStatusEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.calendar.v4.enums; + +/** + * 日程状态 + */ +public enum InstanceEventStatusEnum { + TENTATIVE("tentative"), // 未回应 + CONFIRMED("confirmed"), // 已确认 + CANCELLED("cancelled"), // 日程已取消 + ; + private String value; + + InstanceEventStatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/enums/ListCalendarEventUserIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/enums/ListCalendarEventUserIdTypeEnum.java new file mode 100644 index 000000000..fb96f8d64 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/enums/ListCalendarEventUserIdTypeEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.calendar.v4.enums; + +/** + * 此次调用中使用的用户ID的类型 + */ +public enum ListCalendarEventUserIdTypeEnum { + USER_ID("user_id"), // 以user_id来识别用户 + UNION_ID("union_id"), // 以union_id来识别用户 + OPEN_ID("open_id"), // 以open_id来识别用户 + ; + private String value; + + ListCalendarEventUserIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/BatchDeleteCalendarEventAttendeeReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/BatchDeleteCalendarEventAttendeeReq.java index cd5288396..96320e2e8 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/BatchDeleteCalendarEventAttendeeReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/BatchDeleteCalendarEventAttendeeReq.java @@ -42,6 +42,7 @@ public class BatchDeleteCalendarEventAttendeeReq { private String eventId; @Body private BatchDeleteCalendarEventAttendeeReqBody body; + // builder 开始 public BatchDeleteCalendarEventAttendeeReq() { } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/BookMeetingRoomData.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/BookMeetingRoomData.java index 79b65a492..a4ea1ff90 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/BookMeetingRoomData.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/BookMeetingRoomData.java @@ -34,6 +34,12 @@ public class BookMeetingRoomData { */ @SerializedName("rooms") private RoomMeta[] rooms; + /** + * 重复性日程规则 + *

示例值:none + */ + @SerializedName("recurrence_rule") + private String recurrenceRule; // builder 开始 public BookMeetingRoomData() { @@ -55,6 +61,11 @@ public BookMeetingRoomData(Builder builder) { *

示例值: */ this.rooms = builder.rooms; + /** + * 重复性日程规则 + *

示例值:none + */ + this.recurrenceRule = builder.recurrenceRule; } public static Builder newBuilder() { @@ -85,6 +96,14 @@ public void setRooms(RoomMeta[] rooms) { this.rooms = rooms; } + public String getRecurrenceRule() { + return this.recurrenceRule; + } + + public void setRecurrenceRule(String recurrenceRule) { + this.recurrenceRule = recurrenceRule; + } + public static class Builder { /** * 会议室ID @@ -101,6 +120,11 @@ public static class Builder { *

示例值: */ private RoomMeta[] rooms; + /** + * 重复性日程规则 + *

示例值:none + */ + private String recurrenceRule; /** * 会议室ID @@ -141,6 +165,19 @@ public Builder rooms(RoomMeta[] rooms) { } + /** + * 重复性日程规则 + *

示例值:none + * + * @param recurrenceRule + * @return + */ + public Builder recurrenceRule(String recurrenceRule) { + this.recurrenceRule = recurrenceRule; + return this; + } + + public BookMeetingRoomData build() { return new BookMeetingRoomData(this); } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/CalendarEvent.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/CalendarEvent.java index d9ac86d50..289eaefec 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/CalendarEvent.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/CalendarEvent.java @@ -136,6 +136,18 @@ public class CalendarEvent { */ @SerializedName("schemas") private Schema[] schemas; + /** + * 日程组织者信息 + *

示例值: + */ + @SerializedName("event_organizer") + private EventOrganizer eventOrganizer; + /** + * 日程的app_link,跳转到具体的某个日程 + *

示例值:https://applink.larkoffice.com/client/calendar/event/detail?calendarId=7039673579105026066&key=aeac9c56-aeb1-4179-a21b-02f278f59048&originalTime=0&startTime=1700496000 + */ + @SerializedName("app_link") + private String appLink; // builder 开始 public CalendarEvent() { @@ -242,6 +254,16 @@ public CalendarEvent(Builder builder) { *

示例值: */ this.schemas = builder.schemas; + /** + * 日程组织者信息 + *

示例值: + */ + this.eventOrganizer = builder.eventOrganizer; + /** + * 日程的app_link,跳转到具体的某个日程 + *

示例值:https://applink.larkoffice.com/client/calendar/event/detail?calendarId=7039673579105026066&key=aeac9c56-aeb1-4179-a21b-02f278f59048&originalTime=0&startTime=1700496000 + */ + this.appLink = builder.appLink; } public static Builder newBuilder() { @@ -408,6 +430,22 @@ public void setSchemas(Schema[] schemas) { this.schemas = schemas; } + public EventOrganizer getEventOrganizer() { + return this.eventOrganizer; + } + + public void setEventOrganizer(EventOrganizer eventOrganizer) { + this.eventOrganizer = eventOrganizer; + } + + public String getAppLink() { + return this.appLink; + } + + public void setAppLink(String appLink) { + this.appLink = appLink; + } + public static class Builder { /** * 日程ID。参见[日程ID说明](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/introduction) @@ -509,6 +547,16 @@ public static class Builder { *

示例值: */ private Schema[] schemas; + /** + * 日程组织者信息 + *

示例值: + */ + private EventOrganizer eventOrganizer; + /** + * 日程的app_link,跳转到具体的某个日程 + *

示例值:https://applink.larkoffice.com/client/calendar/event/detail?calendarId=7039673579105026066&key=aeac9c56-aeb1-4179-a21b-02f278f59048&originalTime=0&startTime=1700496000 + */ + private String appLink; /** * 日程ID。参见[日程ID说明](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/introduction) @@ -818,6 +866,32 @@ public Builder schemas(Schema[] schemas) { } + /** + * 日程组织者信息 + *

示例值: + * + * @param eventOrganizer + * @return + */ + public Builder eventOrganizer(EventOrganizer eventOrganizer) { + this.eventOrganizer = eventOrganizer; + return this; + } + + + /** + * 日程的app_link,跳转到具体的某个日程 + *

示例值:https://applink.larkoffice.com/client/calendar/event/detail?calendarId=7039673579105026066&key=aeac9c56-aeb1-4179-a21b-02f278f59048&originalTime=0&startTime=1700496000 + * + * @param appLink + * @return + */ + public Builder appLink(String appLink) { + this.appLink = appLink; + return this; + } + + public CalendarEvent build() { return new CalendarEvent(this); } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/CalendarPrimaryBatchReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/CalendarPrimaryBatchReq.java new file mode 100644 index 000000000..23340a368 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/CalendarPrimaryBatchReq.java @@ -0,0 +1,74 @@ +// Code generated by lark suite 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 com.lark.oapi.service.calendar.v4.model; + +import com.google.gson.annotations.SerializedName; + +public class CalendarPrimaryBatchReq { + /** + * 用户ID列表 + *

示例值: + */ + @SerializedName("user_ids") + private String[] userIds; + + // builder 开始 + public CalendarPrimaryBatchReq() { + } + + public CalendarPrimaryBatchReq(Builder builder) { + /** + * 用户ID列表 + *

示例值: + */ + this.userIds = builder.userIds; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String[] getUserIds() { + return this.userIds; + } + + public void setUserIds(String[] userIds) { + this.userIds = userIds; + } + + public static class Builder { + /** + * 用户ID列表 + *

示例值: + */ + private String[] userIds; + + /** + * 用户ID列表 + *

示例值: + * + * @param userIds + * @return + */ + public Builder userIds(String[] userIds) { + this.userIds = userIds; + return this; + } + + + public CalendarPrimaryBatchReq build() { + return new CalendarPrimaryBatchReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/CalendarUnderstandExtra.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/CalendarUnderstandExtra.java new file mode 100644 index 000000000..fe33d360c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/CalendarUnderstandExtra.java @@ -0,0 +1,148 @@ +// Code generated by lark suite 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 com.lark.oapi.service.calendar.v4.model; + +import com.google.gson.annotations.SerializedName; + +public class CalendarUnderstandExtra { + /** + * ai任务唯一标识 + *

示例值:none + */ + @SerializedName("ai_task_id") + private String aiTaskId; + /** + * 日程uid + *

示例值:b60bbd53-a52c-45a5-940a-1987de6a000f + */ + @SerializedName("event_uid") + private String eventUid; + /** + * 日程origin_time + *

示例值:1695355200 + */ + @SerializedName("origin_time") + private String originTime; + + // builder 开始 + public CalendarUnderstandExtra() { + } + + public CalendarUnderstandExtra(Builder builder) { + /** + * ai任务唯一标识 + *

示例值:none + */ + this.aiTaskId = builder.aiTaskId; + /** + * 日程uid + *

示例值:b60bbd53-a52c-45a5-940a-1987de6a000f + */ + this.eventUid = builder.eventUid; + /** + * 日程origin_time + *

示例值:1695355200 + */ + this.originTime = builder.originTime; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getAiTaskId() { + return this.aiTaskId; + } + + public void setAiTaskId(String aiTaskId) { + this.aiTaskId = aiTaskId; + } + + public String getEventUid() { + return this.eventUid; + } + + public void setEventUid(String eventUid) { + this.eventUid = eventUid; + } + + public String getOriginTime() { + return this.originTime; + } + + public void setOriginTime(String originTime) { + this.originTime = originTime; + } + + public static class Builder { + /** + * ai任务唯一标识 + *

示例值:none + */ + private String aiTaskId; + /** + * 日程uid + *

示例值:b60bbd53-a52c-45a5-940a-1987de6a000f + */ + private String eventUid; + /** + * 日程origin_time + *

示例值:1695355200 + */ + private String originTime; + + /** + * ai任务唯一标识 + *

示例值:none + * + * @param aiTaskId + * @return + */ + public Builder aiTaskId(String aiTaskId) { + this.aiTaskId = aiTaskId; + return this; + } + + + /** + * 日程uid + *

示例值:b60bbd53-a52c-45a5-940a-1987de6a000f + * + * @param eventUid + * @return + */ + public Builder eventUid(String eventUid) { + this.eventUid = eventUid; + return this; + } + + + /** + * 日程origin_time + *

示例值:1695355200 + * + * @param originTime + * @return + */ + public Builder originTime(String originTime) { + this.originTime = originTime; + return this; + } + + + public CalendarUnderstandExtra build() { + return new CalendarUnderstandExtra(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/CalendarUnderstandScenarioContext.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/CalendarUnderstandScenarioContext.java new file mode 100644 index 000000000..1b0b15351 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/CalendarUnderstandScenarioContext.java @@ -0,0 +1,148 @@ +// Code generated by lark suite 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 com.lark.oapi.service.calendar.v4.model; + +import com.google.gson.annotations.SerializedName; + +public class CalendarUnderstandScenarioContext { + /** + * 会话所处的业务场景 + *

示例值:IM + */ + @SerializedName("scenario") + private String scenario; + /** + * 会话所处的业务模式 + *

示例值:1 + */ + @SerializedName("work_mode") + private Integer workMode; + /** + * 透传数据 + *

示例值: + */ + @SerializedName("extra") + private CalendarUnderstandExtra extra; + + // builder 开始 + public CalendarUnderstandScenarioContext() { + } + + public CalendarUnderstandScenarioContext(Builder builder) { + /** + * 会话所处的业务场景 + *

示例值:IM + */ + this.scenario = builder.scenario; + /** + * 会话所处的业务模式 + *

示例值:1 + */ + this.workMode = builder.workMode; + /** + * 透传数据 + *

示例值: + */ + this.extra = builder.extra; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getScenario() { + return this.scenario; + } + + public void setScenario(String scenario) { + this.scenario = scenario; + } + + public Integer getWorkMode() { + return this.workMode; + } + + public void setWorkMode(Integer workMode) { + this.workMode = workMode; + } + + public CalendarUnderstandExtra getExtra() { + return this.extra; + } + + public void setExtra(CalendarUnderstandExtra extra) { + this.extra = extra; + } + + public static class Builder { + /** + * 会话所处的业务场景 + *

示例值:IM + */ + private String scenario; + /** + * 会话所处的业务模式 + *

示例值:1 + */ + private Integer workMode; + /** + * 透传数据 + *

示例值: + */ + private CalendarUnderstandExtra extra; + + /** + * 会话所处的业务场景 + *

示例值:IM + * + * @param scenario + * @return + */ + public Builder scenario(String scenario) { + this.scenario = scenario; + return this; + } + + + /** + * 会话所处的业务模式 + *

示例值:1 + * + * @param workMode + * @return + */ + public Builder workMode(Integer workMode) { + this.workMode = workMode; + return this; + } + + + /** + * 透传数据 + *

示例值: + * + * @param extra + * @return + */ + public Builder extra(CalendarUnderstandExtra extra) { + this.extra = extra; + return this; + } + + + public CalendarUnderstandScenarioContext build() { + return new CalendarUnderstandScenarioContext(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/CreateCalendarEventAttendeeReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/CreateCalendarEventAttendeeReq.java index 588d112a0..dd7d91249 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/CreateCalendarEventAttendeeReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/CreateCalendarEventAttendeeReq.java @@ -42,6 +42,7 @@ public class CreateCalendarEventAttendeeReq { private String eventId; @Body private CreateCalendarEventAttendeeReqBody body; + // builder 开始 public CreateCalendarEventAttendeeReq() { } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/DeleteCalendarEventMeetingChatReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/DeleteCalendarEventMeetingChatReq.java index 73f489528..98cb7f6a0 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/DeleteCalendarEventMeetingChatReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/DeleteCalendarEventMeetingChatReq.java @@ -43,6 +43,7 @@ public class DeleteCalendarEventMeetingChatReq { // builder 开始 public DeleteCalendarEventMeetingChatReq() { } + public DeleteCalendarEventMeetingChatReq(Builder builder) { /** * 会议群ID diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/DeleteCalendarEventReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/DeleteCalendarEventReq.java index 41e88bd97..a2f6bfb05 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/DeleteCalendarEventReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/DeleteCalendarEventReq.java @@ -43,6 +43,7 @@ public class DeleteCalendarEventReq { // builder 开始 public DeleteCalendarEventReq() { } + public DeleteCalendarEventReq(Builder builder) { /** * 删除日程是否给日程参与人发送bot通知,默认为true diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/EventCard.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/EventCard.java index 62f8320af..6b4602874 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/EventCard.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/EventCard.java @@ -64,6 +64,24 @@ public class EventCard { */ @SerializedName("duration") private String duration; + /** + * 是否需要生成会议纪要 + *

示例值:true + */ + @SerializedName("need_meeting_notes") + private String needMeetingNotes; + /** + * 上下文信息 schema 版本 + *

示例值:v1 + */ + @SerializedName("scenario_context_schema_version") + private String scenarioContextSchemaVersion; + /** + * 上下文信息 + *

示例值: + */ + @SerializedName("scenario_context") + private CalendarUnderstandScenarioContext scenarioContext; // builder 开始 public EventCard() { @@ -110,6 +128,21 @@ public EventCard(Builder builder) { *

示例值:1小时30分钟 */ this.duration = builder.duration; + /** + * 是否需要生成会议纪要 + *

示例值:true + */ + this.needMeetingNotes = builder.needMeetingNotes; + /** + * 上下文信息 schema 版本 + *

示例值:v1 + */ + this.scenarioContextSchemaVersion = builder.scenarioContextSchemaVersion; + /** + * 上下文信息 + *

示例值: + */ + this.scenarioContext = builder.scenarioContext; } public static Builder newBuilder() { @@ -180,6 +213,30 @@ public void setDuration(String duration) { this.duration = duration; } + public String getNeedMeetingNotes() { + return this.needMeetingNotes; + } + + public void setNeedMeetingNotes(String needMeetingNotes) { + this.needMeetingNotes = needMeetingNotes; + } + + public String getScenarioContextSchemaVersion() { + return this.scenarioContextSchemaVersion; + } + + public void setScenarioContextSchemaVersion(String scenarioContextSchemaVersion) { + this.scenarioContextSchemaVersion = scenarioContextSchemaVersion; + } + + public CalendarUnderstandScenarioContext getScenarioContext() { + return this.scenarioContext; + } + + public void setScenarioContext(CalendarUnderstandScenarioContext scenarioContext) { + this.scenarioContext = scenarioContext; + } + public static class Builder { /** * 日程主题 @@ -221,6 +278,21 @@ public static class Builder { *

示例值:1小时30分钟 */ private String duration; + /** + * 是否需要生成会议纪要 + *

示例值:true + */ + private String needMeetingNotes; + /** + * 上下文信息 schema 版本 + *

示例值:v1 + */ + private String scenarioContextSchemaVersion; + /** + * 上下文信息 + *

示例值: + */ + private CalendarUnderstandScenarioContext scenarioContext; /** * 日程主题 @@ -326,6 +398,45 @@ public Builder duration(String duration) { } + /** + * 是否需要生成会议纪要 + *

示例值:true + * + * @param needMeetingNotes + * @return + */ + public Builder needMeetingNotes(String needMeetingNotes) { + this.needMeetingNotes = needMeetingNotes; + return this; + } + + + /** + * 上下文信息 schema 版本 + *

示例值:v1 + * + * @param scenarioContextSchemaVersion + * @return + */ + public Builder scenarioContextSchemaVersion(String scenarioContextSchemaVersion) { + this.scenarioContextSchemaVersion = scenarioContextSchemaVersion; + return this; + } + + + /** + * 上下文信息 + *

示例值: + * + * @param scenarioContext + * @return + */ + public Builder scenarioContext(CalendarUnderstandScenarioContext scenarioContext) { + this.scenarioContext = scenarioContext; + return this; + } + + public EventCard build() { return new EventCard(this); } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/EventOrganizer.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/EventOrganizer.java new file mode 100644 index 000000000..d9590895a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/EventOrganizer.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.calendar.v4.model; + +import com.google.gson.annotations.SerializedName; + +public class EventOrganizer { + /** + * 日程组织者user ID + *

示例值:ou_xxxxxx + */ + @SerializedName("user_id") + private String userId; + /** + * 日程组织者姓名 + *

示例值:孙二二 + */ + @SerializedName("display_name") + private String displayName; + + // builder 开始 + public EventOrganizer() { + } + + public EventOrganizer(Builder builder) { + /** + * 日程组织者user ID + *

示例值:ou_xxxxxx + */ + this.userId = builder.userId; + /** + * 日程组织者姓名 + *

示例值:孙二二 + */ + this.displayName = builder.displayName; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserId() { + return this.userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getDisplayName() { + return this.displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public static class Builder { + /** + * 日程组织者user ID + *

示例值:ou_xxxxxx + */ + private String userId; + /** + * 日程组织者姓名 + *

示例值:孙二二 + */ + private String displayName; + + /** + * 日程组织者user ID + *

示例值:ou_xxxxxx + * + * @param userId + * @return + */ + public Builder userId(String userId) { + this.userId = userId; + return this; + } + + + /** + * 日程组织者姓名 + *

示例值:孙二二 + * + * @param displayName + * @return + */ + public Builder displayName(String displayName) { + this.displayName = displayName; + return this; + } + + + public EventOrganizer build() { + return new EventOrganizer(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/FreeTimeAi.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/FreeTimeAi.java new file mode 100644 index 000000000..d02166177 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/FreeTimeAi.java @@ -0,0 +1,74 @@ +// Code generated by lark suite 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 com.lark.oapi.service.calendar.v4.model; + +import com.google.gson.annotations.SerializedName; + +public class FreeTimeAi { + /** + * 空闲时间列表 + *

示例值:2023-12-05T15:00:00--2023-12-05T15:30:00;2023-12-05T15:30:00--2023-12-05T16:00:00; + */ + @SerializedName("free_time_list") + private String freeTimeList; + + // builder 开始 + public FreeTimeAi() { + } + + public FreeTimeAi(Builder builder) { + /** + * 空闲时间列表 + *

示例值:2023-12-05T15:00:00--2023-12-05T15:30:00;2023-12-05T15:30:00--2023-12-05T16:00:00; + */ + this.freeTimeList = builder.freeTimeList; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getFreeTimeList() { + return this.freeTimeList; + } + + public void setFreeTimeList(String freeTimeList) { + this.freeTimeList = freeTimeList; + } + + public static class Builder { + /** + * 空闲时间列表 + *

示例值:2023-12-05T15:00:00--2023-12-05T15:30:00;2023-12-05T15:30:00--2023-12-05T16:00:00; + */ + private String freeTimeList; + + /** + * 空闲时间列表 + *

示例值:2023-12-05T15:00:00--2023-12-05T15:30:00;2023-12-05T15:30:00--2023-12-05T16:00:00; + * + * @param freeTimeList + * @return + */ + public Builder freeTimeList(String freeTimeList) { + this.freeTimeList = freeTimeList; + return this; + } + + + public FreeTimeAi build() { + return new FreeTimeAi(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/FreeTimeSlot.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/FreeTimeSlot.java new file mode 100644 index 000000000..fbd2a9366 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/FreeTimeSlot.java @@ -0,0 +1,148 @@ +// Code generated by lark suite 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 com.lark.oapi.service.calendar.v4.model; + +import com.google.gson.annotations.SerializedName; + +public class FreeTimeSlot { + /** + * 空闲时间段的开始时间 + *

示例值:2023-09-01 15:00:00 + */ + @SerializedName("start_time") + private String startTime; + /** + * 空闲时间段的结束时间 + *

示例值:2023-09-01 16:00:00 + */ + @SerializedName("end_time") + private String endTime; + /** + * 空闲时间段长度,单位 s + *

示例值:3600 + */ + @SerializedName("length") + private Integer length; + + // builder 开始 + public FreeTimeSlot() { + } + + public FreeTimeSlot(Builder builder) { + /** + * 空闲时间段的开始时间 + *

示例值:2023-09-01 15:00:00 + */ + this.startTime = builder.startTime; + /** + * 空闲时间段的结束时间 + *

示例值:2023-09-01 16:00:00 + */ + this.endTime = builder.endTime; + /** + * 空闲时间段长度,单位 s + *

示例值:3600 + */ + this.length = builder.length; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getStartTime() { + return this.startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return this.endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public Integer getLength() { + return this.length; + } + + public void setLength(Integer length) { + this.length = length; + } + + public static class Builder { + /** + * 空闲时间段的开始时间 + *

示例值:2023-09-01 15:00:00 + */ + private String startTime; + /** + * 空闲时间段的结束时间 + *

示例值:2023-09-01 16:00:00 + */ + private String endTime; + /** + * 空闲时间段长度,单位 s + *

示例值:3600 + */ + private Integer length; + + /** + * 空闲时间段的开始时间 + *

示例值:2023-09-01 15:00:00 + * + * @param startTime + * @return + */ + public Builder startTime(String startTime) { + this.startTime = startTime; + return this; + } + + + /** + * 空闲时间段的结束时间 + *

示例值:2023-09-01 16:00:00 + * + * @param endTime + * @return + */ + public Builder endTime(String endTime) { + this.endTime = endTime; + return this; + } + + + /** + * 空闲时间段长度,单位 s + *

示例值:3600 + * + * @param length + * @return + */ + public Builder length(Integer length) { + this.length = length; + return this; + } + + + public FreeTimeSlot build() { + return new FreeTimeSlot(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/Instance.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/Instance.java new file mode 100644 index 000000000..2725f3146 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/Instance.java @@ -0,0 +1,345 @@ +// Code generated by lark suite 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 com.lark.oapi.service.calendar.v4.model; + +import com.google.gson.annotations.SerializedName; + +public class Instance { + /** + * 日程实例ID + *

示例值:75d28f9b-e35c-4230-8a83-4a661497db54_0 + */ + @SerializedName("event_id") + private String eventId; + /** + * 日程主题 + *

示例值:日程主题 + */ + @SerializedName("summary") + private String summary; + /** + * 日程描述 + *

示例值:desc + */ + @SerializedName("description") + private String description; + /** + * 开始时间 + *

示例值: + */ + @SerializedName("start_time") + private TimeInfo startTime; + /** + * 结束时间 + *

示例值: + */ + @SerializedName("end_time") + private TimeInfo endTime; + /** + * 日程状态 + *

示例值: + */ + @SerializedName("status") + private String status; + /** + * 是否是例外日程实例 + *

示例值:false + */ + @SerializedName("is_exception") + private Boolean isException; + /** + * 日程的app_link,跳转到具体的某个日程 + *

示例值:https://applink.larkoffice.com/client/calendar/event/detail?calendarId=7039673579105026066&key=aeac9c56-aeb1-4179-a21b-02f278f59048&originalTime=0&startTime=1700496000 + */ + @SerializedName("app_link") + private String appLink; + + // builder 开始 + public Instance() { + } + + public Instance(Builder builder) { + /** + * 日程实例ID + *

示例值:75d28f9b-e35c-4230-8a83-4a661497db54_0 + */ + this.eventId = builder.eventId; + /** + * 日程主题 + *

示例值:日程主题 + */ + this.summary = builder.summary; + /** + * 日程描述 + *

示例值:desc + */ + this.description = builder.description; + /** + * 开始时间 + *

示例值: + */ + this.startTime = builder.startTime; + /** + * 结束时间 + *

示例值: + */ + this.endTime = builder.endTime; + /** + * 日程状态 + *

示例值: + */ + this.status = builder.status; + /** + * 是否是例外日程实例 + *

示例值:false + */ + this.isException = builder.isException; + /** + * 日程的app_link,跳转到具体的某个日程 + *

示例值:https://applink.larkoffice.com/client/calendar/event/detail?calendarId=7039673579105026066&key=aeac9c56-aeb1-4179-a21b-02f278f59048&originalTime=0&startTime=1700496000 + */ + this.appLink = builder.appLink; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getEventId() { + return this.eventId; + } + + public void setEventId(String eventId) { + this.eventId = eventId; + } + + public String getSummary() { + return this.summary; + } + + public void setSummary(String summary) { + this.summary = summary; + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public TimeInfo getStartTime() { + return this.startTime; + } + + public void setStartTime(TimeInfo startTime) { + this.startTime = startTime; + } + + public TimeInfo getEndTime() { + return this.endTime; + } + + public void setEndTime(TimeInfo endTime) { + this.endTime = endTime; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Boolean getIsException() { + return this.isException; + } + + public void setIsException(Boolean isException) { + this.isException = isException; + } + + public String getAppLink() { + return this.appLink; + } + + public void setAppLink(String appLink) { + this.appLink = appLink; + } + + public static class Builder { + /** + * 日程实例ID + *

示例值:75d28f9b-e35c-4230-8a83-4a661497db54_0 + */ + private String eventId; + /** + * 日程主题 + *

示例值:日程主题 + */ + private String summary; + /** + * 日程描述 + *

示例值:desc + */ + private String description; + /** + * 开始时间 + *

示例值: + */ + private TimeInfo startTime; + /** + * 结束时间 + *

示例值: + */ + private TimeInfo endTime; + /** + * 日程状态 + *

示例值: + */ + private String status; + /** + * 是否是例外日程实例 + *

示例值:false + */ + private Boolean isException; + /** + * 日程的app_link,跳转到具体的某个日程 + *

示例值:https://applink.larkoffice.com/client/calendar/event/detail?calendarId=7039673579105026066&key=aeac9c56-aeb1-4179-a21b-02f278f59048&originalTime=0&startTime=1700496000 + */ + private String appLink; + + /** + * 日程实例ID + *

示例值:75d28f9b-e35c-4230-8a83-4a661497db54_0 + * + * @param eventId + * @return + */ + public Builder eventId(String eventId) { + this.eventId = eventId; + return this; + } + + + /** + * 日程主题 + *

示例值:日程主题 + * + * @param summary + * @return + */ + public Builder summary(String summary) { + this.summary = summary; + return this; + } + + + /** + * 日程描述 + *

示例值:desc + * + * @param description + * @return + */ + public Builder description(String description) { + this.description = description; + return this; + } + + + /** + * 开始时间 + *

示例值: + * + * @param startTime + * @return + */ + public Builder startTime(TimeInfo startTime) { + this.startTime = startTime; + return this; + } + + + /** + * 结束时间 + *

示例值: + * + * @param endTime + * @return + */ + public Builder endTime(TimeInfo endTime) { + this.endTime = endTime; + return this; + } + + + /** + * 日程状态 + *

示例值: + * + * @param status + * @return + */ + public Builder status(String status) { + this.status = status; + return this; + } + + /** + * 日程状态 + *

示例值: + * + * @param status {@link com.lark.oapi.service.calendar.v4.enums.InstanceEventStatusEnum} + * @return + */ + public Builder status(com.lark.oapi.service.calendar.v4.enums.InstanceEventStatusEnum status) { + this.status = status.getValue(); + return this; + } + + + /** + * 是否是例外日程实例 + *

示例值:false + * + * @param isException + * @return + */ + public Builder isException(Boolean isException) { + this.isException = isException; + return this; + } + + + /** + * 日程的app_link,跳转到具体的某个日程 + *

示例值:https://applink.larkoffice.com/client/calendar/event/detail?calendarId=7039673579105026066&key=aeac9c56-aeb1-4179-a21b-02f278f59048&originalTime=0&startTime=1700496000 + * + * @param appLink + * @return + */ + public Builder appLink(String appLink) { + this.appLink = appLink; + return this; + } + + + public Instance build() { + return new Instance(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/ListCalendarEventReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/ListCalendarEventReq.java index f77c35d46..8129fe182 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/ListCalendarEventReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/ListCalendarEventReq.java @@ -60,6 +60,13 @@ public class ListCalendarEventReq { @Query @SerializedName("end_time") private String endTime; + /** + * 此次调用中使用的用户ID的类型 + *

示例值: + */ + @Query + @SerializedName("user_id_type") + private String userIdType; /** * 日历ID。参见[日历ID说明](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/introduction) *

示例值:feishu.cn_xxxxxxxxxx@group.calendar.feishu.cn @@ -103,6 +110,11 @@ public ListCalendarEventReq(Builder builder) { *

示例值:1631777271 */ this.endTime = builder.endTime; + /** + * 此次调用中使用的用户ID的类型 + *

示例值: + */ + this.userIdType = builder.userIdType; /** * 日历ID。参见[日历ID说明](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/introduction) *

示例值:feishu.cn_xxxxxxxxxx@group.calendar.feishu.cn @@ -162,6 +174,14 @@ public void setEndTime(String endTime) { this.endTime = endTime; } + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + public String getCalendarId() { return this.calendarId; } @@ -177,6 +197,7 @@ public static class Builder { private String syncToken; // 上次请求Response返回的增量同步标记,分页请求未结束时为空 private String startTime; // 日程开始Unix时间戳,单位为秒 private String endTime; // 日程结束Unix时间戳,单位为秒 + private String userIdType; // 此次调用中使用的用户ID的类型 private String calendarId; // 日历ID。参见[日历ID说明](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/introduction) /** @@ -251,6 +272,30 @@ public Builder endTime(String endTime) { return this; } + /** + * 此次调用中使用的用户ID的类型 + *

示例值: + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 此次调用中使用的用户ID的类型 + *

示例值: + * + * @param userIdType {@link com.lark.oapi.service.calendar.v4.enums.ListCalendarEventUserIdTypeEnum} + * @return + */ + public Builder userIdType(com.lark.oapi.service.calendar.v4.enums.ListCalendarEventUserIdTypeEnum userIdType) { + this.userIdType = userIdType.getValue(); + return this; + } + /** * 日历ID。参见[日历ID说明](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/introduction) *

示例值:feishu.cn_xxxxxxxxxx@group.calendar.feishu.cn diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/ListFreebusyReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/ListFreebusyReqBody.java index 936da55d2..26e9c13de 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/ListFreebusyReqBody.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/ListFreebusyReqBody.java @@ -40,6 +40,18 @@ public class ListFreebusyReqBody { */ @SerializedName("room_id") private String roomId; + /** + * 是否包含绑定的三方日历中的日程,不传默认为true,即包含。 + *

示例值:true + */ + @SerializedName("include_external_calendar") + private Boolean includeExternalCalendar; + /** + * 是否包含标记为空闲的日程,不传默认为true,即包含。 + *

示例值:true + */ + @SerializedName("only_busy") + private Boolean onlyBusy; // builder 开始 public ListFreebusyReqBody() { @@ -66,6 +78,16 @@ public ListFreebusyReqBody(Builder builder) { *

示例值:omm_xxxxxxxxxx */ this.roomId = builder.roomId; + /** + * 是否包含绑定的三方日历中的日程,不传默认为true,即包含。 + *

示例值:true + */ + this.includeExternalCalendar = builder.includeExternalCalendar; + /** + * 是否包含标记为空闲的日程,不传默认为true,即包含。 + *

示例值:true + */ + this.onlyBusy = builder.onlyBusy; } public static Builder newBuilder() { @@ -104,6 +126,22 @@ public void setRoomId(String roomId) { this.roomId = roomId; } + public Boolean getIncludeExternalCalendar() { + return this.includeExternalCalendar; + } + + public void setIncludeExternalCalendar(Boolean includeExternalCalendar) { + this.includeExternalCalendar = includeExternalCalendar; + } + + public Boolean getOnlyBusy() { + return this.onlyBusy; + } + + public void setOnlyBusy(Boolean onlyBusy) { + this.onlyBusy = onlyBusy; + } + public static class Builder { /** * 查询时段开始时间,需要url编码 @@ -125,6 +163,16 @@ public static class Builder { *

示例值:omm_xxxxxxxxxx */ private String roomId; + /** + * 是否包含绑定的三方日历中的日程,不传默认为true,即包含。 + *

示例值:true + */ + private Boolean includeExternalCalendar; + /** + * 是否包含标记为空闲的日程,不传默认为true,即包含。 + *

示例值:true + */ + private Boolean onlyBusy; /** * 查询时段开始时间,需要url编码 @@ -178,6 +226,32 @@ public Builder roomId(String roomId) { } + /** + * 是否包含绑定的三方日历中的日程,不传默认为true,即包含。 + *

示例值:true + * + * @param includeExternalCalendar + * @return + */ + public Builder includeExternalCalendar(Boolean includeExternalCalendar) { + this.includeExternalCalendar = includeExternalCalendar; + return this; + } + + + /** + * 是否包含标记为空闲的日程,不传默认为true,即包含。 + *

示例值:true + * + * @param onlyBusy + * @return + */ + public Builder onlyBusy(Boolean onlyBusy) { + this.onlyBusy = onlyBusy; + return this; + } + + public ListFreebusyReqBody build() { return new ListFreebusyReqBody(this); } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/MyaiReply.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/MyaiReply.java index 646dc2d05..23d808a38 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/MyaiReply.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/MyaiReply.java @@ -46,6 +46,12 @@ public class MyaiReply { */ @SerializedName("summary") private String summary; + /** + * 参与人实体列表 + *

示例值: + */ + @SerializedName("participants") + private UserMeta[] participants; // builder 开始 public MyaiReply() { @@ -77,6 +83,11 @@ public MyaiReply(Builder builder) { *

示例值:none */ this.summary = builder.summary; + /** + * 参与人实体列表 + *

示例值: + */ + this.participants = builder.participants; } public static Builder newBuilder() { @@ -123,6 +134,14 @@ public void setSummary(String summary) { this.summary = summary; } + public UserMeta[] getParticipants() { + return this.participants; + } + + public void setParticipants(UserMeta[] participants) { + this.participants = participants; + } + public static class Builder { /** * 返回给myai的自然语言描述 @@ -149,6 +168,11 @@ public static class Builder { *

示例值:none */ private String summary; + /** + * 参与人实体列表 + *

示例值: + */ + private UserMeta[] participants; /** * 返回给myai的自然语言描述 @@ -215,6 +239,19 @@ public Builder summary(String summary) { } + /** + * 参与人实体列表 + *

示例值: + * + * @param participants + * @return + */ + public Builder participants(UserMeta[] participants) { + this.participants = participants; + return this; + } + + public MyaiReply build() { return new MyaiReply(this); } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/PatchCalendarEventReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/PatchCalendarEventReq.java index 7502a34b5..07dded5f3 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/PatchCalendarEventReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/PatchCalendarEventReq.java @@ -42,6 +42,7 @@ public class PatchCalendarEventReq { private String eventId; @Body private CalendarEvent body; + // builder 开始 public PatchCalendarEventReq() { } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/UserFreebusy.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/UserFreebusy.java new file mode 100644 index 000000000..624e84787 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/UserFreebusy.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.calendar.v4.model; + +import com.google.gson.annotations.SerializedName; + +public class UserFreebusy { + /** + * 日历上请求时间区间内的忙闲信息 + *

示例值: + */ + @SerializedName("freebusy_items") + private Freebusy[] freebusyItems; + /** + * 日历的创建者userID + *

示例值: + */ + @SerializedName("user_id") + private String userId; + + // builder 开始 + public UserFreebusy() { + } + + public UserFreebusy(Builder builder) { + /** + * 日历上请求时间区间内的忙闲信息 + *

示例值: + */ + this.freebusyItems = builder.freebusyItems; + /** + * 日历的创建者userID + *

示例值: + */ + this.userId = builder.userId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Freebusy[] getFreebusyItems() { + return this.freebusyItems; + } + + public void setFreebusyItems(Freebusy[] freebusyItems) { + this.freebusyItems = freebusyItems; + } + + public String getUserId() { + return this.userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public static class Builder { + /** + * 日历上请求时间区间内的忙闲信息 + *

示例值: + */ + private Freebusy[] freebusyItems; + /** + * 日历的创建者userID + *

示例值: + */ + private String userId; + + /** + * 日历上请求时间区间内的忙闲信息 + *

示例值: + * + * @param freebusyItems + * @return + */ + public Builder freebusyItems(Freebusy[] freebusyItems) { + this.freebusyItems = freebusyItems; + return this; + } + + + /** + * 日历的创建者userID + *

示例值: + * + * @param userId + * @return + */ + public Builder userId(String userId) { + this.userId = userId; + return this; + } + + + public UserFreebusy build() { + return new UserFreebusy(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/UserMeta.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/UserMeta.java new file mode 100644 index 000000000..bf14128b6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/UserMeta.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.calendar.v4.model; + +import com.google.gson.annotations.SerializedName; + +public class UserMeta { + /** + * 用户名称 + *

示例值:none + */ + @SerializedName("name") + private String name; + /** + * 用户ID + *

示例值:none + */ + @SerializedName("user_id") + private String userId; + + // builder 开始 + public UserMeta() { + } + + public UserMeta(Builder builder) { + /** + * 用户名称 + *

示例值:none + */ + this.name = builder.name; + /** + * 用户ID + *

示例值:none + */ + this.userId = builder.userId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUserId() { + return this.userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public static class Builder { + /** + * 用户名称 + *

示例值:none + */ + private String name; + /** + * 用户ID + *

示例值:none + */ + private String userId; + + /** + * 用户名称 + *

示例值:none + * + * @param name + * @return + */ + public Builder name(String name) { + this.name = name; + return this; + } + + + /** + * 用户ID + *

示例值:none + * + * @param userId + * @return + */ + public Builder userId(String userId) { + this.userId = userId; + return this; + } + + + public UserMeta build() { + return new UserMeta(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/Workhour.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/Workhour.java new file mode 100644 index 000000000..5f94cf523 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/Workhour.java @@ -0,0 +1,148 @@ +// Code generated by lark suite 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 com.lark.oapi.service.calendar.v4.model; + +import com.google.gson.annotations.SerializedName; + +public class Workhour { + /** + * 工作日,定义每周的星期几为工作日.枚举值 0-6 代表 周日-周六 + *

示例值:1 + */ + @SerializedName("day_of_week") + private Integer dayOfWeek; + /** + * 工作时间的开始时间,单位为分钟,取值 0 - 1440 + *

示例值:480 + */ + @SerializedName("start_time") + private Integer startTime; + /** + * 工作时间的结束时间,单位为分钟,取值 start_time - 1440 + *

示例值:1020 + */ + @SerializedName("end_time") + private Integer endTime; + + // builder 开始 + public Workhour() { + } + + public Workhour(Builder builder) { + /** + * 工作日,定义每周的星期几为工作日.枚举值 0-6 代表 周日-周六 + *

示例值:1 + */ + this.dayOfWeek = builder.dayOfWeek; + /** + * 工作时间的开始时间,单位为分钟,取值 0 - 1440 + *

示例值:480 + */ + this.startTime = builder.startTime; + /** + * 工作时间的结束时间,单位为分钟,取值 start_time - 1440 + *

示例值:1020 + */ + this.endTime = builder.endTime; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Integer getDayOfWeek() { + return this.dayOfWeek; + } + + public void setDayOfWeek(Integer dayOfWeek) { + this.dayOfWeek = dayOfWeek; + } + + public Integer getStartTime() { + return this.startTime; + } + + public void setStartTime(Integer startTime) { + this.startTime = startTime; + } + + public Integer getEndTime() { + return this.endTime; + } + + public void setEndTime(Integer endTime) { + this.endTime = endTime; + } + + public static class Builder { + /** + * 工作日,定义每周的星期几为工作日.枚举值 0-6 代表 周日-周六 + *

示例值:1 + */ + private Integer dayOfWeek; + /** + * 工作时间的开始时间,单位为分钟,取值 0 - 1440 + *

示例值:480 + */ + private Integer startTime; + /** + * 工作时间的结束时间,单位为分钟,取值 start_time - 1440 + *

示例值:1020 + */ + private Integer endTime; + + /** + * 工作日,定义每周的星期几为工作日.枚举值 0-6 代表 周日-周六 + *

示例值:1 + * + * @param dayOfWeek + * @return + */ + public Builder dayOfWeek(Integer dayOfWeek) { + this.dayOfWeek = dayOfWeek; + return this; + } + + + /** + * 工作时间的开始时间,单位为分钟,取值 0 - 1440 + *

示例值:480 + * + * @param startTime + * @return + */ + public Builder startTime(Integer startTime) { + this.startTime = startTime; + return this; + } + + + /** + * 工作时间的结束时间,单位为分钟,取值 start_time - 1440 + *

示例值:1020 + * + * @param endTime + * @return + */ + public Builder endTime(Integer endTime) { + this.endTime = endTime; + return this; + } + + + public Workhour build() { + return new Workhour(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/WorkhourSetting.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/WorkhourSetting.java new file mode 100644 index 000000000..e4f44baf2 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/model/WorkhourSetting.java @@ -0,0 +1,185 @@ +// Code generated by lark suite 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 com.lark.oapi.service.calendar.v4.model; + +import com.google.gson.annotations.SerializedName; + +public class WorkhourSetting { + /** + * 用户设置的对外展示时区 + *

示例值:Asia/Shanghai + */ + @SerializedName("timezone") + private String timezone; + /** + * 工作时间设置 + *

示例值: + */ + @SerializedName("workhours") + private Workhour[] workhours; + /** + * 用户是否启用工作时间设置 + *

示例值:false + */ + @SerializedName("enable_work_hour") + private Boolean enableWorkHour; + /** + * 用户user id + *

示例值:ou_xxxxxx + */ + @SerializedName("user_id") + private String userId; + + // builder 开始 + public WorkhourSetting() { + } + + public WorkhourSetting(Builder builder) { + /** + * 用户设置的对外展示时区 + *

示例值:Asia/Shanghai + */ + this.timezone = builder.timezone; + /** + * 工作时间设置 + *

示例值: + */ + this.workhours = builder.workhours; + /** + * 用户是否启用工作时间设置 + *

示例值:false + */ + this.enableWorkHour = builder.enableWorkHour; + /** + * 用户user id + *

示例值:ou_xxxxxx + */ + this.userId = builder.userId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getTimezone() { + return this.timezone; + } + + public void setTimezone(String timezone) { + this.timezone = timezone; + } + + public Workhour[] getWorkhours() { + return this.workhours; + } + + public void setWorkhours(Workhour[] workhours) { + this.workhours = workhours; + } + + public Boolean getEnableWorkHour() { + return this.enableWorkHour; + } + + public void setEnableWorkHour(Boolean enableWorkHour) { + this.enableWorkHour = enableWorkHour; + } + + public String getUserId() { + return this.userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public static class Builder { + /** + * 用户设置的对外展示时区 + *

示例值:Asia/Shanghai + */ + private String timezone; + /** + * 工作时间设置 + *

示例值: + */ + private Workhour[] workhours; + /** + * 用户是否启用工作时间设置 + *

示例值:false + */ + private Boolean enableWorkHour; + /** + * 用户user id + *

示例值:ou_xxxxxx + */ + private String userId; + + /** + * 用户设置的对外展示时区 + *

示例值:Asia/Shanghai + * + * @param timezone + * @return + */ + public Builder timezone(String timezone) { + this.timezone = timezone; + return this; + } + + + /** + * 工作时间设置 + *

示例值: + * + * @param workhours + * @return + */ + public Builder workhours(Workhour[] workhours) { + this.workhours = workhours; + return this; + } + + + /** + * 用户是否启用工作时间设置 + *

示例值:false + * + * @param enableWorkHour + * @return + */ + public Builder enableWorkHour(Boolean enableWorkHour) { + this.enableWorkHour = enableWorkHour; + return this; + } + + + /** + * 用户user id + *

示例值:ou_xxxxxx + * + * @param userId + * @return + */ + public Builder userId(String userId) { + this.userId = userId; + return this; + } + + + public WorkhourSetting build() { + return new WorkhourSetting(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/Calendar.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/Calendar.java new file mode 100644 index 000000000..359bde3c4 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/Calendar.java @@ -0,0 +1,772 @@ +// Code generated by lark suite 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 com.lark.oapi.service.calendar.v4.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.calendar.v4.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Calendar { + private static final Logger log = LoggerFactory.getLogger(Calendar.class); + private final Config config; + + public Calendar(Config config) { + this.config = config; + } + + + /** + * 创建共享日历,该接口用于为当前身份(应用 / 用户)创建一个共享日历。;;身份由 Header Authorization 的 Token 类型决定。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarSample.java ; + */ + public CreateCalendarResp create(CreateCalendarReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCalendarResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建共享日历,该接口用于为当前身份(应用 / 用户)创建一个共享日历。;;身份由 Header Authorization 的 Token 类型决定。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarSample.java ; + */ + public CreateCalendarResp create(CreateCalendarReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCalendarResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除共享日历,该接口用于以当前身份(应用 / 用户)删除一个共享日历。;;身份由 Header Authorization 的 Token 类型决定。 + *

当前身份必须对日历具有 owner 权限。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarSample.java ; + */ + public DeleteCalendarResp delete(DeleteCalendarReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/calendar/v4/calendars/:calendar_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteCalendarResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除共享日历,该接口用于以当前身份(应用 / 用户)删除一个共享日历。;;身份由 Header Authorization 的 Token 类型决定。 + *

当前身份必须对日历具有 owner 权限。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarSample.java ; + */ + public DeleteCalendarResp delete(DeleteCalendarReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/calendar/v4/calendars/:calendar_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteCalendarResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询日历信息,该接口用于以当前身份(应用 / 用户)根据日历 ID 获取日历信息。;;身份由 Header Authorization 的 Token 类型决定。 + *

当前身份必须对日历有访问权限。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GetCalendarSample.java ; + */ + public GetCalendarResp get(GetCalendarReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/calendar/v4/calendars/:calendar_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCalendarResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询日历信息,该接口用于以当前身份(应用 / 用户)根据日历 ID 获取日历信息。;;身份由 Header Authorization 的 Token 类型决定。 + *

当前身份必须对日历有访问权限。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GetCalendarSample.java ; + */ + public GetCalendarResp get(GetCalendarReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/calendar/v4/calendars/:calendar_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCalendarResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询日历列表,该接口用于分页获得当前身份(应用 / 用户)的日历列表。;;身份由 Header Authorization 的 Token 类型决定。 + *

调用时首先使用 page_token 分页拉取存量数据,之后使用 sync_token 增量同步变更数据。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarSample.java ; + */ + public ListCalendarResp list(ListCalendarReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/calendar/v4/calendars" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCalendarResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询日历列表,该接口用于分页获得当前身份(应用 / 用户)的日历列表。;;身份由 Header Authorization 的 Token 类型决定。 + *

调用时首先使用 page_token 分页拉取存量数据,之后使用 sync_token 增量同步变更数据。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarSample.java ; + */ + public ListCalendarResp list(ListCalendarReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/calendar/v4/calendars" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCalendarResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新日历信息,该接口用于以当前身份(应用 / 用户)修改日历信息。;;身份由 Header Authorization 的 Token 类型决定。 + *

当前身份对日历有 owner 权限时,可修改全局字段:summary, description, permission。;;当前身份对日历不具有 owner 权限时,仅可修改对自己生效的字段:color, summary_alias。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/PatchCalendarSample.java ; + */ + public PatchCalendarResp patch(PatchCalendarReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/calendar/v4/calendars/:calendar_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchCalendarResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新日历信息,该接口用于以当前身份(应用 / 用户)修改日历信息。;;身份由 Header Authorization 的 Token 类型决定。 + *

当前身份对日历有 owner 权限时,可修改全局字段:summary, description, permission。;;当前身份对日历不具有 owner 权限时,仅可修改对自己生效的字段:color, summary_alias。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/PatchCalendarSample.java ; + */ + public PatchCalendarResp patch(PatchCalendarReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/calendar/v4/calendars/:calendar_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchCalendarResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询主日历信息,获取当前身份的主日历信息。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/primary ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/PrimaryCalendarSample.java ; + */ + public PrimaryCalendarResp primary(PrimaryCalendarReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/primary" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PrimaryCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PrimaryCalendarResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/primary" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询主日历信息,获取当前身份的主日历信息。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/primary ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/PrimaryCalendarSample.java ; + */ + public PrimaryCalendarResp primary(PrimaryCalendarReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/primary" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PrimaryCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PrimaryCalendarResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/primary" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 搜索日历,该接口用于通过关键字查询公共日历或用户主日历。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/search ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SearchCalendarSample.java ; + */ + public SearchCalendarResp search(SearchCalendarReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/search" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + SearchCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchCalendarResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 搜索日历,该接口用于通过关键字查询公共日历或用户主日历。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/search ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SearchCalendarSample.java ; + */ + public SearchCalendarResp search(SearchCalendarReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/search" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + SearchCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchCalendarResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 订阅日历,该接口用于以当前身份(应用 / 用户)订阅某个日历。;;身份由 Header Authorization 的 Token 类型决定。 + *

- 仅可订阅类型为 primary 或 shared 的公开日历。;- 可订阅日历数量上限为1000。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/subscribe ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscribeCalendarSample.java ; + */ + public SubscribeCalendarResp subscribe(SubscribeCalendarReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/:calendar_id/subscribe" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + SubscribeCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscribeCalendarResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/subscribe" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 订阅日历,该接口用于以当前身份(应用 / 用户)订阅某个日历。;;身份由 Header Authorization 的 Token 类型决定。 + *

- 仅可订阅类型为 primary 或 shared 的公开日历。;- 可订阅日历数量上限为1000。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/subscribe ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscribeCalendarSample.java ; + */ + public SubscribeCalendarResp subscribe(SubscribeCalendarReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/:calendar_id/subscribe" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + SubscribeCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscribeCalendarResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/subscribe" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 订阅日历变更事件,该接口用于以用户身份订阅当前身份下日历列表中的所有日历变更。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/subscription ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscriptionCalendarSample.java ; + */ + public SubscriptionCalendarResp subscription(RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/subscription" + , Sets.newHashSet(AccessTokenType.User) + , null); + + // 反序列化 + SubscriptionCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscriptionCalendarResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/subscription" + , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + return resp; + } + + /** + * 订阅日历变更事件,该接口用于以用户身份订阅当前身份下日历列表中的所有日历变更。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/subscription ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscriptionCalendarSample.java ; + */ + public SubscriptionCalendarResp subscription() throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/subscription" + , Sets.newHashSet(AccessTokenType.User) + , null); + + // 反序列化 + SubscriptionCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscriptionCalendarResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/subscription" + , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + return resp; + } + + /** + * 取消订阅日历,该接口用于以当前身份(应用 / 用户)取消对某日历的订阅状态。;;身份由 Header Authorization 的 Token 类型决定。 + *

仅可操作已经被当前身份订阅的日历。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/unsubscribe ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscribeCalendarSample.java ; + */ + public UnsubscribeCalendarResp unsubscribe(UnsubscribeCalendarReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/:calendar_id/unsubscribe" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UnsubscribeCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnsubscribeCalendarResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/unsubscribe" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 取消订阅日历,该接口用于以当前身份(应用 / 用户)取消对某日历的订阅状态。;;身份由 Header Authorization 的 Token 类型决定。 + *

仅可操作已经被当前身份订阅的日历。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/unsubscribe ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscribeCalendarSample.java ; + */ + public UnsubscribeCalendarResp unsubscribe(UnsubscribeCalendarReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/:calendar_id/unsubscribe" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UnsubscribeCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnsubscribeCalendarResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/unsubscribe" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 取消订阅日历变更事件,该接口用于以用户身份取消订阅当前身份下日历列表中的日历变更事件。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/unsubscription ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscriptionCalendarSample.java ; + */ + public UnsubscriptionCalendarResp unsubscription(RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/unsubscription" + , Sets.newHashSet(AccessTokenType.User) + , null); + + // 反序列化 + UnsubscriptionCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnsubscriptionCalendarResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/unsubscription" + , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + return resp; + } + + /** + * 取消订阅日历变更事件,该接口用于以用户身份取消订阅当前身份下日历列表中的日历变更事件。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/unsubscription ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscriptionCalendarSample.java ; + */ + public UnsubscriptionCalendarResp unsubscription() throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/unsubscription" + , Sets.newHashSet(AccessTokenType.User) + , null); + + // 反序列化 + UnsubscriptionCalendarResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnsubscriptionCalendarResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/unsubscription" + , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/CalendarAcl.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/CalendarAcl.java new file mode 100644 index 000000000..23726501d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/CalendarAcl.java @@ -0,0 +1,378 @@ +// Code generated by lark suite 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 com.lark.oapi.service.calendar.v4.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.calendar.v4.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class CalendarAcl { + private static final Logger log = LoggerFactory.getLogger(CalendarAcl.class); + private final Config config; + + public CalendarAcl(Config config) { + this.config = config; + } + + + /** + * 创建访问控制,该接口用于以当前身份(应用 / 用户)给日历添加访问控制权限,即日历成员。;;身份由 Header Authorization 的 Token 类型决定。 + *

当前身份需要有日历的 owner 权限,并且日历的类型只能为 primary 或 shared。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarAclSample.java ; + */ + public CreateCalendarAclResp create(CreateCalendarAclReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/:calendar_id/acls" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateCalendarAclResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCalendarAclResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/acls" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建访问控制,该接口用于以当前身份(应用 / 用户)给日历添加访问控制权限,即日历成员。;;身份由 Header Authorization 的 Token 类型决定。 + *

当前身份需要有日历的 owner 权限,并且日历的类型只能为 primary 或 shared。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarAclSample.java ; + */ + public CreateCalendarAclResp create(CreateCalendarAclReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/:calendar_id/acls" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateCalendarAclResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCalendarAclResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/acls" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除访问控制,该接口用于以当前身份(应用 / 用户)删除日历的控制权限,即日历成员。;;身份由 Header Authorization 的 Token 类型决定。 + *

当前身份需要有日历的 owner 权限,并且日历的类型只能为 primary 或 shared。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarAclSample.java ; + */ + public DeleteCalendarAclResp delete(DeleteCalendarAclReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/calendar/v4/calendars/:calendar_id/acls/:acl_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteCalendarAclResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteCalendarAclResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/acls/:acl_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除访问控制,该接口用于以当前身份(应用 / 用户)删除日历的控制权限,即日历成员。;;身份由 Header Authorization 的 Token 类型决定。 + *

当前身份需要有日历的 owner 权限,并且日历的类型只能为 primary 或 shared。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarAclSample.java ; + */ + public DeleteCalendarAclResp delete(DeleteCalendarAclReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/calendar/v4/calendars/:calendar_id/acls/:acl_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteCalendarAclResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteCalendarAclResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/acls/:acl_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取访问控制列表,该接口用于以当前身份(应用 / 用户)获取日历的控制权限列表。;;身份由 Header Authorization 的 Token 类型决定。 + *

当前身份需要有日历的 owner 权限,并且日历的类型只能为 primary 或 shared。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarAclSample.java ; + */ + public ListCalendarAclResp list(ListCalendarAclReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/calendar/v4/calendars/:calendar_id/acls" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListCalendarAclResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCalendarAclResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/acls" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取访问控制列表,该接口用于以当前身份(应用 / 用户)获取日历的控制权限列表。;;身份由 Header Authorization 的 Token 类型决定。 + *

当前身份需要有日历的 owner 权限,并且日历的类型只能为 primary 或 shared。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarAclSample.java ; + */ + public ListCalendarAclResp list(ListCalendarAclReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/calendar/v4/calendars/:calendar_id/acls" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListCalendarAclResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCalendarAclResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/acls" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 订阅日历访问控制变更事件;,该接口用于以用户身份订阅指定日历下的日历成员变更事件。 + *

用户必须对日历有访问权限。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/subscription ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscriptionCalendarAclSample.java ; + */ + public SubscriptionCalendarAclResp subscription(SubscriptionCalendarAclReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/:calendar_id/acls/subscription" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + SubscriptionCalendarAclResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscriptionCalendarAclResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/acls/subscription" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 订阅日历访问控制变更事件;,该接口用于以用户身份订阅指定日历下的日历成员变更事件。 + *

用户必须对日历有访问权限。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/subscription ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscriptionCalendarAclSample.java ; + */ + public SubscriptionCalendarAclResp subscription(SubscriptionCalendarAclReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/:calendar_id/acls/subscription" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + SubscriptionCalendarAclResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscriptionCalendarAclResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/acls/subscription" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 取消订阅日历访问控制变更事件,该接口用于以用户身份取消订阅指定日历下的日历成员变更事件。 + *

用户必须对日历有访问权限。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/unsubscription ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscriptionCalendarAclSample.java ; + */ + public UnsubscriptionCalendarAclResp unsubscription(UnsubscriptionCalendarAclReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/:calendar_id/acls/unsubscription" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + UnsubscriptionCalendarAclResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnsubscriptionCalendarAclResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/acls/unsubscription" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 取消订阅日历访问控制变更事件,该接口用于以用户身份取消订阅指定日历下的日历成员变更事件。 + *

用户必须对日历有访问权限。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/unsubscription ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscriptionCalendarAclSample.java ; + */ + public UnsubscriptionCalendarAclResp unsubscription(UnsubscriptionCalendarAclReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/:calendar_id/acls/unsubscription" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + UnsubscriptionCalendarAclResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnsubscriptionCalendarAclResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/acls/unsubscription" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/CalendarEvent.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/CalendarEvent.java new file mode 100644 index 000000000..0ac3802ad --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/CalendarEvent.java @@ -0,0 +1,582 @@ +// Code generated by lark suite 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 com.lark.oapi.service.calendar.v4.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.calendar.v4.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class CalendarEvent { + private static final Logger log = LoggerFactory.getLogger(CalendarEvent.class); + private final Config config; + + public CalendarEvent(Config config) { + this.config = config; + } + + + /** + * 创建日程,该接口用于以当前身份(应用 / 用户)在日历上创建一个日程。;;身份由 Header Authorization 的 Token 类型决定。 + *

当前身份必须对日历有 writer 或 owner 权限,并且日历的类型只能为 primary 或 shared。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarEventSample.java ; + */ + public CreateCalendarEventResp create(CreateCalendarEventReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/:calendar_id/events" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCalendarEventResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建日程,该接口用于以当前身份(应用 / 用户)在日历上创建一个日程。;;身份由 Header Authorization 的 Token 类型决定。 + *

当前身份必须对日历有 writer 或 owner 权限,并且日历的类型只能为 primary 或 shared。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarEventSample.java ; + */ + public CreateCalendarEventResp create(CreateCalendarEventReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/:calendar_id/events" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCalendarEventResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除日程,该接口用于以当前身份(应用 / 用户)删除日历上的一个日程。;;身份由 Header Authorization 的 Token 类型决定。 + *

当前身份必须对日历有 writer 或 owner 权限,并且日历的类型只能为 primary 或 shared。;;当前身份必须是日程的组织者。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarEventSample.java ; + */ + public DeleteCalendarEventResp delete(DeleteCalendarEventReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteCalendarEventResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除日程,该接口用于以当前身份(应用 / 用户)删除日历上的一个日程。;;身份由 Header Authorization 的 Token 类型决定。 + *

当前身份必须对日历有 writer 或 owner 权限,并且日历的类型只能为 primary 或 shared。;;当前身份必须是日程的组织者。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarEventSample.java ; + */ + public DeleteCalendarEventResp delete(DeleteCalendarEventReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteCalendarEventResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取日程,该接口用于以当前身份(应用 / 用户)获取日历上的一个日程。;身份由 Header Authorization 的 Token 类型决定。 + *

- 当前身份必须对日历有reader、writer或owner权限才会返回日程详细信息(调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口,role字段可查看权限)。;- [例外日程](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/introduction#71c5ec78)可通过event_id的非0时间戳后缀,来获取修改的重复性日程的哪一天日程的时间信息。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GetCalendarEventSample.java ; + */ + public GetCalendarEventResp get(GetCalendarEventReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCalendarEventResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取日程,该接口用于以当前身份(应用 / 用户)获取日历上的一个日程。;身份由 Header Authorization 的 Token 类型决定。 + *

- 当前身份必须对日历有reader、writer或owner权限才会返回日程详细信息(调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口,role字段可查看权限)。;- [例外日程](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/introduction#71c5ec78)可通过event_id的非0时间戳后缀,来获取修改的重复性日程的哪一天日程的时间信息。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GetCalendarEventSample.java ; + */ + public GetCalendarEventResp get(GetCalendarEventReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCalendarEventResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取日程列表,该接口用于以当前身份(应用 / 用户)获取日历下的日程列表。;身份由 Header Authorization 的 Token 类型决定。 + *

- 当前身份必须对日历有reader、writer或owner权限才会返回日程详细信息(调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口,role字段可查看权限)。;;- 仅支持primary、shared和resource类型的日历获取日程列表。;;- page_token 分页拉取存量数据,sync_token 增量同步变更数据;目前仅传anchor_time时,会返回page_token。;;- 为了确保调用方日程同步数据的一致性,在使用sync_token时,不能同时使用start_time和end_time,否则可能造成日程数据缺失。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarEventSample.java ; + */ + public ListCalendarEventResp list(ListCalendarEventReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/calendar/v4/calendars/:calendar_id/events" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCalendarEventResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取日程列表,该接口用于以当前身份(应用 / 用户)获取日历下的日程列表。;身份由 Header Authorization 的 Token 类型决定。 + *

- 当前身份必须对日历有reader、writer或owner权限才会返回日程详细信息(调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口,role字段可查看权限)。;;- 仅支持primary、shared和resource类型的日历获取日程列表。;;- page_token 分页拉取存量数据,sync_token 增量同步变更数据;目前仅传anchor_time时,会返回page_token。;;- 为了确保调用方日程同步数据的一致性,在使用sync_token时,不能同时使用start_time和end_time,否则可能造成日程数据缺失。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarEventSample.java ; + */ + public ListCalendarEventResp list(ListCalendarEventReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/calendar/v4/calendars/:calendar_id/events" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCalendarEventResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新日程,该接口用于以当前身份(应用 / 用户)更新日历上的一个日程。;;身份由 Header Authorization 的 Token 类型决定。 + *

当前身份必须对日历有 writer 或 owner 权限,并且日历的类型只能为 primary 或 shared。;;当前身份为日程组织者时,可修改所有可编辑字段。;;当前身份为日程参与者时,仅可编辑部分字段。(如:visibility, free_busy_status, color, reminders) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/PatchCalendarEventSample.java ; + */ + public PatchCalendarEventResp patch(PatchCalendarEventReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchCalendarEventResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新日程,该接口用于以当前身份(应用 / 用户)更新日历上的一个日程。;;身份由 Header Authorization 的 Token 类型决定。 + *

当前身份必须对日历有 writer 或 owner 权限,并且日历的类型只能为 primary 或 shared。;;当前身份为日程组织者时,可修改所有可编辑字段。;;当前身份为日程参与者时,仅可编辑部分字段。(如:visibility, free_busy_status, color, reminders) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/PatchCalendarEventSample.java ; + */ + public PatchCalendarEventResp patch(PatchCalendarEventReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchCalendarEventResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 搜索日程,该接口用于以用户身份搜索某日历下的相关日程。;;身份由 Header Authorization 的 Token 类型决定。 + *

当前身份必须对日历有reader、writer或owner权限(调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口,role字段可查看权限)。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/search ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SearchCalendarEventSample.java ; + */ + public SearchCalendarEventResp search(SearchCalendarEventReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/:calendar_id/events/search" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + SearchCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchCalendarEventResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 搜索日程,该接口用于以用户身份搜索某日历下的相关日程。;;身份由 Header Authorization 的 Token 类型决定。 + *

当前身份必须对日历有reader、writer或owner权限(调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口,role字段可查看权限)。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/search ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SearchCalendarEventSample.java ; + */ + public SearchCalendarEventResp search(SearchCalendarEventReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/:calendar_id/events/search" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + SearchCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchCalendarEventResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 订阅日程变更事件,该接口用于以用户身份订阅指定日历下的日程变更事件。 + *

当前身份必须对日历有reader、writer或owner权限(调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口,role字段可查看权限)。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/subscription ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscriptionCalendarEventSample.java ; + */ + public SubscriptionCalendarEventResp subscription(SubscriptionCalendarEventReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/:calendar_id/events/subscription" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + SubscriptionCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscriptionCalendarEventResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/subscription" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 订阅日程变更事件,该接口用于以用户身份订阅指定日历下的日程变更事件。 + *

当前身份必须对日历有reader、writer或owner权限(调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口,role字段可查看权限)。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/subscription ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscriptionCalendarEventSample.java ; + */ + public SubscriptionCalendarEventResp subscription(SubscriptionCalendarEventReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/:calendar_id/events/subscription" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + SubscriptionCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscriptionCalendarEventResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/subscription" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 取消订阅日程变更事件,该接口用于以用户身份取消订阅指定日历下的日程变更事件。 + *

当前身份必须对日历有reader、writer或owner权限(调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口,role字段可查看权限)。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/unsubscription ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscriptionCalendarEventSample.java ; + */ + public UnsubscriptionCalendarEventResp unsubscription(UnsubscriptionCalendarEventReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/:calendar_id/events/unsubscription" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + UnsubscriptionCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnsubscriptionCalendarEventResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/unsubscription" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 取消订阅日程变更事件,该接口用于以用户身份取消订阅指定日历下的日程变更事件。 + *

当前身份必须对日历有reader、writer或owner权限(调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口,role字段可查看权限)。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/unsubscription ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscriptionCalendarEventSample.java ; + */ + public UnsubscriptionCalendarEventResp unsubscription(UnsubscriptionCalendarEventReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/:calendar_id/events/unsubscription" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + UnsubscriptionCalendarEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnsubscriptionCalendarEventResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/unsubscription" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/CalendarEventAttendee.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/CalendarEventAttendee.java new file mode 100644 index 000000000..811b60fba --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/CalendarEventAttendee.java @@ -0,0 +1,242 @@ +// Code generated by lark suite 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 com.lark.oapi.service.calendar.v4.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.calendar.v4.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class CalendarEventAttendee { + private static final Logger log = LoggerFactory.getLogger(CalendarEventAttendee.class); + private final Config config; + + public CalendarEventAttendee(Config config) { + this.config = config; + } + + + /** + * 删除日程参与人,批量删除日程的参与人。 + *

- 当前身份需要有日历的 writer 或 owner 权限,并且日历的类型只能为 primary 或 shared。;;- 当前身份需要是日程的组织者。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee/batch_delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/BatchDeleteCalendarEventAttendeeSample.java ; + */ + public BatchDeleteCalendarEventAttendeeResp batchDelete(BatchDeleteCalendarEventAttendeeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/batch_delete" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + BatchDeleteCalendarEventAttendeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteCalendarEventAttendeeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除日程参与人,批量删除日程的参与人。 + *

- 当前身份需要有日历的 writer 或 owner 权限,并且日历的类型只能为 primary 或 shared。;;- 当前身份需要是日程的组织者。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee/batch_delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/BatchDeleteCalendarEventAttendeeSample.java ; + */ + public BatchDeleteCalendarEventAttendeeResp batchDelete(BatchDeleteCalendarEventAttendeeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/batch_delete" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + BatchDeleteCalendarEventAttendeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteCalendarEventAttendeeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建日程参与人;,批量给日程添加参与人。 + *

- 当前身份需要有日历的 writer 或 owner 权限,并且日历的类型只能为 primary 或 shared。;;- 当前身份需要是日程的组织者,或日程设置了「参与人可邀请其它参与人」权限。;;- 新添加的日程参与人必须与日程组织者在同一个企业内。;;- 使用该接口添加会议室后,会议室会进入异步的预约流程,请求结束不代表会议室预约成功,需后续再查询预约状态。;;- 每个日程最多只能有 3000 名参与人。;;- 开启管理员能力后预约会议室可不受会议室预约范围的限制(当前不支持用管理员身份给其他人的日程预约会议室) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarEventAttendeeSample.java ; + */ + public CreateCalendarEventAttendeeResp create(CreateCalendarEventAttendeeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateCalendarEventAttendeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCalendarEventAttendeeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建日程参与人;,批量给日程添加参与人。 + *

- 当前身份需要有日历的 writer 或 owner 权限,并且日历的类型只能为 primary 或 shared。;;- 当前身份需要是日程的组织者,或日程设置了「参与人可邀请其它参与人」权限。;;- 新添加的日程参与人必须与日程组织者在同一个企业内。;;- 使用该接口添加会议室后,会议室会进入异步的预约流程,请求结束不代表会议室预约成功,需后续再查询预约状态。;;- 每个日程最多只能有 3000 名参与人。;;- 开启管理员能力后预约会议室可不受会议室预约范围的限制(当前不支持用管理员身份给其他人的日程预约会议室) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarEventAttendeeSample.java ; + */ + public CreateCalendarEventAttendeeResp create(CreateCalendarEventAttendeeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateCalendarEventAttendeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCalendarEventAttendeeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取日程参与人列表,获取日程的参与人列表,若参与者列表中有群组,请使用 [获取参与人群成员列表](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee-chat_member/list) 。 + *

- 当前身份必须对日历有reader、writer或owner权限(调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口,role字段可查看权限)。;;- 当前身份必须有权限查看日程的参与人列表。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarEventAttendeeSample.java ; + */ + public ListCalendarEventAttendeeResp list(ListCalendarEventAttendeeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListCalendarEventAttendeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCalendarEventAttendeeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取日程参与人列表,获取日程的参与人列表,若参与者列表中有群组,请使用 [获取参与人群成员列表](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee-chat_member/list) 。 + *

- 当前身份必须对日历有reader、writer或owner权限(调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口,role字段可查看权限)。;;- 当前身份必须有权限查看日程的参与人列表。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarEventAttendeeSample.java ; + */ + public ListCalendarEventAttendeeResp list(ListCalendarEventAttendeeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListCalendarEventAttendeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCalendarEventAttendeeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/CalendarEventAttendeeChatMember.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/CalendarEventAttendeeChatMember.java new file mode 100644 index 000000000..35d5a03be --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/CalendarEventAttendeeChatMember.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.calendar.v4.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.calendar.v4.model.ListCalendarEventAttendeeChatMemberReq; +import com.lark.oapi.service.calendar.v4.model.ListCalendarEventAttendeeChatMemberResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class CalendarEventAttendeeChatMember { + private static final Logger log = LoggerFactory.getLogger(CalendarEventAttendeeChatMember.class); + private final Config config; + + public CalendarEventAttendeeChatMember(Config config) { + this.config = config; + } + + + /** + * 获取日程参与群成员列表,获取日程的群参与人的群成员列表。 + *

- 当前身份必须有权限查看日程的参与人列表。;;- 当前身份必须在群聊中,或有权限查看群成员列表。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee-chat_member/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarEventAttendeeChatMemberSample.java ; + */ + public ListCalendarEventAttendeeChatMemberResp list(ListCalendarEventAttendeeChatMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListCalendarEventAttendeeChatMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCalendarEventAttendeeChatMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取日程参与群成员列表,获取日程的群参与人的群成员列表。 + *

- 当前身份必须有权限查看日程的参与人列表。;;- 当前身份必须在群聊中,或有权限查看群成员列表。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee-chat_member/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarEventAttendeeChatMemberSample.java ; + */ + public ListCalendarEventAttendeeChatMemberResp list(ListCalendarEventAttendeeChatMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListCalendarEventAttendeeChatMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCalendarEventAttendeeChatMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/CalendarEventMeetingChat.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/CalendarEventMeetingChat.java new file mode 100644 index 000000000..9cfae3cd1 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/CalendarEventMeetingChat.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.calendar.v4.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.calendar.v4.model.CreateCalendarEventMeetingChatReq; +import com.lark.oapi.service.calendar.v4.model.CreateCalendarEventMeetingChatResp; +import com.lark.oapi.service.calendar.v4.model.DeleteCalendarEventMeetingChatReq; +import com.lark.oapi.service.calendar.v4.model.DeleteCalendarEventMeetingChatResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class CalendarEventMeetingChat { + private static final Logger log = LoggerFactory.getLogger(CalendarEventMeetingChat.class); + private final Config config; + + public CalendarEventMeetingChat(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=calendar&resource=calendar.event.meeting_chat&version=v4 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarEventMeetingChatSample.java ; + */ + public CreateCalendarEventMeetingChatResp create(CreateCalendarEventMeetingChatReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateCalendarEventMeetingChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCalendarEventMeetingChatResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=calendar&resource=calendar.event.meeting_chat&version=v4 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarEventMeetingChatSample.java ; + */ + public CreateCalendarEventMeetingChatResp create(CreateCalendarEventMeetingChatReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateCalendarEventMeetingChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCalendarEventMeetingChatResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=calendar&resource=calendar.event.meeting_chat&version=v4 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarEventMeetingChatSample.java ; + */ + public DeleteCalendarEventMeetingChatResp delete(DeleteCalendarEventMeetingChatReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteCalendarEventMeetingChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteCalendarEventMeetingChatResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=calendar&resource=calendar.event.meeting_chat&version=v4 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarEventMeetingChatSample.java ; + */ + public DeleteCalendarEventMeetingChatResp delete(DeleteCalendarEventMeetingChatReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteCalendarEventMeetingChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteCalendarEventMeetingChatResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/ExchangeBinding.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/ExchangeBinding.java new file mode 100644 index 000000000..e47e46f83 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/ExchangeBinding.java @@ -0,0 +1,242 @@ +// Code generated by lark suite 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 com.lark.oapi.service.calendar.v4.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.calendar.v4.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ExchangeBinding { + private static final Logger log = LoggerFactory.getLogger(ExchangeBinding.class); + private final Config config; + + public ExchangeBinding(Config config) { + this.config = config; + } + + + /** + * 创建Exchange绑定关系,本接口将Exchange账户绑定到飞书账户,进而支持Exchange日历的导入 + *

操作用户需要是企业超级管理员 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/exchange_binding/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateExchangeBindingSample.java ; + */ + public CreateExchangeBindingResp create(CreateExchangeBindingReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/exchange_bindings" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + CreateExchangeBindingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExchangeBindingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/exchange_bindings" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建Exchange绑定关系,本接口将Exchange账户绑定到飞书账户,进而支持Exchange日历的导入 + *

操作用户需要是企业超级管理员 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/exchange_binding/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateExchangeBindingSample.java ; + */ + public CreateExchangeBindingResp create(CreateExchangeBindingReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/exchange_bindings" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + CreateExchangeBindingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExchangeBindingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/exchange_bindings" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 解除Exchange绑定关系,本接口解除Exchange账户和飞书账户的绑定关系,Exchange账户解除绑定后才能绑定其他飞书账户 + *

操作用户需要是企业超级管理员 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/exchange_binding/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteExchangeBindingSample.java ; + */ + public DeleteExchangeBindingResp delete(DeleteExchangeBindingReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + DeleteExchangeBindingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteExchangeBindingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 解除Exchange绑定关系,本接口解除Exchange账户和飞书账户的绑定关系,Exchange账户解除绑定后才能绑定其他飞书账户 + *

操作用户需要是企业超级管理员 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/exchange_binding/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteExchangeBindingSample.java ; + */ + public DeleteExchangeBindingResp delete(DeleteExchangeBindingReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + DeleteExchangeBindingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteExchangeBindingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取绑定状态,本接口获取Exchange账户的绑定状态,包括exchange日历是否同步完成。 + *

操作用户需要是企业超级管理员 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/exchange_binding/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GetExchangeBindingSample.java ; + */ + public GetExchangeBindingResp get(GetExchangeBindingReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + GetExchangeBindingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetExchangeBindingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取绑定状态,本接口获取Exchange账户的绑定状态,包括exchange日历是否同步完成。 + *

操作用户需要是企业超级管理员 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/exchange_binding/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GetExchangeBindingSample.java ; + */ + public GetExchangeBindingResp get(GetExchangeBindingReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + GetExchangeBindingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetExchangeBindingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/Freebusy.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/Freebusy.java new file mode 100644 index 000000000..e8e3a698e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/Freebusy.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.calendar.v4.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.calendar.v4.model.ListFreebusyReq; +import com.lark.oapi.service.calendar.v4.model.ListFreebusyResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Freebusy { + private static final Logger log = LoggerFactory.getLogger(Freebusy.class); + private final Config config; + + public Freebusy(Config config) { + this.config = config; + } + + + /** + * 查询主日历忙闲信息,查询用户主日历或会议室的忙闲信息。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/freebusy/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListFreebusySample.java ; + */ + public ListFreebusyResp list(ListFreebusyReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/freebusy/list" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListFreebusyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFreebusyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/freebusy/list" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询主日历忙闲信息,查询用户主日历或会议室的忙闲信息。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/freebusy/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListFreebusySample.java ; + */ + public ListFreebusyResp list(ListFreebusyReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/freebusy/list" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListFreebusyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFreebusyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/freebusy/list" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/Setting.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/Setting.java new file mode 100644 index 000000000..043f57c4c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/Setting.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.calendar.v4.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.calendar.v4.model.GenerateCaldavConfSettingReq; +import com.lark.oapi.service.calendar.v4.model.GenerateCaldavConfSettingResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Setting { + private static final Logger log = LoggerFactory.getLogger(Setting.class); + private final Config config; + + public Setting(Config config) { + this.config = config; + } + + + /** + * 生成CalDAV配置,用于为当前用户生成一个CalDAV账号密码,用于将飞书日历信息同步到本地设备日历。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/setting/generate_caldav_conf ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GenerateCaldavConfSettingSample.java ; + */ + public GenerateCaldavConfSettingResp generateCaldavConf(GenerateCaldavConfSettingReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/settings/generate_caldav_conf" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + GenerateCaldavConfSettingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GenerateCaldavConfSettingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/settings/generate_caldav_conf" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 生成CalDAV配置,用于为当前用户生成一个CalDAV账号密码,用于将飞书日历信息同步到本地设备日历。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/setting/generate_caldav_conf ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GenerateCaldavConfSettingSample.java ; + */ + public GenerateCaldavConfSettingResp generateCaldavConf(GenerateCaldavConfSettingReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/settings/generate_caldav_conf" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + GenerateCaldavConfSettingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GenerateCaldavConfSettingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/settings/generate_caldav_conf" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/TimeoffEvent.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/TimeoffEvent.java new file mode 100644 index 000000000..6df4e3361 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/calendar/v4/resource/TimeoffEvent.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.calendar.v4.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.calendar.v4.model.CreateTimeoffEventReq; +import com.lark.oapi.service.calendar.v4.model.CreateTimeoffEventResp; +import com.lark.oapi.service.calendar.v4.model.DeleteTimeoffEventReq; +import com.lark.oapi.service.calendar.v4.model.DeleteTimeoffEventResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class TimeoffEvent { + private static final Logger log = LoggerFactory.getLogger(TimeoffEvent.class); + private final Config config; + + public TimeoffEvent(Config config) { + this.config = config; + } + + + /** + * 创建请假日程,为指定用户创建一个请假日程,可以是一个普通请假日程,也可以是一个全天日程。;创建请假日程后,会在相应时间内,在用户个人签名页展示请假信息。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/timeoff_event/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateTimeoffEventSample.java ; + */ + public CreateTimeoffEventResp create(CreateTimeoffEventReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/timeoff_events" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateTimeoffEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTimeoffEventResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/timeoff_events" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建请假日程,为指定用户创建一个请假日程,可以是一个普通请假日程,也可以是一个全天日程。;创建请假日程后,会在相应时间内,在用户个人签名页展示请假信息。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/timeoff_event/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateTimeoffEventSample.java ; + */ + public CreateTimeoffEventResp create(CreateTimeoffEventReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/calendar/v4/timeoff_events" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateTimeoffEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTimeoffEventResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/timeoff_events" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除请假日程,删除一个指定的请假日程,请假日程删除,用户个人签名页的请假信息也会消失。;一个应用只能删除自己创建的请假日程。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/timeoff_event/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteTimeoffEventSample.java ; + */ + public DeleteTimeoffEventResp delete(DeleteTimeoffEventReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/calendar/v4/timeoff_events/:timeoff_event_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteTimeoffEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTimeoffEventResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/timeoff_events/:timeoff_event_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除请假日程,删除一个指定的请假日程,请假日程删除,用户个人签名页的请假信息也会消失。;一个应用只能删除自己创建的请假日程。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/timeoff_event/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteTimeoffEventSample.java ; + */ + public DeleteTimeoffEventResp delete(DeleteTimeoffEventReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/calendar/v4/timeoff_events/:timeoff_event_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteTimeoffEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTimeoffEventResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/calendar/v4/timeoff_events/:timeoff_event_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/ContactService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/ContactService.java new file mode 100644 index 000000000..4523cd983 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/ContactService.java @@ -0,0 +1,254 @@ +// Code generated by lark suite 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 com.lark.oapi.service.contact; + +import com.lark.oapi.core.Config; +import com.lark.oapi.event.IEventHandler; +import com.lark.oapi.service.contact.v3.V3; +import com.lark.oapi.service.contact.v3.model.*; +import com.lark.oapi.service.contact.v3.resource.CustomAttr; +import com.lark.oapi.service.contact.v3.resource.CustomAttrEvent; +import com.lark.oapi.service.contact.v3.resource.Department; +import com.lark.oapi.service.contact.v3.resource.EmployeeTypeEnum; +import com.lark.oapi.service.contact.v3.resource.FunctionalRole; +import com.lark.oapi.service.contact.v3.resource.FunctionalRoleMember; +import com.lark.oapi.service.contact.v3.resource.Group; +import com.lark.oapi.service.contact.v3.resource.JobFamily; +import com.lark.oapi.service.contact.v3.resource.JobLevel; +import com.lark.oapi.service.contact.v3.resource.JobTitle; +import com.lark.oapi.service.contact.v3.resource.Scope; +import com.lark.oapi.service.contact.v3.resource.Unit; +import com.lark.oapi.service.contact.v3.resource.User; +import com.lark.oapi.service.contact.v3.resource.WorkCity; +import com.lark.oapi.service.contact.v3.resource.*; + +public class ContactService { + private final V3 v3; + private final CustomAttr customAttr; // 自定义用户字段 + private final CustomAttrEvent customAttrEvent; // 事件 + private final Department department; // 部门 + private final EmployeeTypeEnum employeeTypeEnum; // 人员类型 + private final FunctionalRole functionalRole; // functional_role + private final FunctionalRoleMember functionalRoleMember; // functional_role.member + private final Group group; // 用户组 + private final GroupMember groupMember; // 用户组成员 + private final JobFamily jobFamily; // job_family + private final JobLevel jobLevel; // job_level + private final JobTitle jobTitle; // job_title + private final Scope scope; // 通讯录权限范围 + private final Unit unit; // 单位 + private final User user; // 用户 + private final WorkCity workCity; // work_city + + public ContactService(Config config) { + this.v3 = new V3(config); + this.customAttr = new CustomAttr(config); + this.customAttrEvent = new CustomAttrEvent(config); + this.department = new Department(config); + this.employeeTypeEnum = new EmployeeTypeEnum(config); + this.functionalRole = new FunctionalRole(config); + this.functionalRoleMember = new FunctionalRoleMember(config); + this.group = new Group(config); + this.groupMember = new GroupMember(config); + this.jobFamily = new JobFamily(config); + this.jobLevel = new JobLevel(config); + this.jobTitle = new JobTitle(config); + this.scope = new Scope(config); + this.unit = new Unit(config); + this.user = new User(config); + this.workCity = new WorkCity(config); + } + + public V3 v3() { + return v3; + } + + public CustomAttr customAttr() { + return customAttr; + } + + public CustomAttrEvent customAttrEvent() { + return customAttrEvent; + } + + public Department department() { + return department; + } + + public EmployeeTypeEnum employeeTypeEnum() { + return employeeTypeEnum; + } + + public FunctionalRole functionalRole() { + return functionalRole; + } + + public FunctionalRoleMember functionalRoleMember() { + return functionalRoleMember; + } + + public Group group() { + return group; + } + + public GroupMember groupMember() { + return groupMember; + } + + public JobFamily jobFamily() { + return jobFamily; + } + + public JobLevel jobLevel() { + return jobLevel; + } + + public JobTitle jobTitle() { + return jobTitle; + } + + public Scope scope() { + return scope; + } + + public Unit unit() { + return unit; + } + + public User user() { + return user; + } + + public WorkCity workCity() { + return workCity; + } + + public abstract static class P2CustomAttrEventUpdatedV3Handler implements IEventHandler { + @Override + public P2CustomAttrEventUpdatedV3 getEvent() { + return new P2CustomAttrEventUpdatedV3(); + } + } + + public abstract static class P2DepartmentCreatedV3Handler implements IEventHandler { + @Override + public P2DepartmentCreatedV3 getEvent() { + return new P2DepartmentCreatedV3(); + } + } + + public abstract static class P2DepartmentDeletedV3Handler implements IEventHandler { + @Override + public P2DepartmentDeletedV3 getEvent() { + return new P2DepartmentDeletedV3(); + } + } + + public abstract static class P2DepartmentUpdatedV3Handler implements IEventHandler { + @Override + public P2DepartmentUpdatedV3 getEvent() { + return new P2DepartmentUpdatedV3(); + } + } + + public abstract static class P2EmployeeTypeEnumActivedV3Handler implements IEventHandler { + @Override + public P2EmployeeTypeEnumActivedV3 getEvent() { + return new P2EmployeeTypeEnumActivedV3(); + } + } + + public abstract static class P2EmployeeTypeEnumCreatedV3Handler implements IEventHandler { + @Override + public P2EmployeeTypeEnumCreatedV3 getEvent() { + return new P2EmployeeTypeEnumCreatedV3(); + } + } + + public abstract static class P2EmployeeTypeEnumDeactivatedV3Handler implements IEventHandler { + @Override + public P2EmployeeTypeEnumDeactivatedV3 getEvent() { + return new P2EmployeeTypeEnumDeactivatedV3(); + } + } + + public abstract static class P2EmployeeTypeEnumDeletedV3Handler implements IEventHandler { + @Override + public P2EmployeeTypeEnumDeletedV3 getEvent() { + return new P2EmployeeTypeEnumDeletedV3(); + } + } + + public abstract static class P2EmployeeTypeEnumUpdatedV3Handler implements IEventHandler { + @Override + public P2EmployeeTypeEnumUpdatedV3 getEvent() { + return new P2EmployeeTypeEnumUpdatedV3(); + } + } + + public abstract static class P2ScopeUpdatedV3Handler implements IEventHandler { + @Override + public P2ScopeUpdatedV3 getEvent() { + return new P2ScopeUpdatedV3(); + } + } + + public abstract static class P2UserCreatedV3Handler implements IEventHandler { + @Override + public P2UserCreatedV3 getEvent() { + return new P2UserCreatedV3(); + } + } + + public abstract static class P2UserDeletedV3Handler implements IEventHandler { + @Override + public P2UserDeletedV3 getEvent() { + return new P2UserDeletedV3(); + } + } + + public abstract static class P2UserUpdatedV3Handler implements IEventHandler { + @Override + public P2UserUpdatedV3 getEvent() { + return new P2UserUpdatedV3(); + } + } + + public abstract static class P1UserChangedV3Handler implements IEventHandler { + @Override + public P1UserChangedV3 getEvent() { + return new P1UserChangedV3(); + } + } + + public abstract static class P1UserStatusChangedV3Handler implements IEventHandler { + @Override + public P1UserStatusChangedV3 getEvent() { + return new P1UserStatusChangedV3(); + } + } + + public abstract static class P1DepartmentChangedV3Handler implements IEventHandler { + @Override + public P1DepartmentChangedV3 getEvent() { + return new P1DepartmentChangedV3(); + } + } + + public abstract static class P1ContactScopeChangedV3Handler implements IEventHandler { + @Override + public P1ContactScopeChangedV3 getEvent() { + return new P1ContactScopeChangedV3(); + } + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/ContactService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/ContactService.java deleted file mode 100644 index 0573ae1a9..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/ContactService.java +++ /dev/null @@ -1,5094 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.contact.v3; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.event.IEventHandler; -import com.lark.oapi.service.contact.v3.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class ContactService { - private static final Logger log = LoggerFactory.getLogger(ContactService.class); - private final CustomAttr customAttr; // 自定义用户字段 - private final CustomAttrEvent customAttrEvent; // 事件 - private final Department department; // 部门 - private final EmployeeTypeEnum employeeTypeEnum; // 人员类型 - private final FunctionalRole functionalRole; // functional_role - private final FunctionalRoleMember functionalRoleMember; // functional_role.member - private final Group group; // 用户组 - private final GroupMember groupMember; // 用户组成员 - private final JobFamily jobFamily; // job_family - private final JobLevel jobLevel; // job_level - private final JobTitle jobTitle; // job_title - private final Scope scope; // 通讯录权限范围 - private final Unit unit; // 单位 - private final User user; // 用户 - private final WorkCity workCity; // work_city - - public ContactService(Config config) { - this.customAttr = new CustomAttr(config); - this.customAttrEvent = new CustomAttrEvent(config); - this.department = new Department(config); - this.employeeTypeEnum = new EmployeeTypeEnum(config); - this.functionalRole = new FunctionalRole(config); - this.functionalRoleMember = new FunctionalRoleMember(config); - this.group = new Group(config); - this.groupMember = new GroupMember(config); - this.jobFamily = new JobFamily(config); - this.jobLevel = new JobLevel(config); - this.jobTitle = new JobTitle(config); - this.scope = new Scope(config); - this.unit = new Unit(config); - this.user = new User(config); - this.workCity = new WorkCity(config); - } - - /** - * 自定义用户字段 - * - * @return - */ - public CustomAttr customAttr() { - return customAttr; - } - - /** - * 事件 - * - * @return - */ - public CustomAttrEvent customAttrEvent() { - return customAttrEvent; - } - - /** - * 部门 - * - * @return - */ - public Department department() { - return department; - } - - /** - * 人员类型 - * - * @return - */ - public EmployeeTypeEnum employeeTypeEnum() { - return employeeTypeEnum; - } - - /** - * functional_role - * - * @return - */ - public FunctionalRole functionalRole() { - return functionalRole; - } - - /** - * functional_role.member - * - * @return - */ - public FunctionalRoleMember functionalRoleMember() { - return functionalRoleMember; - } - - /** - * 用户组 - * - * @return - */ - public Group group() { - return group; - } - - /** - * 用户组成员 - * - * @return - */ - public GroupMember groupMember() { - return groupMember; - } - - /** - * job_family - * - * @return - */ - public JobFamily jobFamily() { - return jobFamily; - } - - /** - * job_level - * - * @return - */ - public JobLevel jobLevel() { - return jobLevel; - } - - /** - * job_title - * - * @return - */ - public JobTitle jobTitle() { - return jobTitle; - } - - /** - * 通讯录权限范围 - * - * @return - */ - public Scope scope() { - return scope; - } - - /** - * 单位 - * - * @return - */ - public Unit unit() { - return unit; - } - - /** - * 用户 - * - * @return - */ - public User user() { - return user; - } - - /** - * work_city - * - * @return - */ - public WorkCity workCity() { - return workCity; - } - - public static class CustomAttr { - private final Config config; - - public CustomAttr(Config config) { - this.config = config; - } - - /** - * 获取企业自定义用户字段,获取企业自定义的用户字段配置信息 - *

调用该接口前,需要先确认[企业管理员](https://www.feishu.cn/hc/zh-CN/articles/360049067822)在[企业管理后台 - 组织架构 - 成员字段管理](http://www.feishu.cn/admin/contacts/employee-field-new/custom) 自定义字段管理栏开启了“允许开放平台API调用“。;;![通讯录.gif](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/544738c94f13ef0b9ebaff53a5133cc7_E9EGMkXyzX.gif) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/custom_attr/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListCustomAttrSample.java ; - */ - public ListCustomAttrResp list(ListCustomAttrReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/custom_attrs" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListCustomAttrResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCustomAttrResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/custom_attrs" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取企业自定义用户字段,获取企业自定义的用户字段配置信息 - *

调用该接口前,需要先确认[企业管理员](https://www.feishu.cn/hc/zh-CN/articles/360049067822)在[企业管理后台 - 组织架构 - 成员字段管理](http://www.feishu.cn/admin/contacts/employee-field-new/custom) 自定义字段管理栏开启了“允许开放平台API调用“。;;![通讯录.gif](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/544738c94f13ef0b9ebaff53a5133cc7_E9EGMkXyzX.gif) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/custom_attr/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListCustomAttrSample.java ; - */ - public ListCustomAttrResp list(ListCustomAttrReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/custom_attrs" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListCustomAttrResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCustomAttrResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/custom_attrs" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class CustomAttrEvent { - private final Config config; - - public CustomAttrEvent(Config config) { - this.config = config; - } - } - - public static class Department { - private final Config config; - - public Department(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch&project=contact&resource=department&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchDepartmentSample.java ; - */ - public BatchDepartmentResp batch(BatchDepartmentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/departments/batch" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - BatchDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/batch" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch&project=contact&resource=department&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchDepartmentSample.java ; - */ - public BatchDepartmentResp batch(BatchDepartmentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/departments/batch" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - BatchDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/batch" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取子部门列表,通过部门ID获取部门的子部门列表。 - *

- 部门ID 必填,根部门的部门ID 为0。;- 使用 `user_access_token` 时,返回该用户组织架构可见性范围([登陆企业管理后台进行权限配置](https://www.feishu.cn/admin/security/permission/visibility))内的所有可见部门。当进行递归查询时,最多1000个部门对该用户可见。;;- 使用 ;`tenant_access_token` 则基于应用的通讯录权限范围进行权限校验与过滤。;如果部门ID为0,会检验应用是否有全员通讯录权限,如果是非0 部门ID,则会校验应用是否有该部门的通讯录权限。无部门权限返回无部门通讯录权限错误码,有权限则返回部门下子部门列表(根据fetch_child决定是否递归)。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/children ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ChildrenDepartmentSample.java ; - */ - public ChildrenDepartmentResp children(ChildrenDepartmentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/departments/:department_id/children" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ChildrenDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ChildrenDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/:department_id/children" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取子部门列表,通过部门ID获取部门的子部门列表。 - *

- 部门ID 必填,根部门的部门ID 为0。;- 使用 `user_access_token` 时,返回该用户组织架构可见性范围([登陆企业管理后台进行权限配置](https://www.feishu.cn/admin/security/permission/visibility))内的所有可见部门。当进行递归查询时,最多1000个部门对该用户可见。;;- 使用 ;`tenant_access_token` 则基于应用的通讯录权限范围进行权限校验与过滤。;如果部门ID为0,会检验应用是否有全员通讯录权限,如果是非0 部门ID,则会校验应用是否有该部门的通讯录权限。无部门权限返回无部门通讯录权限错误码,有权限则返回部门下子部门列表(根据fetch_child决定是否递归)。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/children ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ChildrenDepartmentSample.java ; - */ - public ChildrenDepartmentResp children(ChildrenDepartmentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/departments/:department_id/children" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ChildrenDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ChildrenDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/:department_id/children" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建部门,该接口用于向通讯录中创建部门。 - *

只可在应用的通讯录权限范围内的部门下创建部门。若需要在根部门下创建子部门,则应用通讯录权限范围需要设置为“全部成员”。应用商店应用无权限调用此接口。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateDepartmentSample.java ; - */ - public CreateDepartmentResp create(CreateDepartmentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/departments" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建部门,该接口用于向通讯录中创建部门。 - *

只可在应用的通讯录权限范围内的部门下创建部门。若需要在根部门下创建子部门,则应用通讯录权限范围需要设置为“全部成员”。应用商店应用无权限调用此接口。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateDepartmentSample.java ; - */ - public CreateDepartmentResp create(CreateDepartmentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/departments" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除部门,该接口用于从通讯录中删除部门。 - *

应用需要同时拥有待删除部门及其父部门的通讯录授权。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteDepartmentSample.java ; - */ - public DeleteDepartmentResp delete(DeleteDepartmentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/contact/v3/departments/:department_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/:department_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除部门,该接口用于从通讯录中删除部门。 - *

应用需要同时拥有待删除部门及其父部门的通讯录授权。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteDepartmentSample.java ; - */ - public DeleteDepartmentResp delete(DeleteDepartmentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/contact/v3/departments/:department_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/:department_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取单个部门信息,该接口用于向通讯录获取单个部门信息。 - *

- 使用`tenant_access_token`时,应用需要拥有待查询部门的通讯录授权。如果需要获取根部门信息,则需要拥有全员权限。;- 使用`user_access_token`时,用户需要有待查询部门的可见性,如果需要获取根部门信息,则要求员工可见所有人。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetDepartmentSample.java ; - */ - public GetDepartmentResp get(GetDepartmentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/departments/:department_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/:department_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取单个部门信息,该接口用于向通讯录获取单个部门信息。 - *

- 使用`tenant_access_token`时,应用需要拥有待查询部门的通讯录授权。如果需要获取根部门信息,则需要拥有全员权限。;- 使用`user_access_token`时,用户需要有待查询部门的可见性,如果需要获取根部门信息,则要求员工可见所有人。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetDepartmentSample.java ; - */ - public GetDepartmentResp get(GetDepartmentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/departments/:department_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/:department_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=department&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListDepartmentSample.java ; - */ - public ListDepartmentResp list(ListDepartmentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/departments" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=department&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListDepartmentSample.java ; - */ - public ListDepartmentResp list(ListDepartmentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/departments" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取父部门信息,该接口用来递归获取部门父部门的信息,并按照由子到父的顺序返回有权限的父部门信息列表。 - *

使用`tenant_access_token`时,该接口只返回可见性范围内的父部门信息。;例如:A >>B>>C>>D四级部门,通讯录权限只到B,那么查询D部门的parent,会返回B和C两级部门。;使用user_access_token时,该接口只返回对于用户可见的父部门信息。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/parent ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ParentDepartmentSample.java ; - */ - public ParentDepartmentResp parent(ParentDepartmentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/departments/parent" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ParentDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ParentDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/parent" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取父部门信息,该接口用来递归获取部门父部门的信息,并按照由子到父的顺序返回有权限的父部门信息列表。 - *

使用`tenant_access_token`时,该接口只返回可见性范围内的父部门信息。;例如:A >>B>>C>>D四级部门,通讯录权限只到B,那么查询D部门的parent,会返回B和C两级部门。;使用user_access_token时,该接口只返回对于用户可见的父部门信息。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/parent ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ParentDepartmentSample.java ; - */ - public ParentDepartmentResp parent(ParentDepartmentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/departments/parent" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ParentDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ParentDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/parent" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改部门部分信息,该接口用于更新通讯录中部门的信息。 - *

调用该接口需要具有该部门以及更新操作涉及的部门的通讯录权限。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchDepartmentSample.java ; - */ - public PatchDepartmentResp patch(PatchDepartmentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/contact/v3/departments/:department_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/:department_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改部门部分信息,该接口用于更新通讯录中部门的信息。 - *

调用该接口需要具有该部门以及更新操作涉及的部门的通讯录权限。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchDepartmentSample.java ; - */ - public PatchDepartmentResp patch(PatchDepartmentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/contact/v3/departments/:department_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/:department_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 搜索部门,搜索部门,用户通过关键词查询可见的部门数据,部门可见性需要管理员在后台配置。 - *

部门存在,但用户搜索不到并不一定是搜索有问题,可能是管理员在后台配置了权限控制,导致用户无法搜索到该部门。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/search ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/SearchDepartmentSample.java ; - */ - public SearchDepartmentResp search(SearchDepartmentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/departments/search" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - SearchDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 搜索部门,搜索部门,用户通过关键词查询可见的部门数据,部门可见性需要管理员在后台配置。 - *

部门存在,但用户搜索不到并不一定是搜索有问题,可能是管理员在后台配置了权限控制,导致用户无法搜索到该部门。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/search ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/SearchDepartmentSample.java ; - */ - public SearchDepartmentResp search(SearchDepartmentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/departments/search" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - SearchDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 部门群转为普通群,通过该接口将部门群转为普通群。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/unbind_department_chat ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UnbindDepartmentChatDepartmentSample.java ; - */ - public UnbindDepartmentChatDepartmentResp unbindDepartmentChat(UnbindDepartmentChatDepartmentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/departments/unbind_department_chat" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UnbindDepartmentChatDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnbindDepartmentChatDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/unbind_department_chat" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 部门群转为普通群,通过该接口将部门群转为普通群。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/unbind_department_chat ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UnbindDepartmentChatDepartmentSample.java ; - */ - public UnbindDepartmentChatDepartmentResp unbindDepartmentChat(UnbindDepartmentChatDepartmentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/departments/unbind_department_chat" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UnbindDepartmentChatDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnbindDepartmentChatDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/unbind_department_chat" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新部门所有信息,该接口用于更新当前部门所有信息。 - *

- 调用该接口需要具有该部门与更新部门信息涉及的通讯录权限。;; - 没有填写的字段会被置为空值(order字段除外)。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateDepartmentSample.java ; - */ - public UpdateDepartmentResp update(UpdateDepartmentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/contact/v3/departments/:department_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/:department_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新部门所有信息,该接口用于更新当前部门所有信息。 - *

- 调用该接口需要具有该部门与更新部门信息涉及的通讯录权限。;; - 没有填写的字段会被置为空值(order字段除外)。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateDepartmentSample.java ; - */ - public UpdateDepartmentResp update(UpdateDepartmentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/contact/v3/departments/:department_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/:department_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_department_id&project=contact&resource=department&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateDepartmentIdDepartmentSample.java ; - */ - public UpdateDepartmentIdDepartmentResp updateDepartmentId(UpdateDepartmentIdDepartmentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/contact/v3/departments/:department_id/update_department_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateDepartmentIdDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateDepartmentIdDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/:department_id/update_department_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_department_id&project=contact&resource=department&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateDepartmentIdDepartmentSample.java ; - */ - public UpdateDepartmentIdDepartmentResp updateDepartmentId(UpdateDepartmentIdDepartmentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/contact/v3/departments/:department_id/update_department_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateDepartmentIdDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateDepartmentIdDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/:department_id/update_department_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class EmployeeTypeEnum { - private final Config config; - - public EmployeeTypeEnum(Config config) { - this.config = config; - } - - /** - * 新增人员类型,新增自定义人员类型 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/employee_type_enum/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateEmployeeTypeEnumSample.java ; - */ - public CreateEmployeeTypeEnumResp create(CreateEmployeeTypeEnumReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/employee_type_enums" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateEmployeeTypeEnumResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEmployeeTypeEnumResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/employee_type_enums" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 新增人员类型,新增自定义人员类型 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/employee_type_enum/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateEmployeeTypeEnumSample.java ; - */ - public CreateEmployeeTypeEnumResp create(CreateEmployeeTypeEnumReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/employee_type_enums" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateEmployeeTypeEnumResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEmployeeTypeEnumResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/employee_type_enums" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除人员类型,删除自定义人员类型 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/employee_type_enum/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteEmployeeTypeEnumSample.java ; - */ - public DeleteEmployeeTypeEnumResp delete(DeleteEmployeeTypeEnumReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/contact/v3/employee_type_enums/:enum_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteEmployeeTypeEnumResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteEmployeeTypeEnumResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/employee_type_enums/:enum_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除人员类型,删除自定义人员类型 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/employee_type_enum/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteEmployeeTypeEnumSample.java ; - */ - public DeleteEmployeeTypeEnumResp delete(DeleteEmployeeTypeEnumReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/contact/v3/employee_type_enums/:enum_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteEmployeeTypeEnumResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteEmployeeTypeEnumResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/employee_type_enums/:enum_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询人员类型,该接口用于获取员工的人员类型 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/employee_type_enum/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListEmployeeTypeEnumSample.java ; - */ - public ListEmployeeTypeEnumResp list(ListEmployeeTypeEnumReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/employee_type_enums" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListEmployeeTypeEnumResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListEmployeeTypeEnumResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/employee_type_enums" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询人员类型,该接口用于获取员工的人员类型 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/employee_type_enum/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListEmployeeTypeEnumSample.java ; - */ - public ListEmployeeTypeEnumResp list(ListEmployeeTypeEnumReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/employee_type_enums" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListEmployeeTypeEnumResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListEmployeeTypeEnumResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/employee_type_enums" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新人员类型,更新自定义人员类型 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/employee_type_enum/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateEmployeeTypeEnumSample.java ; - */ - public UpdateEmployeeTypeEnumResp update(UpdateEmployeeTypeEnumReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/contact/v3/employee_type_enums/:enum_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateEmployeeTypeEnumResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateEmployeeTypeEnumResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/employee_type_enums/:enum_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新人员类型,更新自定义人员类型 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/employee_type_enum/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateEmployeeTypeEnumSample.java ; - */ - public UpdateEmployeeTypeEnumResp update(UpdateEmployeeTypeEnumReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/contact/v3/employee_type_enums/:enum_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateEmployeeTypeEnumResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateEmployeeTypeEnumResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/employee_type_enums/:enum_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class FunctionalRole { - private final Config config; - - public FunctionalRole(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=contact&resource=functional_role&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateFunctionalRoleSample.java ; - */ - public CreateFunctionalRoleResp create(CreateFunctionalRoleReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/functional_roles" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateFunctionalRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFunctionalRoleResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=contact&resource=functional_role&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateFunctionalRoleSample.java ; - */ - public CreateFunctionalRoleResp create(CreateFunctionalRoleReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/functional_roles" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateFunctionalRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFunctionalRoleResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=contact&resource=functional_role&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteFunctionalRoleSample.java ; - */ - public DeleteFunctionalRoleResp delete(DeleteFunctionalRoleReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/contact/v3/functional_roles/:role_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteFunctionalRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteFunctionalRoleResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=contact&resource=functional_role&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteFunctionalRoleSample.java ; - */ - public DeleteFunctionalRoleResp delete(DeleteFunctionalRoleReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/contact/v3/functional_roles/:role_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteFunctionalRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteFunctionalRoleResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=contact&resource=functional_role&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateFunctionalRoleSample.java ; - */ - public UpdateFunctionalRoleResp update(UpdateFunctionalRoleReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/contact/v3/functional_roles/:role_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateFunctionalRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateFunctionalRoleResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=contact&resource=functional_role&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateFunctionalRoleSample.java ; - */ - public UpdateFunctionalRoleResp update(UpdateFunctionalRoleReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/contact/v3/functional_roles/:role_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateFunctionalRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateFunctionalRoleResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class FunctionalRoleMember { - private final Config config; - - public FunctionalRoleMember(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=contact&resource=functional_role.member&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchCreateFunctionalRoleMemberSample.java ; - */ - public BatchCreateFunctionalRoleMemberResp batchCreate(BatchCreateFunctionalRoleMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/functional_roles/:role_id/members/batch_create" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchCreateFunctionalRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateFunctionalRoleMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id/members/batch_create" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=contact&resource=functional_role.member&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchCreateFunctionalRoleMemberSample.java ; - */ - public BatchCreateFunctionalRoleMemberResp batchCreate(BatchCreateFunctionalRoleMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/functional_roles/:role_id/members/batch_create" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchCreateFunctionalRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateFunctionalRoleMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id/members/batch_create" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=contact&resource=functional_role.member&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchDeleteFunctionalRoleMemberSample.java ; - */ - public BatchDeleteFunctionalRoleMemberResp batchDelete(BatchDeleteFunctionalRoleMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/contact/v3/functional_roles/:role_id/members/batch_delete" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchDeleteFunctionalRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteFunctionalRoleMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id/members/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=contact&resource=functional_role.member&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchDeleteFunctionalRoleMemberSample.java ; - */ - public BatchDeleteFunctionalRoleMemberResp batchDelete(BatchDeleteFunctionalRoleMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/contact/v3/functional_roles/:role_id/members/batch_delete" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchDeleteFunctionalRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteFunctionalRoleMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id/members/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=functional_role.member&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetFunctionalRoleMemberSample.java ; - */ - public GetFunctionalRoleMemberResp get(GetFunctionalRoleMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/functional_roles/:role_id/members/:member_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetFunctionalRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFunctionalRoleMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id/members/:member_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=functional_role.member&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetFunctionalRoleMemberSample.java ; - */ - public GetFunctionalRoleMemberResp get(GetFunctionalRoleMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/functional_roles/:role_id/members/:member_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetFunctionalRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFunctionalRoleMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id/members/:member_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=functional_role.member&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListFunctionalRoleMemberSample.java ; - */ - public ListFunctionalRoleMemberResp list(ListFunctionalRoleMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/functional_roles/:role_id/members" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListFunctionalRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFunctionalRoleMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id/members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=functional_role.member&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListFunctionalRoleMemberSample.java ; - */ - public ListFunctionalRoleMemberResp list(ListFunctionalRoleMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/functional_roles/:role_id/members" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListFunctionalRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFunctionalRoleMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id/members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=scopes&project=contact&resource=functional_role.member&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ScopesFunctionalRoleMemberSample.java ; - */ - public ScopesFunctionalRoleMemberResp scopes(ScopesFunctionalRoleMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/contact/v3/functional_roles/:role_id/members/scopes" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ScopesFunctionalRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ScopesFunctionalRoleMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id/members/scopes" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=scopes&project=contact&resource=functional_role.member&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ScopesFunctionalRoleMemberSample.java ; - */ - public ScopesFunctionalRoleMemberResp scopes(ScopesFunctionalRoleMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/contact/v3/functional_roles/:role_id/members/scopes" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ScopesFunctionalRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ScopesFunctionalRoleMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id/members/scopes" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Group { - private final Config config; - - public Group(Config config) { - this.config = config; - } - - /** - * 创建用户组,使用该接口创建用户组,请注意创建用户组时应用的通讯录权限范围需为“全部员工”,否则会创建失败,[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateGroupSample.java ; - */ - public CreateGroupResp create(CreateGroupReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/group" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateGroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建用户组,使用该接口创建用户组,请注意创建用户组时应用的通讯录权限范围需为“全部员工”,否则会创建失败,[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateGroupSample.java ; - */ - public CreateGroupResp create(CreateGroupReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/group" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateGroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除用户组,通过该接口可删除企业中的用户组,请注意删除用户组时应用的通讯录权限范围需为“全部员工”,否则会删除失败,[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteGroupSample.java ; - */ - public DeleteGroupResp delete(DeleteGroupReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/contact/v3/group/:group_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteGroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除用户组,通过该接口可删除企业中的用户组,请注意删除用户组时应用的通讯录权限范围需为“全部员工”,否则会删除失败,[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteGroupSample.java ; - */ - public DeleteGroupResp delete(DeleteGroupReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/contact/v3/group/:group_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteGroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询用户组,根据用户组 ID 查询某个用户组的基本信息,支持查询普通用户组和动态用户组。请确保应用的通讯录权限范围里包括该用户组或者是“全部员工”,[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetGroupSample.java ; - */ - public GetGroupResp get(GetGroupReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/group/:group_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetGroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询用户组,根据用户组 ID 查询某个用户组的基本信息,支持查询普通用户组和动态用户组。请确保应用的通讯录权限范围里包括该用户组或者是“全部员工”,[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetGroupSample.java ; - */ - public GetGroupResp get(GetGroupReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/group/:group_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetGroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询用户所属用户组,通过该接口可查询该用户所属的用户组列表,可分别查询普通用户组和动态用户组。如果应用的通讯录权限范围是“全部员工”,则可获取该员工所属的全部用户组列表。如果应用的通讯录权限范围不是“全部员工”,则仅可获取通讯录权限范围内该员工所属的用户组。[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/member_belong ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/MemberBelongGroupSample.java ; - */ - public MemberBelongGroupResp memberBelong(MemberBelongGroupReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/group/member_belong" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - MemberBelongGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MemberBelongGroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/member_belong" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询用户所属用户组,通过该接口可查询该用户所属的用户组列表,可分别查询普通用户组和动态用户组。如果应用的通讯录权限范围是“全部员工”,则可获取该员工所属的全部用户组列表。如果应用的通讯录权限范围不是“全部员工”,则仅可获取通讯录权限范围内该员工所属的用户组。[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/member_belong ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/MemberBelongGroupSample.java ; - */ - public MemberBelongGroupResp memberBelong(MemberBelongGroupReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/group/member_belong" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - MemberBelongGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MemberBelongGroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/member_belong" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新用户组,使用该接口更新用户组信息,请注意更新用户组时应用的通讯录权限范围需为“全部员工”,否则会更新失败。[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchGroupSample.java ; - */ - public PatchGroupResp patch(PatchGroupReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/contact/v3/group/:group_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchGroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新用户组,使用该接口更新用户组信息,请注意更新用户组时应用的通讯录权限范围需为“全部员工”,否则会更新失败。[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchGroupSample.java ; - */ - public PatchGroupResp patch(PatchGroupReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/contact/v3/group/:group_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchGroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询用户组列表,通过该接口可查询企业的用户组列表,可分别查询普通用户组或动态用户组。如果应用的通讯录权限范围是“全部员工”,则可获取企业全部用户组列表。如果应用的通讯录权限范围不是“全部员工”,则仅可获取通讯录权限范围内的用户组。[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/simplelist ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/SimplelistGroupSample.java ; - */ - public SimplelistGroupResp simplelist(SimplelistGroupReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/group/simplelist" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SimplelistGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SimplelistGroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/simplelist" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询用户组列表,通过该接口可查询企业的用户组列表,可分别查询普通用户组或动态用户组。如果应用的通讯录权限范围是“全部员工”,则可获取企业全部用户组列表。如果应用的通讯录权限范围不是“全部员工”,则仅可获取通讯录权限范围内的用户组。[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/simplelist ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/SimplelistGroupSample.java ; - */ - public SimplelistGroupResp simplelist(SimplelistGroupReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/group/simplelist" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SimplelistGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SimplelistGroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/simplelist" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class GroupMember { - private final Config config; - - public GroupMember(Config config) { - this.config = config; - } - - /** - * 添加用户组成员,向用户组中添加成员(目前成员仅支持用户,未来会支持部门),如果应用的通讯录权限范围是“全部员工”,则可将任何成员添加到任何用户组。如果应用的通讯录权限范围不是“全部员工”,则仅可将通讯录权限范围中的成员添加到通讯录权限范围的用户组中,[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/add ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/AddGroupMemberSample.java ; - */ - public AddGroupMemberResp add(AddGroupMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/group/:group_id/member/add" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - AddGroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddGroupMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id/member/add" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 添加用户组成员,向用户组中添加成员(目前成员仅支持用户,未来会支持部门),如果应用的通讯录权限范围是“全部员工”,则可将任何成员添加到任何用户组。如果应用的通讯录权限范围不是“全部员工”,则仅可将通讯录权限范围中的成员添加到通讯录权限范围的用户组中,[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/add ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/AddGroupMemberSample.java ; - */ - public AddGroupMemberResp add(AddGroupMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/group/:group_id/member/add" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - AddGroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddGroupMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id/member/add" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量添加用户组成员,向普通用户组中批量添加成员(目前仅支持添加用户,暂不支持添加部门),如果应用的通讯录权限范围是“全部员工”,则可将任何成员添加到任何用户组。如果应用的通讯录权限范围不是“全部员工”,则仅可将通讯录权限范围中的成员添加到通讯录权限范围的用户组中,[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 - *

请求体中的member_type,目前仅支持user, 未来将支持department。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/batch_add ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchAddGroupMemberSample.java ; - */ - public BatchAddGroupMemberResp batchAdd(BatchAddGroupMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/group/:group_id/member/batch_add" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchAddGroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchAddGroupMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id/member/batch_add" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量添加用户组成员,向普通用户组中批量添加成员(目前仅支持添加用户,暂不支持添加部门),如果应用的通讯录权限范围是“全部员工”,则可将任何成员添加到任何用户组。如果应用的通讯录权限范围不是“全部员工”,则仅可将通讯录权限范围中的成员添加到通讯录权限范围的用户组中,[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 - *

请求体中的member_type,目前仅支持user, 未来将支持department。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/batch_add ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchAddGroupMemberSample.java ; - */ - public BatchAddGroupMemberResp batchAdd(BatchAddGroupMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/group/:group_id/member/batch_add" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchAddGroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchAddGroupMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id/member/batch_add" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量移除用户组成员,从普通用户组中批量移除成员 (目前仅支持移除用户,暂不支持移除部门)。如果应用的通讯录权限范围是“全部员工”,则可将任何成员移出任何用户组。如果应用的通讯录权限范围不是“全部员工”,则仅可将通讯录权限范围中的成员从通讯录权限范围的用户组中移除, [点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 - *

请求体中的member_type,目前仅支持user, 未来将支持department。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/batch_remove ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchRemoveGroupMemberSample.java ; - */ - public BatchRemoveGroupMemberResp batchRemove(BatchRemoveGroupMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/group/:group_id/member/batch_remove" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchRemoveGroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchRemoveGroupMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id/member/batch_remove" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量移除用户组成员,从普通用户组中批量移除成员 (目前仅支持移除用户,暂不支持移除部门)。如果应用的通讯录权限范围是“全部员工”,则可将任何成员移出任何用户组。如果应用的通讯录权限范围不是“全部员工”,则仅可将通讯录权限范围中的成员从通讯录权限范围的用户组中移除, [点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 - *

请求体中的member_type,目前仅支持user, 未来将支持department。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/batch_remove ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchRemoveGroupMemberSample.java ; - */ - public BatchRemoveGroupMemberResp batchRemove(BatchRemoveGroupMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/group/:group_id/member/batch_remove" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchRemoveGroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchRemoveGroupMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id/member/batch_remove" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 移除用户组成员,从用户组中移除成员 (目前成员仅支持用户,未来会支持部门),如果应用的通讯录权限范围是“全部员工”,则可将任何成员移出任何用户组。如果应用的通讯录权限范围不是“全部员工”,则仅可将通讯录权限范围中的成员从通讯录权限范围的用户组中移除, [点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/remove ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/RemoveGroupMemberSample.java ; - */ - public RemoveGroupMemberResp remove(RemoveGroupMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/group/:group_id/member/remove" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RemoveGroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RemoveGroupMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id/member/remove" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 移除用户组成员,从用户组中移除成员 (目前成员仅支持用户,未来会支持部门),如果应用的通讯录权限范围是“全部员工”,则可将任何成员移出任何用户组。如果应用的通讯录权限范围不是“全部员工”,则仅可将通讯录权限范围中的成员从通讯录权限范围的用户组中移除, [点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/remove ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/RemoveGroupMemberSample.java ; - */ - public RemoveGroupMemberResp remove(RemoveGroupMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/group/:group_id/member/remove" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RemoveGroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RemoveGroupMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id/member/remove" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询用户组成员列表,通过该接口可查询某个用户组的成员列表(支持查询成员中的用户和部门), 本接口支持普通用户组和动态用户组。如果应用的通讯录权限范围是“全部员工”,则可查询企业内任何用户组的成员列表。如果应用的通讯录权限范围不是“全部员工”,则仅可查询通讯录权限范围中的用户组的成员列表,[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/simplelist ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/SimplelistGroupMemberSample.java ; - */ - public SimplelistGroupMemberResp simplelist(SimplelistGroupMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/group/:group_id/member/simplelist" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SimplelistGroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SimplelistGroupMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id/member/simplelist" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询用户组成员列表,通过该接口可查询某个用户组的成员列表(支持查询成员中的用户和部门), 本接口支持普通用户组和动态用户组。如果应用的通讯录权限范围是“全部员工”,则可查询企业内任何用户组的成员列表。如果应用的通讯录权限范围不是“全部员工”,则仅可查询通讯录权限范围中的用户组的成员列表,[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/simplelist ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/SimplelistGroupMemberSample.java ; - */ - public SimplelistGroupMemberResp simplelist(SimplelistGroupMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/group/:group_id/member/simplelist" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SimplelistGroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SimplelistGroupMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id/member/simplelist" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class JobFamily { - private final Config config; - - public JobFamily(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=contact&resource=job_family&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateJobFamilySample.java ; - */ - public CreateJobFamilyResp create(CreateJobFamilyReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/job_families" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobFamilyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_families" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=contact&resource=job_family&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateJobFamilySample.java ; - */ - public CreateJobFamilyResp create(CreateJobFamilyReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/job_families" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobFamilyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_families" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=contact&resource=job_family&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteJobFamilySample.java ; - */ - public DeleteJobFamilyResp delete(DeleteJobFamilyReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/contact/v3/job_families/:job_family_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobFamilyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_families/:job_family_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=contact&resource=job_family&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteJobFamilySample.java ; - */ - public DeleteJobFamilyResp delete(DeleteJobFamilyReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/contact/v3/job_families/:job_family_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobFamilyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_families/:job_family_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=job_family&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetJobFamilySample.java ; - */ - public GetJobFamilyResp get(GetJobFamilyReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/job_families/:job_family_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobFamilyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_families/:job_family_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=job_family&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetJobFamilySample.java ; - */ - public GetJobFamilyResp get(GetJobFamilyReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/job_families/:job_family_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobFamilyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_families/:job_family_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=job_family&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListJobFamilySample.java ; - */ - public ListJobFamilyResp list(ListJobFamilyReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/job_families" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobFamilyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_families" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=job_family&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListJobFamilySample.java ; - */ - public ListJobFamilyResp list(ListJobFamilyReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/job_families" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobFamilyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_families" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=contact&resource=job_family&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateJobFamilySample.java ; - */ - public UpdateJobFamilyResp update(UpdateJobFamilyReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/contact/v3/job_families/:job_family_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateJobFamilyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_families/:job_family_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=contact&resource=job_family&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateJobFamilySample.java ; - */ - public UpdateJobFamilyResp update(UpdateJobFamilyReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/contact/v3/job_families/:job_family_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateJobFamilyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_families/:job_family_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class JobLevel { - private final Config config; - - public JobLevel(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=contact&resource=job_level&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateJobLevelSample.java ; - */ - public CreateJobLevelResp create(CreateJobLevelReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/job_levels" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_levels" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=contact&resource=job_level&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateJobLevelSample.java ; - */ - public CreateJobLevelResp create(CreateJobLevelReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/job_levels" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_levels" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=contact&resource=job_level&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteJobLevelSample.java ; - */ - public DeleteJobLevelResp delete(DeleteJobLevelReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/contact/v3/job_levels/:job_level_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_levels/:job_level_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=contact&resource=job_level&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteJobLevelSample.java ; - */ - public DeleteJobLevelResp delete(DeleteJobLevelReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/contact/v3/job_levels/:job_level_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_levels/:job_level_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=job_level&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetJobLevelSample.java ; - */ - public GetJobLevelResp get(GetJobLevelReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/job_levels/:job_level_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_levels/:job_level_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=job_level&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetJobLevelSample.java ; - */ - public GetJobLevelResp get(GetJobLevelReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/job_levels/:job_level_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_levels/:job_level_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=job_level&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListJobLevelSample.java ; - */ - public ListJobLevelResp list(ListJobLevelReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/job_levels" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_levels" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=job_level&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListJobLevelSample.java ; - */ - public ListJobLevelResp list(ListJobLevelReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/job_levels" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_levels" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=contact&resource=job_level&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateJobLevelSample.java ; - */ - public UpdateJobLevelResp update(UpdateJobLevelReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/contact/v3/job_levels/:job_level_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateJobLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_levels/:job_level_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=contact&resource=job_level&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateJobLevelSample.java ; - */ - public UpdateJobLevelResp update(UpdateJobLevelReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/contact/v3/job_levels/:job_level_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateJobLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_levels/:job_level_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class JobTitle { - private final Config config; - - public JobTitle(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=job_title&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetJobTitleSample.java ; - */ - public GetJobTitleResp get(GetJobTitleReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/job_titles/:job_title_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetJobTitleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobTitleResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_titles/:job_title_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=job_title&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetJobTitleSample.java ; - */ - public GetJobTitleResp get(GetJobTitleReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/job_titles/:job_title_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetJobTitleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobTitleResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_titles/:job_title_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=job_title&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListJobTitleSample.java ; - */ - public ListJobTitleResp list(ListJobTitleReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/job_titles" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListJobTitleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobTitleResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_titles" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=job_title&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListJobTitleSample.java ; - */ - public ListJobTitleResp list(ListJobTitleReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/job_titles" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListJobTitleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobTitleResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_titles" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Scope { - private final Config config; - - public Scope(Config config) { - this.config = config; - } - - /** - * 获取通讯录授权范围,该接口用于获取应用被授权可访问的通讯录范围,包括可访问的部门列表、用户列表和用户组列表。;授权范围为全员时,返回的部门列表为该企业所有的一级部门;否则返回的部门为管理员在设置授权范围时勾选的部门(不包含勾选部门的子部门)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/scope/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListScopeSample.java ; - */ - public ListScopeResp list(ListScopeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/scopes" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListScopeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListScopeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/scopes" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取通讯录授权范围,该接口用于获取应用被授权可访问的通讯录范围,包括可访问的部门列表、用户列表和用户组列表。;授权范围为全员时,返回的部门列表为该企业所有的一级部门;否则返回的部门为管理员在设置授权范围时勾选的部门(不包含勾选部门的子部门)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/scope/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListScopeSample.java ; - */ - public ListScopeResp list(ListScopeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/scopes" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListScopeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListScopeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/scopes" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Unit { - private final Config config; - - public Unit(Config config) { - this.config = config; - } - - /** - * 建立部门与单位的绑定关系,通过该接口建立部门与单位的绑定关系。由于单位是旗舰版付费功能,企业需开通相关版本,否则会绑定失败,不同版本请参考[飞书版本对比](https://www.feishu.cn/service) - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/bind_department ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BindDepartmentUnitSample.java ; - */ - public BindDepartmentUnitResp bindDepartment(BindDepartmentUnitReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/unit/bind_department" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BindDepartmentUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BindDepartmentUnitResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit/bind_department" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 建立部门与单位的绑定关系,通过该接口建立部门与单位的绑定关系。由于单位是旗舰版付费功能,企业需开通相关版本,否则会绑定失败,不同版本请参考[飞书版本对比](https://www.feishu.cn/service) - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/bind_department ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BindDepartmentUnitSample.java ; - */ - public BindDepartmentUnitResp bindDepartment(BindDepartmentUnitReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/unit/bind_department" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BindDepartmentUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BindDepartmentUnitResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit/bind_department" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建单位,该接口用于创建单位。注意:单位功能属于旗舰版付费功能,企业需开通对应版本才可以创建单位,不同版本请参考[飞书版本对比](https://www.feishu.cn/service)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateUnitSample.java ; - */ - public CreateUnitResp create(CreateUnitReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/unit" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateUnitResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建单位,该接口用于创建单位。注意:单位功能属于旗舰版付费功能,企业需开通对应版本才可以创建单位,不同版本请参考[飞书版本对比](https://www.feishu.cn/service)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateUnitSample.java ; - */ - public CreateUnitResp create(CreateUnitReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/unit" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateUnitResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除单位,使用该接口删除单位,需要有更新单位的权限。注意:如果单位的单位类型被其它的业务使用,不允许删除。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteUnitSample.java ; - */ - public DeleteUnitResp delete(DeleteUnitReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/contact/v3/unit/:unit_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteUnitResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit/:unit_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除单位,使用该接口删除单位,需要有更新单位的权限。注意:如果单位的单位类型被其它的业务使用,不允许删除。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteUnitSample.java ; - */ - public DeleteUnitResp delete(DeleteUnitReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/contact/v3/unit/:unit_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteUnitResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit/:unit_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取单位信息,该接口用于获取单位信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetUnitSample.java ; - */ - public GetUnitResp get(GetUnitReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/unit/:unit_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetUnitResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit/:unit_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取单位信息,该接口用于获取单位信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetUnitSample.java ; - */ - public GetUnitResp get(GetUnitReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/unit/:unit_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetUnitResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit/:unit_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量获取单位列表,通过该接口获取企业的单位列表,需获取单位的权限 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListUnitSample.java ; - */ - public ListUnitResp list(ListUnitReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/unit" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListUnitResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量获取单位列表,通过该接口获取企业的单位列表,需获取单位的权限 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListUnitSample.java ; - */ - public ListUnitResp list(ListUnitReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/unit" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListUnitResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取单位绑定的部门列表,通过该接口获取单位绑定的部门列表,需具有获取单位的权限 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/list_department ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListDepartmentUnitSample.java ; - */ - public ListDepartmentUnitResp listDepartment(ListDepartmentUnitReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/unit/list_department" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListDepartmentUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDepartmentUnitResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit/list_department" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取单位绑定的部门列表,通过该接口获取单位绑定的部门列表,需具有获取单位的权限 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/list_department ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListDepartmentUnitSample.java ; - */ - public ListDepartmentUnitResp listDepartment(ListDepartmentUnitReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/unit/list_department" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListDepartmentUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDepartmentUnitResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit/list_department" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改单位信息,调用该接口,需要有更新单位的权限。注意:单位功能属于旗舰版付费功能,企业需开通对应版本才可以修改单位 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchUnitSample.java ; - */ - public PatchUnitResp patch(PatchUnitReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/contact/v3/unit/:unit_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchUnitResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit/:unit_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改单位信息,调用该接口,需要有更新单位的权限。注意:单位功能属于旗舰版付费功能,企业需开通对应版本才可以修改单位 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchUnitSample.java ; - */ - public PatchUnitResp patch(PatchUnitReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/contact/v3/unit/:unit_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchUnitResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit/:unit_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 解除部门与单位的绑定关系,通过该接口解除部门与单位的绑定关系,需更新单位的权限,需对应部门的通讯录权限。由于单位是旗舰版付费功能,企业需开通相关功能,否则会解绑失败 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/unbind_department ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UnbindDepartmentUnitSample.java ; - */ - public UnbindDepartmentUnitResp unbindDepartment(UnbindDepartmentUnitReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/unit/unbind_department" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UnbindDepartmentUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnbindDepartmentUnitResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit/unbind_department" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 解除部门与单位的绑定关系,通过该接口解除部门与单位的绑定关系,需更新单位的权限,需对应部门的通讯录权限。由于单位是旗舰版付费功能,企业需开通相关功能,否则会解绑失败 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/unbind_department ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UnbindDepartmentUnitSample.java ; - */ - public UnbindDepartmentUnitResp unbindDepartment(UnbindDepartmentUnitReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/unit/unbind_department" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UnbindDepartmentUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnbindDepartmentUnitResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit/unbind_department" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class User { - private final Config config; - - public User(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch&project=contact&resource=user&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchUserSample.java ; - */ - public BatchUserResp batch(BatchUserReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/users/batch" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - BatchUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/batch" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch&project=contact&resource=user&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchUserSample.java ; - */ - public BatchUserResp batch(BatchUserReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/users/batch" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - BatchUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/batch" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 通过手机号或邮箱获取用户 ID,通过该接口,可使用手机号/邮箱获取用户的 ID 信息,具体获取支持的 ID 类型包括 open_id、user_id、union_id,可通过查询参数指定。 - *

如果查询的手机号、邮箱不存在,或者无权限查看对应的用户,则返回的用户ID列表为空。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/batch_get_id ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchGetIdUserSample.java ; - */ - public BatchGetIdUserResp batchGetId(BatchGetIdUserReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/users/batch_get_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchGetIdUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetIdUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/batch_get_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 通过手机号或邮箱获取用户 ID,通过该接口,可使用手机号/邮箱获取用户的 ID 信息,具体获取支持的 ID 类型包括 open_id、user_id、union_id,可通过查询参数指定。 - *

如果查询的手机号、邮箱不存在,或者无权限查看对应的用户,则返回的用户ID列表为空。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/batch_get_id ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchGetIdUserSample.java ; - */ - public BatchGetIdUserResp batchGetId(BatchGetIdUserReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/users/batch_get_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchGetIdUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetIdUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/batch_get_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建用户,使用该接口向通讯录创建一个用户,可以理解为员工入职。创建用户后只返回有数据权限的数据。具体的数据权限的与字段的对应关系请参照[应用权限](https://open.feishu.cn/document/ukTMukTMukTM/uQjN3QjL0YzN04CN2cDN)。 - *

- 新增用户的所有部门必须都在当前应用的通讯录授权范围内才允许新增用户,如果想要在根部门下新增用户,必须要有全员权限。;- 应用商店应用无权限调用此接口。;- 创建用户后,会给用户发送邀请短信/邮件,用户在操作同意后才可访问团队。;- 返回数据中不返回手机号,如果需要请重新查询用户信息获取手机号。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateUserSample.java ; - */ - public CreateUserResp create(CreateUserReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/users" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建用户,使用该接口向通讯录创建一个用户,可以理解为员工入职。创建用户后只返回有数据权限的数据。具体的数据权限的与字段的对应关系请参照[应用权限](https://open.feishu.cn/document/ukTMukTMukTM/uQjN3QjL0YzN04CN2cDN)。 - *

- 新增用户的所有部门必须都在当前应用的通讯录授权范围内才允许新增用户,如果想要在根部门下新增用户,必须要有全员权限。;- 应用商店应用无权限调用此接口。;- 创建用户后,会给用户发送邀请短信/邮件,用户在操作同意后才可访问团队。;- 返回数据中不返回手机号,如果需要请重新查询用户信息获取手机号。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateUserSample.java ; - */ - public CreateUserResp create(CreateUserReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/users" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除用户,该接口用于从通讯录删除一个用户信息,可以理解为员工离职。 - *

- 若用户归属部门A、部门B,应用的通讯录权限范围必须包括部门A和部门B才可以删除用户。;- 用户可以在删除员工时设置删除员工数据(如文档)的接收者,如果不设置则由其leader接收,如果该员工没有leader,则会将该员工的数据删除。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteUserSample.java ; - */ - public DeleteUserResp delete(DeleteUserReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/contact/v3/users/:user_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/:user_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除用户,该接口用于从通讯录删除一个用户信息,可以理解为员工离职。 - *

- 若用户归属部门A、部门B,应用的通讯录权限范围必须包括部门A和部门B才可以删除用户。;- 用户可以在删除员工时设置删除员工数据(如文档)的接收者,如果不设置则由其leader接收,如果该员工没有leader,则会将该员工的数据删除。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteUserSample.java ; - */ - public DeleteUserResp delete(DeleteUserReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/contact/v3/users/:user_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/:user_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取部门直属用户列表,基于部门ID获取部门直属用户列表。 - *

- 部门ID 必填,根部门的部门ID为0。;- 使用 `user_access_token` 情况下根据个人组织架构的通讯录可见范围进行权限过滤,返回个人组织架构通讯录范围([登录企业管理后台进行权限配置](https://www.feishu.cn/admin/security/permission/visibility))内可见的用户数据。;- 使用`tenant_access_token`会根据应用通讯录的范围进行权限过滤。 如果请求的部门ID为0,则校验应用是否具有全员通讯录权限; 如果是非0的部门ID,则会验证应用是否具有该部门的通讯录权限。 无权限返回无权限错误码,有权限则返回对应部门下的直接用户列表。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/find_by_department ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/FindByDepartmentUserSample.java ; - */ - public FindByDepartmentUserResp findByDepartment(FindByDepartmentUserReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/users/find_by_department" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - FindByDepartmentUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, FindByDepartmentUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/find_by_department" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取部门直属用户列表,基于部门ID获取部门直属用户列表。 - *

- 部门ID 必填,根部门的部门ID为0。;- 使用 `user_access_token` 情况下根据个人组织架构的通讯录可见范围进行权限过滤,返回个人组织架构通讯录范围([登录企业管理后台进行权限配置](https://www.feishu.cn/admin/security/permission/visibility))内可见的用户数据。;- 使用`tenant_access_token`会根据应用通讯录的范围进行权限过滤。 如果请求的部门ID为0,则校验应用是否具有全员通讯录权限; 如果是非0的部门ID,则会验证应用是否具有该部门的通讯录权限。 无权限返回无权限错误码,有权限则返回对应部门下的直接用户列表。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/find_by_department ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/FindByDepartmentUserSample.java ; - */ - public FindByDepartmentUserResp findByDepartment(FindByDepartmentUserReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/users/find_by_department" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - FindByDepartmentUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, FindByDepartmentUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/find_by_department" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取单个用户信息,该接口用于获取通讯录中单个用户的信息。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetUserSample.java ; - */ - public GetUserResp get(GetUserReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/users/:user_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/:user_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取单个用户信息,该接口用于获取通讯录中单个用户的信息。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetUserSample.java ; - */ - public GetUserResp get(GetUserReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/users/:user_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/:user_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=user&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListUserSample.java ; - */ - public ListUserResp list(ListUserReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/users" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=user&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListUserSample.java ; - */ - public ListUserResp list(ListUserReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/users" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改用户部分信息,该接口用于更新通讯录中用户的字段,未传递的参数不会更新。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchUserSample.java ; - */ - public PatchUserResp patch(PatchUserReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/contact/v3/users/:user_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/:user_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改用户部分信息,该接口用于更新通讯录中用户的字段,未传递的参数不会更新。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchUserSample.java ; - */ - public PatchUserResp patch(PatchUserReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/contact/v3/users/:user_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/:user_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 恢复已删除用户,该接口用于恢复已删除用户(已离职的成员),仅自建应用可申请,应用商店应用无权调用接口。 - *

- 仅支持恢复离职 30 天内的成员。恢复后,部分用户数据仍不可恢复,请谨慎调用。;- 待恢复成员的用户 ID 不能被企业内其他成员使用。如有重复,请先离职对应的成员,否则接口会报错。;- 待恢复成员的手机号和邮箱不能被企业内其他成员使用。如有重复,请先修改对应成员的信息,否则接口会报错。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/resurrect ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ResurrectUserSample.java ; - */ - public ResurrectUserResp resurrect(ResurrectUserReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/users/:user_id/resurrect" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ResurrectUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ResurrectUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/:user_id/resurrect" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 恢复已删除用户,该接口用于恢复已删除用户(已离职的成员),仅自建应用可申请,应用商店应用无权调用接口。 - *

- 仅支持恢复离职 30 天内的成员。恢复后,部分用户数据仍不可恢复,请谨慎调用。;- 待恢复成员的用户 ID 不能被企业内其他成员使用。如有重复,请先离职对应的成员,否则接口会报错。;- 待恢复成员的手机号和邮箱不能被企业内其他成员使用。如有重复,请先修改对应成员的信息,否则接口会报错。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/resurrect ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ResurrectUserSample.java ; - */ - public ResurrectUserResp resurrect(ResurrectUserReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/contact/v3/users/:user_id/resurrect" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ResurrectUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ResurrectUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/:user_id/resurrect" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新用户所有信息,该接口用于更新通讯录中用户的字段。 - *

应用需要拥有待更新用户的通讯录授权,如果涉及到用户部门变更,还需要同时拥有变更前、后所有新部门的通讯录授权。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateUserSample.java ; - */ - public UpdateUserResp update(UpdateUserReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/contact/v3/users/:user_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/:user_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新用户所有信息,该接口用于更新通讯录中用户的字段。 - *

应用需要拥有待更新用户的通讯录授权,如果涉及到用户部门变更,还需要同时拥有变更前、后所有新部门的通讯录授权。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateUserSample.java ; - */ - public UpdateUserResp update(UpdateUserReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/contact/v3/users/:user_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/:user_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_user_id&project=contact&resource=user&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateUserIdUserSample.java ; - */ - public UpdateUserIdUserResp updateUserId(UpdateUserIdUserReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/contact/v3/users/:user_id/update_user_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateUserIdUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateUserIdUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/:user_id/update_user_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_user_id&project=contact&resource=user&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateUserIdUserSample.java ; - */ - public UpdateUserIdUserResp updateUserId(UpdateUserIdUserReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/contact/v3/users/:user_id/update_user_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateUserIdUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateUserIdUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/:user_id/update_user_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class WorkCity { - private final Config config; - - public WorkCity(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=work_city&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetWorkCitySample.java ; - */ - public GetWorkCityResp get(GetWorkCityReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/work_cities/:work_city_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetWorkCityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetWorkCityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/work_cities/:work_city_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=work_city&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetWorkCitySample.java ; - */ - public GetWorkCityResp get(GetWorkCityReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/work_cities/:work_city_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetWorkCityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetWorkCityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/work_cities/:work_city_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=work_city&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListWorkCitySample.java ; - */ - public ListWorkCityResp list(ListWorkCityReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/work_cities" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListWorkCityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListWorkCityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/work_cities" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=work_city&version=v3 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListWorkCitySample.java ; - */ - public ListWorkCityResp list(ListWorkCityReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/contact/v3/work_cities" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListWorkCityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListWorkCityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/work_cities" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public abstract static class P2CustomAttrEventUpdatedV3Handler implements IEventHandler { - @Override - public P2CustomAttrEventUpdatedV3 getEvent() { - return new P2CustomAttrEventUpdatedV3(); - } - } - - public abstract static class P2DepartmentCreatedV3Handler implements IEventHandler { - @Override - public P2DepartmentCreatedV3 getEvent() { - return new P2DepartmentCreatedV3(); - } - } - - public abstract static class P2DepartmentDeletedV3Handler implements IEventHandler { - @Override - public P2DepartmentDeletedV3 getEvent() { - return new P2DepartmentDeletedV3(); - } - } - - public abstract static class P2DepartmentUpdatedV3Handler implements IEventHandler { - @Override - public P2DepartmentUpdatedV3 getEvent() { - return new P2DepartmentUpdatedV3(); - } - } - - public abstract static class P2EmployeeTypeEnumActivedV3Handler implements IEventHandler { - @Override - public P2EmployeeTypeEnumActivedV3 getEvent() { - return new P2EmployeeTypeEnumActivedV3(); - } - } - - public abstract static class P2EmployeeTypeEnumCreatedV3Handler implements IEventHandler { - @Override - public P2EmployeeTypeEnumCreatedV3 getEvent() { - return new P2EmployeeTypeEnumCreatedV3(); - } - } - - public abstract static class P2EmployeeTypeEnumDeactivatedV3Handler implements IEventHandler { - @Override - public P2EmployeeTypeEnumDeactivatedV3 getEvent() { - return new P2EmployeeTypeEnumDeactivatedV3(); - } - } - - public abstract static class P2EmployeeTypeEnumDeletedV3Handler implements IEventHandler { - @Override - public P2EmployeeTypeEnumDeletedV3 getEvent() { - return new P2EmployeeTypeEnumDeletedV3(); - } - } - - public abstract static class P2EmployeeTypeEnumUpdatedV3Handler implements IEventHandler { - @Override - public P2EmployeeTypeEnumUpdatedV3 getEvent() { - return new P2EmployeeTypeEnumUpdatedV3(); - } - } - - public abstract static class P2ScopeUpdatedV3Handler implements IEventHandler { - @Override - public P2ScopeUpdatedV3 getEvent() { - return new P2ScopeUpdatedV3(); - } - } - - public abstract static class P2UserCreatedV3Handler implements IEventHandler { - @Override - public P2UserCreatedV3 getEvent() { - return new P2UserCreatedV3(); - } - } - - public abstract static class P2UserDeletedV3Handler implements IEventHandler { - @Override - public P2UserDeletedV3 getEvent() { - return new P2UserDeletedV3(); - } - } - - public abstract static class P2UserUpdatedV3Handler implements IEventHandler { - @Override - public P2UserUpdatedV3 getEvent() { - return new P2UserUpdatedV3(); - } - } - - public abstract static class P1UserChangedV3Handler implements IEventHandler { - @Override - public P1UserChangedV3 getEvent() { - return new P1UserChangedV3(); - } - } - - public abstract static class P1UserStatusChangedV3Handler implements IEventHandler { - @Override - public P1UserStatusChangedV3 getEvent() { - return new P1UserStatusChangedV3(); - } - } - - public abstract static class P1DepartmentChangedV3Handler implements IEventHandler { - @Override - public P1DepartmentChangedV3 getEvent() { - return new P1DepartmentChangedV3(); - } - } - - public abstract static class P1ContactScopeChangedV3Handler implements IEventHandler { - @Override - public P1ContactScopeChangedV3 getEvent() { - return new P1ContactScopeChangedV3(); - } - } -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/V3.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/V3.java new file mode 100644 index 000000000..dd626e5f6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/V3.java @@ -0,0 +1,113 @@ +// Code generated by lark suite 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 com.lark.oapi.service.contact.v3; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.contact.v3.resource.*; + +public class V3 { + private final CustomAttr customAttr; // 自定义用户字段 + private final CustomAttrEvent customAttrEvent; // 事件 + private final Department department; // 部门 + private final EmployeeTypeEnum employeeTypeEnum; // 人员类型 + private final FunctionalRole functionalRole; // functional_role + private final FunctionalRoleMember functionalRoleMember; // functional_role.member + private final Group group; // 用户组 + private final GroupMember groupMember; // 用户组成员 + private final JobFamily jobFamily; // job_family + private final JobLevel jobLevel; // job_level + private final JobTitle jobTitle; // job_title + private final Scope scope; // 通讯录权限范围 + private final Unit unit; // 单位 + private final User user; // 用户 + private final WorkCity workCity; // work_city + + public V3(Config config) { + this.customAttr = new CustomAttr(config); + this.customAttrEvent = new CustomAttrEvent(config); + this.department = new Department(config); + this.employeeTypeEnum = new EmployeeTypeEnum(config); + this.functionalRole = new FunctionalRole(config); + this.functionalRoleMember = new FunctionalRoleMember(config); + this.group = new Group(config); + this.groupMember = new GroupMember(config); + this.jobFamily = new JobFamily(config); + this.jobLevel = new JobLevel(config); + this.jobTitle = new JobTitle(config); + this.scope = new Scope(config); + this.unit = new Unit(config); + this.user = new User(config); + this.workCity = new WorkCity(config); + } + + public CustomAttr customAttr() { + return customAttr; + } + + public CustomAttrEvent customAttrEvent() { + return customAttrEvent; + } + + public Department department() { + return department; + } + + public EmployeeTypeEnum employeeTypeEnum() { + return employeeTypeEnum; + } + + public FunctionalRole functionalRole() { + return functionalRole; + } + + public FunctionalRoleMember functionalRoleMember() { + return functionalRoleMember; + } + + public Group group() { + return group; + } + + public GroupMember groupMember() { + return groupMember; + } + + public JobFamily jobFamily() { + return jobFamily; + } + + public JobLevel jobLevel() { + return jobLevel; + } + + public JobTitle jobTitle() { + return jobTitle; + } + + public Scope scope() { + return scope; + } + + public Unit unit() { + return unit; + } + + public User user() { + return user; + } + + public WorkCity workCity() { + return workCity; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/CustomAttr.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/CustomAttr.java new file mode 100644 index 000000000..f39dbcd09 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/CustomAttr.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.contact.v3.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.contact.v3.model.ListCustomAttrReq; +import com.lark.oapi.service.contact.v3.model.ListCustomAttrResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class CustomAttr { + private static final Logger log = LoggerFactory.getLogger(CustomAttr.class); + private final Config config; + + public CustomAttr(Config config) { + this.config = config; + } + + + /** + * 获取企业自定义用户字段,获取企业自定义的用户字段配置信息 + *

调用该接口前,需要先确认[企业管理员](https://www.feishu.cn/hc/zh-CN/articles/360049067822)在[企业管理后台 - 组织架构 - 成员字段管理](http://www.feishu.cn/admin/contacts/employee-field-new/custom) 自定义字段管理栏开启了“允许开放平台API调用“。;;![通讯录.gif](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/544738c94f13ef0b9ebaff53a5133cc7_E9EGMkXyzX.gif) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/custom_attr/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListCustomAttrSample.java ; + */ + public ListCustomAttrResp list(ListCustomAttrReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/custom_attrs" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListCustomAttrResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCustomAttrResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/custom_attrs" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取企业自定义用户字段,获取企业自定义的用户字段配置信息 + *

调用该接口前,需要先确认[企业管理员](https://www.feishu.cn/hc/zh-CN/articles/360049067822)在[企业管理后台 - 组织架构 - 成员字段管理](http://www.feishu.cn/admin/contacts/employee-field-new/custom) 自定义字段管理栏开启了“允许开放平台API调用“。;;![通讯录.gif](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/544738c94f13ef0b9ebaff53a5133cc7_E9EGMkXyzX.gif) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/custom_attr/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListCustomAttrSample.java ; + */ + public ListCustomAttrResp list(ListCustomAttrReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/custom_attrs" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListCustomAttrResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCustomAttrResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/custom_attrs" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/CustomAttrEvent.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/CustomAttrEvent.java new file mode 100644 index 000000000..e3a365fd1 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/CustomAttrEvent.java @@ -0,0 +1,29 @@ +// Code generated by lark suite 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 com.lark.oapi.service.contact.v3.resource; + +import com.lark.oapi.core.Config; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class CustomAttrEvent { + private static final Logger log = LoggerFactory.getLogger(CustomAttrEvent.class); + private final Config config; + + public CustomAttrEvent(Config config) { + this.config = config; + } + + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/Department.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/Department.java new file mode 100644 index 000000000..7af97b3e4 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/Department.java @@ -0,0 +1,846 @@ +// Code generated by lark suite 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 com.lark.oapi.service.contact.v3.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.contact.v3.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Department { + private static final Logger log = LoggerFactory.getLogger(Department.class); + private final Config config; + + public Department(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch&project=contact&resource=department&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchDepartmentSample.java ; + */ + public BatchDepartmentResp batch(BatchDepartmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/departments/batch" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + BatchDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/batch" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch&project=contact&resource=department&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchDepartmentSample.java ; + */ + public BatchDepartmentResp batch(BatchDepartmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/departments/batch" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + BatchDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/batch" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取子部门列表,通过部门ID获取部门的子部门列表。 + *

- 部门ID 必填,根部门的部门ID 为0。;- 使用 `user_access_token` 时,返回该用户组织架构可见性范围([登陆企业管理后台进行权限配置](https://www.feishu.cn/admin/security/permission/visibility))内的所有可见部门。当进行递归查询时,最多1000个部门对该用户可见。;;- 使用 ;`tenant_access_token` 则基于应用的通讯录权限范围进行权限校验与过滤。;如果部门ID为0,会检验应用是否有全员通讯录权限,如果是非0 部门ID,则会校验应用是否有该部门的通讯录权限。无部门权限返回无部门通讯录权限错误码,有权限则返回部门下子部门列表(根据fetch_child决定是否递归)。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/children ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ChildrenDepartmentSample.java ; + */ + public ChildrenDepartmentResp children(ChildrenDepartmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/departments/:department_id/children" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ChildrenDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ChildrenDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/:department_id/children" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取子部门列表,通过部门ID获取部门的子部门列表。 + *

- 部门ID 必填,根部门的部门ID 为0。;- 使用 `user_access_token` 时,返回该用户组织架构可见性范围([登陆企业管理后台进行权限配置](https://www.feishu.cn/admin/security/permission/visibility))内的所有可见部门。当进行递归查询时,最多1000个部门对该用户可见。;;- 使用 ;`tenant_access_token` 则基于应用的通讯录权限范围进行权限校验与过滤。;如果部门ID为0,会检验应用是否有全员通讯录权限,如果是非0 部门ID,则会校验应用是否有该部门的通讯录权限。无部门权限返回无部门通讯录权限错误码,有权限则返回部门下子部门列表(根据fetch_child决定是否递归)。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/children ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ChildrenDepartmentSample.java ; + */ + public ChildrenDepartmentResp children(ChildrenDepartmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/departments/:department_id/children" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ChildrenDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ChildrenDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/:department_id/children" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建部门,该接口用于向通讯录中创建部门。 + *

只可在应用的通讯录权限范围内的部门下创建部门。若需要在根部门下创建子部门,则应用通讯录权限范围需要设置为“全部成员”。应用商店应用无权限调用此接口。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateDepartmentSample.java ; + */ + public CreateDepartmentResp create(CreateDepartmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/departments" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建部门,该接口用于向通讯录中创建部门。 + *

只可在应用的通讯录权限范围内的部门下创建部门。若需要在根部门下创建子部门,则应用通讯录权限范围需要设置为“全部成员”。应用商店应用无权限调用此接口。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateDepartmentSample.java ; + */ + public CreateDepartmentResp create(CreateDepartmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/departments" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除部门,该接口用于从通讯录中删除部门。 + *

应用需要同时拥有待删除部门及其父部门的通讯录授权。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteDepartmentSample.java ; + */ + public DeleteDepartmentResp delete(DeleteDepartmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/contact/v3/departments/:department_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/:department_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除部门,该接口用于从通讯录中删除部门。 + *

应用需要同时拥有待删除部门及其父部门的通讯录授权。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteDepartmentSample.java ; + */ + public DeleteDepartmentResp delete(DeleteDepartmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/contact/v3/departments/:department_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/:department_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取单个部门信息,该接口用于向通讯录获取单个部门信息。 + *

- 使用`tenant_access_token`时,应用需要拥有待查询部门的通讯录授权。如果需要获取根部门信息,则需要拥有全员权限。;- 使用`user_access_token`时,用户需要有待查询部门的可见性,如果需要获取根部门信息,则要求员工可见所有人。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetDepartmentSample.java ; + */ + public GetDepartmentResp get(GetDepartmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/departments/:department_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/:department_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取单个部门信息,该接口用于向通讯录获取单个部门信息。 + *

- 使用`tenant_access_token`时,应用需要拥有待查询部门的通讯录授权。如果需要获取根部门信息,则需要拥有全员权限。;- 使用`user_access_token`时,用户需要有待查询部门的可见性,如果需要获取根部门信息,则要求员工可见所有人。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetDepartmentSample.java ; + */ + public GetDepartmentResp get(GetDepartmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/departments/:department_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/:department_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=department&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListDepartmentSample.java ; + */ + public ListDepartmentResp list(ListDepartmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/departments" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=department&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListDepartmentSample.java ; + */ + public ListDepartmentResp list(ListDepartmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/departments" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取父部门信息,该接口用来递归获取部门父部门的信息,并按照由子到父的顺序返回有权限的父部门信息列表。 + *

使用`tenant_access_token`时,该接口只返回可见性范围内的父部门信息。;例如:A >>B>>C>>D四级部门,通讯录权限只到B,那么查询D部门的parent,会返回B和C两级部门。;使用user_access_token时,该接口只返回对于用户可见的父部门信息。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/parent ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ParentDepartmentSample.java ; + */ + public ParentDepartmentResp parent(ParentDepartmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/departments/parent" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ParentDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ParentDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/parent" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取父部门信息,该接口用来递归获取部门父部门的信息,并按照由子到父的顺序返回有权限的父部门信息列表。 + *

使用`tenant_access_token`时,该接口只返回可见性范围内的父部门信息。;例如:A >>B>>C>>D四级部门,通讯录权限只到B,那么查询D部门的parent,会返回B和C两级部门。;使用user_access_token时,该接口只返回对于用户可见的父部门信息。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/parent ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ParentDepartmentSample.java ; + */ + public ParentDepartmentResp parent(ParentDepartmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/departments/parent" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ParentDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ParentDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/parent" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改部门部分信息,该接口用于更新通讯录中部门的信息。 + *

调用该接口需要具有该部门以及更新操作涉及的部门的通讯录权限。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchDepartmentSample.java ; + */ + public PatchDepartmentResp patch(PatchDepartmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/contact/v3/departments/:department_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/:department_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改部门部分信息,该接口用于更新通讯录中部门的信息。 + *

调用该接口需要具有该部门以及更新操作涉及的部门的通讯录权限。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchDepartmentSample.java ; + */ + public PatchDepartmentResp patch(PatchDepartmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/contact/v3/departments/:department_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/:department_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 搜索部门,搜索部门,用户通过关键词查询可见的部门数据,部门可见性需要管理员在后台配置。 + *

部门存在,但用户搜索不到并不一定是搜索有问题,可能是管理员在后台配置了权限控制,导致用户无法搜索到该部门。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/search ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/SearchDepartmentSample.java ; + */ + public SearchDepartmentResp search(SearchDepartmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/departments/search" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + SearchDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 搜索部门,搜索部门,用户通过关键词查询可见的部门数据,部门可见性需要管理员在后台配置。 + *

部门存在,但用户搜索不到并不一定是搜索有问题,可能是管理员在后台配置了权限控制,导致用户无法搜索到该部门。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/search ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/SearchDepartmentSample.java ; + */ + public SearchDepartmentResp search(SearchDepartmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/departments/search" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + SearchDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 部门群转为普通群,通过该接口将部门群转为普通群。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/unbind_department_chat ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UnbindDepartmentChatDepartmentSample.java ; + */ + public UnbindDepartmentChatDepartmentResp unbindDepartmentChat(UnbindDepartmentChatDepartmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/departments/unbind_department_chat" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UnbindDepartmentChatDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnbindDepartmentChatDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/unbind_department_chat" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 部门群转为普通群,通过该接口将部门群转为普通群。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/unbind_department_chat ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UnbindDepartmentChatDepartmentSample.java ; + */ + public UnbindDepartmentChatDepartmentResp unbindDepartmentChat(UnbindDepartmentChatDepartmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/departments/unbind_department_chat" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UnbindDepartmentChatDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnbindDepartmentChatDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/unbind_department_chat" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新部门所有信息,该接口用于更新当前部门所有信息。 + *

- 调用该接口需要具有该部门与更新部门信息涉及的通讯录权限。;; - 没有填写的字段会被置为空值(order字段除外)。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateDepartmentSample.java ; + */ + public UpdateDepartmentResp update(UpdateDepartmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/contact/v3/departments/:department_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/:department_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新部门所有信息,该接口用于更新当前部门所有信息。 + *

- 调用该接口需要具有该部门与更新部门信息涉及的通讯录权限。;; - 没有填写的字段会被置为空值(order字段除外)。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateDepartmentSample.java ; + */ + public UpdateDepartmentResp update(UpdateDepartmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/contact/v3/departments/:department_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/:department_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_department_id&project=contact&resource=department&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateDepartmentIdDepartmentSample.java ; + */ + public UpdateDepartmentIdDepartmentResp updateDepartmentId(UpdateDepartmentIdDepartmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/contact/v3/departments/:department_id/update_department_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateDepartmentIdDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateDepartmentIdDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/:department_id/update_department_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_department_id&project=contact&resource=department&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateDepartmentIdDepartmentSample.java ; + */ + public UpdateDepartmentIdDepartmentResp updateDepartmentId(UpdateDepartmentIdDepartmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/contact/v3/departments/:department_id/update_department_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateDepartmentIdDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateDepartmentIdDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/departments/:department_id/update_department_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/EmployeeTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/EmployeeTypeEnum.java new file mode 100644 index 000000000..53f08051a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/EmployeeTypeEnum.java @@ -0,0 +1,302 @@ +// Code generated by lark suite 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 com.lark.oapi.service.contact.v3.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.contact.v3.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class EmployeeTypeEnum { + private static final Logger log = LoggerFactory.getLogger(EmployeeTypeEnum.class); + private final Config config; + + public EmployeeTypeEnum(Config config) { + this.config = config; + } + + + /** + * 新增人员类型,新增自定义人员类型 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/employee_type_enum/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateEmployeeTypeEnumSample.java ; + */ + public CreateEmployeeTypeEnumResp create(CreateEmployeeTypeEnumReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/employee_type_enums" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateEmployeeTypeEnumResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEmployeeTypeEnumResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/employee_type_enums" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 新增人员类型,新增自定义人员类型 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/employee_type_enum/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateEmployeeTypeEnumSample.java ; + */ + public CreateEmployeeTypeEnumResp create(CreateEmployeeTypeEnumReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/employee_type_enums" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateEmployeeTypeEnumResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEmployeeTypeEnumResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/employee_type_enums" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除人员类型,删除自定义人员类型 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/employee_type_enum/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteEmployeeTypeEnumSample.java ; + */ + public DeleteEmployeeTypeEnumResp delete(DeleteEmployeeTypeEnumReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/contact/v3/employee_type_enums/:enum_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteEmployeeTypeEnumResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteEmployeeTypeEnumResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/employee_type_enums/:enum_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除人员类型,删除自定义人员类型 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/employee_type_enum/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteEmployeeTypeEnumSample.java ; + */ + public DeleteEmployeeTypeEnumResp delete(DeleteEmployeeTypeEnumReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/contact/v3/employee_type_enums/:enum_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteEmployeeTypeEnumResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteEmployeeTypeEnumResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/employee_type_enums/:enum_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询人员类型,该接口用于获取员工的人员类型 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/employee_type_enum/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListEmployeeTypeEnumSample.java ; + */ + public ListEmployeeTypeEnumResp list(ListEmployeeTypeEnumReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/employee_type_enums" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListEmployeeTypeEnumResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListEmployeeTypeEnumResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/employee_type_enums" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询人员类型,该接口用于获取员工的人员类型 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/employee_type_enum/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListEmployeeTypeEnumSample.java ; + */ + public ListEmployeeTypeEnumResp list(ListEmployeeTypeEnumReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/employee_type_enums" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListEmployeeTypeEnumResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListEmployeeTypeEnumResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/employee_type_enums" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新人员类型,更新自定义人员类型 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/employee_type_enum/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateEmployeeTypeEnumSample.java ; + */ + public UpdateEmployeeTypeEnumResp update(UpdateEmployeeTypeEnumReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/contact/v3/employee_type_enums/:enum_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateEmployeeTypeEnumResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateEmployeeTypeEnumResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/employee_type_enums/:enum_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新人员类型,更新自定义人员类型 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/employee_type_enum/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateEmployeeTypeEnumSample.java ; + */ + public UpdateEmployeeTypeEnumResp update(UpdateEmployeeTypeEnumReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/contact/v3/employee_type_enums/:enum_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateEmployeeTypeEnumResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateEmployeeTypeEnumResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/employee_type_enums/:enum_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/FunctionalRole.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/FunctionalRole.java new file mode 100644 index 000000000..b90aea777 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/FunctionalRole.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.contact.v3.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.contact.v3.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class FunctionalRole { + private static final Logger log = LoggerFactory.getLogger(FunctionalRole.class); + private final Config config; + + public FunctionalRole(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=contact&resource=functional_role&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateFunctionalRoleSample.java ; + */ + public CreateFunctionalRoleResp create(CreateFunctionalRoleReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/functional_roles" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateFunctionalRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFunctionalRoleResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=contact&resource=functional_role&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateFunctionalRoleSample.java ; + */ + public CreateFunctionalRoleResp create(CreateFunctionalRoleReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/functional_roles" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateFunctionalRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFunctionalRoleResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=contact&resource=functional_role&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteFunctionalRoleSample.java ; + */ + public DeleteFunctionalRoleResp delete(DeleteFunctionalRoleReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/contact/v3/functional_roles/:role_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteFunctionalRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteFunctionalRoleResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=contact&resource=functional_role&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteFunctionalRoleSample.java ; + */ + public DeleteFunctionalRoleResp delete(DeleteFunctionalRoleReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/contact/v3/functional_roles/:role_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteFunctionalRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteFunctionalRoleResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=contact&resource=functional_role&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateFunctionalRoleSample.java ; + */ + public UpdateFunctionalRoleResp update(UpdateFunctionalRoleReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/contact/v3/functional_roles/:role_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateFunctionalRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateFunctionalRoleResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=contact&resource=functional_role&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateFunctionalRoleSample.java ; + */ + public UpdateFunctionalRoleResp update(UpdateFunctionalRoleReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/contact/v3/functional_roles/:role_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateFunctionalRoleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateFunctionalRoleResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/FunctionalRoleMember.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/FunctionalRoleMember.java new file mode 100644 index 000000000..25477aaf8 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/FunctionalRoleMember.java @@ -0,0 +1,368 @@ +// Code generated by lark suite 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 com.lark.oapi.service.contact.v3.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.contact.v3.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class FunctionalRoleMember { + private static final Logger log = LoggerFactory.getLogger(FunctionalRoleMember.class); + private final Config config; + + public FunctionalRoleMember(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=contact&resource=functional_role.member&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchCreateFunctionalRoleMemberSample.java ; + */ + public BatchCreateFunctionalRoleMemberResp batchCreate(BatchCreateFunctionalRoleMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/functional_roles/:role_id/members/batch_create" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchCreateFunctionalRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateFunctionalRoleMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id/members/batch_create" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=contact&resource=functional_role.member&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchCreateFunctionalRoleMemberSample.java ; + */ + public BatchCreateFunctionalRoleMemberResp batchCreate(BatchCreateFunctionalRoleMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/functional_roles/:role_id/members/batch_create" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchCreateFunctionalRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateFunctionalRoleMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id/members/batch_create" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=contact&resource=functional_role.member&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchDeleteFunctionalRoleMemberSample.java ; + */ + public BatchDeleteFunctionalRoleMemberResp batchDelete(BatchDeleteFunctionalRoleMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/contact/v3/functional_roles/:role_id/members/batch_delete" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchDeleteFunctionalRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteFunctionalRoleMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id/members/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=contact&resource=functional_role.member&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchDeleteFunctionalRoleMemberSample.java ; + */ + public BatchDeleteFunctionalRoleMemberResp batchDelete(BatchDeleteFunctionalRoleMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/contact/v3/functional_roles/:role_id/members/batch_delete" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchDeleteFunctionalRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteFunctionalRoleMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id/members/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=functional_role.member&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetFunctionalRoleMemberSample.java ; + */ + public GetFunctionalRoleMemberResp get(GetFunctionalRoleMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/functional_roles/:role_id/members/:member_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetFunctionalRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFunctionalRoleMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id/members/:member_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=functional_role.member&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetFunctionalRoleMemberSample.java ; + */ + public GetFunctionalRoleMemberResp get(GetFunctionalRoleMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/functional_roles/:role_id/members/:member_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetFunctionalRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFunctionalRoleMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id/members/:member_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=functional_role.member&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListFunctionalRoleMemberSample.java ; + */ + public ListFunctionalRoleMemberResp list(ListFunctionalRoleMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/functional_roles/:role_id/members" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListFunctionalRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFunctionalRoleMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id/members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=functional_role.member&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListFunctionalRoleMemberSample.java ; + */ + public ListFunctionalRoleMemberResp list(ListFunctionalRoleMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/functional_roles/:role_id/members" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListFunctionalRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFunctionalRoleMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id/members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=scopes&project=contact&resource=functional_role.member&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ScopesFunctionalRoleMemberSample.java ; + */ + public ScopesFunctionalRoleMemberResp scopes(ScopesFunctionalRoleMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/contact/v3/functional_roles/:role_id/members/scopes" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ScopesFunctionalRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ScopesFunctionalRoleMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id/members/scopes" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=scopes&project=contact&resource=functional_role.member&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ScopesFunctionalRoleMemberSample.java ; + */ + public ScopesFunctionalRoleMemberResp scopes(ScopesFunctionalRoleMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/contact/v3/functional_roles/:role_id/members/scopes" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ScopesFunctionalRoleMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ScopesFunctionalRoleMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/functional_roles/:role_id/members/scopes" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/Group.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/Group.java new file mode 100644 index 000000000..7e6cb1a8f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/Group.java @@ -0,0 +1,434 @@ +// Code generated by lark suite 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 com.lark.oapi.service.contact.v3.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.contact.v3.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Group { + private static final Logger log = LoggerFactory.getLogger(Group.class); + private final Config config; + + public Group(Config config) { + this.config = config; + } + + + /** + * 创建用户组,使用该接口创建用户组,请注意创建用户组时应用的通讯录权限范围需为“全部员工”,否则会创建失败,[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateGroupSample.java ; + */ + public CreateGroupResp create(CreateGroupReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/group" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateGroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建用户组,使用该接口创建用户组,请注意创建用户组时应用的通讯录权限范围需为“全部员工”,否则会创建失败,[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateGroupSample.java ; + */ + public CreateGroupResp create(CreateGroupReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/group" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateGroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除用户组,通过该接口可删除企业中的用户组,请注意删除用户组时应用的通讯录权限范围需为“全部员工”,否则会删除失败,[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteGroupSample.java ; + */ + public DeleteGroupResp delete(DeleteGroupReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/contact/v3/group/:group_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteGroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除用户组,通过该接口可删除企业中的用户组,请注意删除用户组时应用的通讯录权限范围需为“全部员工”,否则会删除失败,[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteGroupSample.java ; + */ + public DeleteGroupResp delete(DeleteGroupReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/contact/v3/group/:group_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteGroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询用户组,根据用户组 ID 查询某个用户组的基本信息,支持查询普通用户组和动态用户组。请确保应用的通讯录权限范围里包括该用户组或者是“全部员工”,[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetGroupSample.java ; + */ + public GetGroupResp get(GetGroupReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/group/:group_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetGroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询用户组,根据用户组 ID 查询某个用户组的基本信息,支持查询普通用户组和动态用户组。请确保应用的通讯录权限范围里包括该用户组或者是“全部员工”,[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetGroupSample.java ; + */ + public GetGroupResp get(GetGroupReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/group/:group_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetGroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询用户所属用户组,通过该接口可查询该用户所属的用户组列表,可分别查询普通用户组和动态用户组。如果应用的通讯录权限范围是“全部员工”,则可获取该员工所属的全部用户组列表。如果应用的通讯录权限范围不是“全部员工”,则仅可获取通讯录权限范围内该员工所属的用户组。[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/member_belong ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/MemberBelongGroupSample.java ; + */ + public MemberBelongGroupResp memberBelong(MemberBelongGroupReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/group/member_belong" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + MemberBelongGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MemberBelongGroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/member_belong" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询用户所属用户组,通过该接口可查询该用户所属的用户组列表,可分别查询普通用户组和动态用户组。如果应用的通讯录权限范围是“全部员工”,则可获取该员工所属的全部用户组列表。如果应用的通讯录权限范围不是“全部员工”,则仅可获取通讯录权限范围内该员工所属的用户组。[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/member_belong ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/MemberBelongGroupSample.java ; + */ + public MemberBelongGroupResp memberBelong(MemberBelongGroupReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/group/member_belong" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + MemberBelongGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MemberBelongGroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/member_belong" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新用户组,使用该接口更新用户组信息,请注意更新用户组时应用的通讯录权限范围需为“全部员工”,否则会更新失败。[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchGroupSample.java ; + */ + public PatchGroupResp patch(PatchGroupReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/contact/v3/group/:group_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchGroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新用户组,使用该接口更新用户组信息,请注意更新用户组时应用的通讯录权限范围需为“全部员工”,否则会更新失败。[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchGroupSample.java ; + */ + public PatchGroupResp patch(PatchGroupReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/contact/v3/group/:group_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchGroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询用户组列表,通过该接口可查询企业的用户组列表,可分别查询普通用户组或动态用户组。如果应用的通讯录权限范围是“全部员工”,则可获取企业全部用户组列表。如果应用的通讯录权限范围不是“全部员工”,则仅可获取通讯录权限范围内的用户组。[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/simplelist ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/SimplelistGroupSample.java ; + */ + public SimplelistGroupResp simplelist(SimplelistGroupReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/group/simplelist" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SimplelistGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SimplelistGroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/simplelist" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询用户组列表,通过该接口可查询企业的用户组列表,可分别查询普通用户组或动态用户组。如果应用的通讯录权限范围是“全部员工”,则可获取企业全部用户组列表。如果应用的通讯录权限范围不是“全部员工”,则仅可获取通讯录权限范围内的用户组。[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/simplelist ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/SimplelistGroupSample.java ; + */ + public SimplelistGroupResp simplelist(SimplelistGroupReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/group/simplelist" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SimplelistGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SimplelistGroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/simplelist" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/GroupMember.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/GroupMember.java new file mode 100644 index 000000000..3c8cf074a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/GroupMember.java @@ -0,0 +1,372 @@ +// Code generated by lark suite 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 com.lark.oapi.service.contact.v3.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.contact.v3.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class GroupMember { + private static final Logger log = LoggerFactory.getLogger(GroupMember.class); + private final Config config; + + public GroupMember(Config config) { + this.config = config; + } + + + /** + * 添加用户组成员,向用户组中添加成员(目前成员仅支持用户,未来会支持部门),如果应用的通讯录权限范围是“全部员工”,则可将任何成员添加到任何用户组。如果应用的通讯录权限范围不是“全部员工”,则仅可将通讯录权限范围中的成员添加到通讯录权限范围的用户组中,[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/add ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/AddGroupMemberSample.java ; + */ + public AddGroupMemberResp add(AddGroupMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/group/:group_id/member/add" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + AddGroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddGroupMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id/member/add" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 添加用户组成员,向用户组中添加成员(目前成员仅支持用户,未来会支持部门),如果应用的通讯录权限范围是“全部员工”,则可将任何成员添加到任何用户组。如果应用的通讯录权限范围不是“全部员工”,则仅可将通讯录权限范围中的成员添加到通讯录权限范围的用户组中,[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/add ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/AddGroupMemberSample.java ; + */ + public AddGroupMemberResp add(AddGroupMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/group/:group_id/member/add" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + AddGroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddGroupMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id/member/add" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量添加用户组成员,向普通用户组中批量添加成员(目前仅支持添加用户,暂不支持添加部门),如果应用的通讯录权限范围是“全部员工”,则可将任何成员添加到任何用户组。如果应用的通讯录权限范围不是“全部员工”,则仅可将通讯录权限范围中的成员添加到通讯录权限范围的用户组中,[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 + *

请求体中的member_type,目前仅支持user, 未来将支持department。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/batch_add ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchAddGroupMemberSample.java ; + */ + public BatchAddGroupMemberResp batchAdd(BatchAddGroupMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/group/:group_id/member/batch_add" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchAddGroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchAddGroupMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id/member/batch_add" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量添加用户组成员,向普通用户组中批量添加成员(目前仅支持添加用户,暂不支持添加部门),如果应用的通讯录权限范围是“全部员工”,则可将任何成员添加到任何用户组。如果应用的通讯录权限范围不是“全部员工”,则仅可将通讯录权限范围中的成员添加到通讯录权限范围的用户组中,[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 + *

请求体中的member_type,目前仅支持user, 未来将支持department。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/batch_add ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchAddGroupMemberSample.java ; + */ + public BatchAddGroupMemberResp batchAdd(BatchAddGroupMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/group/:group_id/member/batch_add" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchAddGroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchAddGroupMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id/member/batch_add" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量移除用户组成员,从普通用户组中批量移除成员 (目前仅支持移除用户,暂不支持移除部门)。如果应用的通讯录权限范围是“全部员工”,则可将任何成员移出任何用户组。如果应用的通讯录权限范围不是“全部员工”,则仅可将通讯录权限范围中的成员从通讯录权限范围的用户组中移除, [点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 + *

请求体中的member_type,目前仅支持user, 未来将支持department。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/batch_remove ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchRemoveGroupMemberSample.java ; + */ + public BatchRemoveGroupMemberResp batchRemove(BatchRemoveGroupMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/group/:group_id/member/batch_remove" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchRemoveGroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchRemoveGroupMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id/member/batch_remove" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量移除用户组成员,从普通用户组中批量移除成员 (目前仅支持移除用户,暂不支持移除部门)。如果应用的通讯录权限范围是“全部员工”,则可将任何成员移出任何用户组。如果应用的通讯录权限范围不是“全部员工”,则仅可将通讯录权限范围中的成员从通讯录权限范围的用户组中移除, [点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 + *

请求体中的member_type,目前仅支持user, 未来将支持department。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/batch_remove ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchRemoveGroupMemberSample.java ; + */ + public BatchRemoveGroupMemberResp batchRemove(BatchRemoveGroupMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/group/:group_id/member/batch_remove" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchRemoveGroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchRemoveGroupMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id/member/batch_remove" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 移除用户组成员,从用户组中移除成员 (目前成员仅支持用户,未来会支持部门),如果应用的通讯录权限范围是“全部员工”,则可将任何成员移出任何用户组。如果应用的通讯录权限范围不是“全部员工”,则仅可将通讯录权限范围中的成员从通讯录权限范围的用户组中移除, [点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/remove ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/RemoveGroupMemberSample.java ; + */ + public RemoveGroupMemberResp remove(RemoveGroupMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/group/:group_id/member/remove" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RemoveGroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RemoveGroupMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id/member/remove" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 移除用户组成员,从用户组中移除成员 (目前成员仅支持用户,未来会支持部门),如果应用的通讯录权限范围是“全部员工”,则可将任何成员移出任何用户组。如果应用的通讯录权限范围不是“全部员工”,则仅可将通讯录权限范围中的成员从通讯录权限范围的用户组中移除, [点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/remove ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/RemoveGroupMemberSample.java ; + */ + public RemoveGroupMemberResp remove(RemoveGroupMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/group/:group_id/member/remove" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RemoveGroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RemoveGroupMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id/member/remove" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询用户组成员列表,通过该接口可查询某个用户组的成员列表(支持查询成员中的用户和部门), 本接口支持普通用户组和动态用户组。如果应用的通讯录权限范围是“全部员工”,则可查询企业内任何用户组的成员列表。如果应用的通讯录权限范围不是“全部员工”,则仅可查询通讯录权限范围中的用户组的成员列表,[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/simplelist ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/SimplelistGroupMemberSample.java ; + */ + public SimplelistGroupMemberResp simplelist(SimplelistGroupMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/group/:group_id/member/simplelist" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SimplelistGroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SimplelistGroupMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id/member/simplelist" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询用户组成员列表,通过该接口可查询某个用户组的成员列表(支持查询成员中的用户和部门), 本接口支持普通用户组和动态用户组。如果应用的通讯录权限范围是“全部员工”,则可查询企业内任何用户组的成员列表。如果应用的通讯录权限范围不是“全部员工”,则仅可查询通讯录权限范围中的用户组的成员列表,[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/simplelist ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/SimplelistGroupMemberSample.java ; + */ + public SimplelistGroupMemberResp simplelist(SimplelistGroupMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/group/:group_id/member/simplelist" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SimplelistGroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SimplelistGroupMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/group/:group_id/member/simplelist" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/JobFamily.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/JobFamily.java new file mode 100644 index 000000000..b8f0c12c5 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/JobFamily.java @@ -0,0 +1,368 @@ +// Code generated by lark suite 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 com.lark.oapi.service.contact.v3.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.contact.v3.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class JobFamily { + private static final Logger log = LoggerFactory.getLogger(JobFamily.class); + private final Config config; + + public JobFamily(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=contact&resource=job_family&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateJobFamilySample.java ; + */ + public CreateJobFamilyResp create(CreateJobFamilyReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/job_families" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobFamilyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_families" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=contact&resource=job_family&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateJobFamilySample.java ; + */ + public CreateJobFamilyResp create(CreateJobFamilyReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/job_families" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobFamilyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_families" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=contact&resource=job_family&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteJobFamilySample.java ; + */ + public DeleteJobFamilyResp delete(DeleteJobFamilyReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/contact/v3/job_families/:job_family_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobFamilyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_families/:job_family_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=contact&resource=job_family&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteJobFamilySample.java ; + */ + public DeleteJobFamilyResp delete(DeleteJobFamilyReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/contact/v3/job_families/:job_family_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobFamilyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_families/:job_family_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=job_family&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetJobFamilySample.java ; + */ + public GetJobFamilyResp get(GetJobFamilyReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/job_families/:job_family_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobFamilyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_families/:job_family_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=job_family&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetJobFamilySample.java ; + */ + public GetJobFamilyResp get(GetJobFamilyReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/job_families/:job_family_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobFamilyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_families/:job_family_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=job_family&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListJobFamilySample.java ; + */ + public ListJobFamilyResp list(ListJobFamilyReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/job_families" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobFamilyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_families" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=job_family&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListJobFamilySample.java ; + */ + public ListJobFamilyResp list(ListJobFamilyReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/job_families" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobFamilyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_families" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=contact&resource=job_family&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateJobFamilySample.java ; + */ + public UpdateJobFamilyResp update(UpdateJobFamilyReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/contact/v3/job_families/:job_family_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateJobFamilyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_families/:job_family_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=contact&resource=job_family&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateJobFamilySample.java ; + */ + public UpdateJobFamilyResp update(UpdateJobFamilyReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/contact/v3/job_families/:job_family_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateJobFamilyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_families/:job_family_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/JobLevel.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/JobLevel.java new file mode 100644 index 000000000..e7140719f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/JobLevel.java @@ -0,0 +1,368 @@ +// Code generated by lark suite 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 com.lark.oapi.service.contact.v3.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.contact.v3.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class JobLevel { + private static final Logger log = LoggerFactory.getLogger(JobLevel.class); + private final Config config; + + public JobLevel(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=contact&resource=job_level&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateJobLevelSample.java ; + */ + public CreateJobLevelResp create(CreateJobLevelReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/job_levels" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_levels" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=contact&resource=job_level&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateJobLevelSample.java ; + */ + public CreateJobLevelResp create(CreateJobLevelReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/job_levels" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_levels" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=contact&resource=job_level&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteJobLevelSample.java ; + */ + public DeleteJobLevelResp delete(DeleteJobLevelReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/contact/v3/job_levels/:job_level_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_levels/:job_level_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=contact&resource=job_level&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteJobLevelSample.java ; + */ + public DeleteJobLevelResp delete(DeleteJobLevelReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/contact/v3/job_levels/:job_level_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_levels/:job_level_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=job_level&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetJobLevelSample.java ; + */ + public GetJobLevelResp get(GetJobLevelReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/job_levels/:job_level_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_levels/:job_level_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=job_level&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetJobLevelSample.java ; + */ + public GetJobLevelResp get(GetJobLevelReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/job_levels/:job_level_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_levels/:job_level_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=job_level&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListJobLevelSample.java ; + */ + public ListJobLevelResp list(ListJobLevelReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/job_levels" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_levels" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=job_level&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListJobLevelSample.java ; + */ + public ListJobLevelResp list(ListJobLevelReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/job_levels" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_levels" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=contact&resource=job_level&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateJobLevelSample.java ; + */ + public UpdateJobLevelResp update(UpdateJobLevelReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/contact/v3/job_levels/:job_level_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateJobLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_levels/:job_level_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=contact&resource=job_level&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateJobLevelSample.java ; + */ + public UpdateJobLevelResp update(UpdateJobLevelReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/contact/v3/job_levels/:job_level_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateJobLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_levels/:job_level_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/JobTitle.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/JobTitle.java new file mode 100644 index 000000000..3c63ba7e4 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/JobTitle.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.contact.v3.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.contact.v3.model.GetJobTitleReq; +import com.lark.oapi.service.contact.v3.model.GetJobTitleResp; +import com.lark.oapi.service.contact.v3.model.ListJobTitleReq; +import com.lark.oapi.service.contact.v3.model.ListJobTitleResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class JobTitle { + private static final Logger log = LoggerFactory.getLogger(JobTitle.class); + private final Config config; + + public JobTitle(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=job_title&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetJobTitleSample.java ; + */ + public GetJobTitleResp get(GetJobTitleReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/job_titles/:job_title_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetJobTitleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobTitleResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_titles/:job_title_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=job_title&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetJobTitleSample.java ; + */ + public GetJobTitleResp get(GetJobTitleReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/job_titles/:job_title_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetJobTitleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobTitleResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_titles/:job_title_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=job_title&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListJobTitleSample.java ; + */ + public ListJobTitleResp list(ListJobTitleReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/job_titles" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListJobTitleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobTitleResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_titles" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=job_title&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListJobTitleSample.java ; + */ + public ListJobTitleResp list(ListJobTitleReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/job_titles" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListJobTitleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobTitleResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/job_titles" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/Scope.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/Scope.java new file mode 100644 index 000000000..193adf52b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/Scope.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.contact.v3.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.contact.v3.model.ListScopeReq; +import com.lark.oapi.service.contact.v3.model.ListScopeResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Scope { + private static final Logger log = LoggerFactory.getLogger(Scope.class); + private final Config config; + + public Scope(Config config) { + this.config = config; + } + + + /** + * 获取通讯录授权范围,该接口用于获取应用被授权可访问的通讯录范围,包括可访问的部门列表、用户列表和用户组列表。;授权范围为全员时,返回的部门列表为该企业所有的一级部门;否则返回的部门为管理员在设置授权范围时勾选的部门(不包含勾选部门的子部门)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/scope/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListScopeSample.java ; + */ + public ListScopeResp list(ListScopeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/scopes" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListScopeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListScopeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/scopes" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取通讯录授权范围,该接口用于获取应用被授权可访问的通讯录范围,包括可访问的部门列表、用户列表和用户组列表。;授权范围为全员时,返回的部门列表为该企业所有的一级部门;否则返回的部门为管理员在设置授权范围时勾选的部门(不包含勾选部门的子部门)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/scope/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListScopeSample.java ; + */ + public ListScopeResp list(ListScopeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/scopes" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListScopeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListScopeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/scopes" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/Unit.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/Unit.java new file mode 100644 index 000000000..c7c77b50d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/Unit.java @@ -0,0 +1,566 @@ +// Code generated by lark suite 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 com.lark.oapi.service.contact.v3.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.contact.v3.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Unit { + private static final Logger log = LoggerFactory.getLogger(Unit.class); + private final Config config; + + public Unit(Config config) { + this.config = config; + } + + + /** + * 建立部门与单位的绑定关系,通过该接口建立部门与单位的绑定关系。由于单位是旗舰版付费功能,企业需开通相关版本,否则会绑定失败,不同版本请参考[飞书版本对比](https://www.feishu.cn/service) + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/bind_department ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BindDepartmentUnitSample.java ; + */ + public BindDepartmentUnitResp bindDepartment(BindDepartmentUnitReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/unit/bind_department" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BindDepartmentUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BindDepartmentUnitResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit/bind_department" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 建立部门与单位的绑定关系,通过该接口建立部门与单位的绑定关系。由于单位是旗舰版付费功能,企业需开通相关版本,否则会绑定失败,不同版本请参考[飞书版本对比](https://www.feishu.cn/service) + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/bind_department ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BindDepartmentUnitSample.java ; + */ + public BindDepartmentUnitResp bindDepartment(BindDepartmentUnitReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/unit/bind_department" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BindDepartmentUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BindDepartmentUnitResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit/bind_department" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建单位,该接口用于创建单位。注意:单位功能属于旗舰版付费功能,企业需开通对应版本才可以创建单位,不同版本请参考[飞书版本对比](https://www.feishu.cn/service)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateUnitSample.java ; + */ + public CreateUnitResp create(CreateUnitReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/unit" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateUnitResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建单位,该接口用于创建单位。注意:单位功能属于旗舰版付费功能,企业需开通对应版本才可以创建单位,不同版本请参考[飞书版本对比](https://www.feishu.cn/service)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateUnitSample.java ; + */ + public CreateUnitResp create(CreateUnitReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/unit" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateUnitResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除单位,使用该接口删除单位,需要有更新单位的权限。注意:如果单位的单位类型被其它的业务使用,不允许删除。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteUnitSample.java ; + */ + public DeleteUnitResp delete(DeleteUnitReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/contact/v3/unit/:unit_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteUnitResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit/:unit_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除单位,使用该接口删除单位,需要有更新单位的权限。注意:如果单位的单位类型被其它的业务使用,不允许删除。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteUnitSample.java ; + */ + public DeleteUnitResp delete(DeleteUnitReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/contact/v3/unit/:unit_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteUnitResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit/:unit_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取单位信息,该接口用于获取单位信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetUnitSample.java ; + */ + public GetUnitResp get(GetUnitReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/unit/:unit_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetUnitResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit/:unit_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取单位信息,该接口用于获取单位信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetUnitSample.java ; + */ + public GetUnitResp get(GetUnitReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/unit/:unit_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetUnitResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit/:unit_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量获取单位列表,通过该接口获取企业的单位列表,需获取单位的权限 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListUnitSample.java ; + */ + public ListUnitResp list(ListUnitReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/unit" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListUnitResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量获取单位列表,通过该接口获取企业的单位列表,需获取单位的权限 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListUnitSample.java ; + */ + public ListUnitResp list(ListUnitReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/unit" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListUnitResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取单位绑定的部门列表,通过该接口获取单位绑定的部门列表,需具有获取单位的权限 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/list_department ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListDepartmentUnitSample.java ; + */ + public ListDepartmentUnitResp listDepartment(ListDepartmentUnitReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/unit/list_department" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListDepartmentUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDepartmentUnitResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit/list_department" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取单位绑定的部门列表,通过该接口获取单位绑定的部门列表,需具有获取单位的权限 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/list_department ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListDepartmentUnitSample.java ; + */ + public ListDepartmentUnitResp listDepartment(ListDepartmentUnitReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/unit/list_department" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListDepartmentUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDepartmentUnitResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit/list_department" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改单位信息,调用该接口,需要有更新单位的权限。注意:单位功能属于旗舰版付费功能,企业需开通对应版本才可以修改单位 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchUnitSample.java ; + */ + public PatchUnitResp patch(PatchUnitReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/contact/v3/unit/:unit_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchUnitResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit/:unit_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改单位信息,调用该接口,需要有更新单位的权限。注意:单位功能属于旗舰版付费功能,企业需开通对应版本才可以修改单位 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchUnitSample.java ; + */ + public PatchUnitResp patch(PatchUnitReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/contact/v3/unit/:unit_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchUnitResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit/:unit_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 解除部门与单位的绑定关系,通过该接口解除部门与单位的绑定关系,需更新单位的权限,需对应部门的通讯录权限。由于单位是旗舰版付费功能,企业需开通相关功能,否则会解绑失败 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/unbind_department ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UnbindDepartmentUnitSample.java ; + */ + public UnbindDepartmentUnitResp unbindDepartment(UnbindDepartmentUnitReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/unit/unbind_department" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UnbindDepartmentUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnbindDepartmentUnitResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit/unbind_department" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 解除部门与单位的绑定关系,通过该接口解除部门与单位的绑定关系,需更新单位的权限,需对应部门的通讯录权限。由于单位是旗舰版付费功能,企业需开通相关功能,否则会解绑失败 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/unbind_department ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UnbindDepartmentUnitSample.java ; + */ + public UnbindDepartmentUnitResp unbindDepartment(UnbindDepartmentUnitReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/unit/unbind_department" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UnbindDepartmentUnitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnbindDepartmentUnitResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/unit/unbind_department" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/User.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/User.java new file mode 100644 index 000000000..76cb5d3f8 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/User.java @@ -0,0 +1,776 @@ +// Code generated by lark suite 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 com.lark.oapi.service.contact.v3.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.contact.v3.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class User { + private static final Logger log = LoggerFactory.getLogger(User.class); + private final Config config; + + public User(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch&project=contact&resource=user&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchUserSample.java ; + */ + public BatchUserResp batch(BatchUserReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/users/batch" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + BatchUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/batch" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch&project=contact&resource=user&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchUserSample.java ; + */ + public BatchUserResp batch(BatchUserReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/users/batch" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + BatchUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/batch" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 通过手机号或邮箱获取用户 ID,通过该接口,可使用手机号/邮箱获取用户的 ID 信息,具体获取支持的 ID 类型包括 open_id、user_id、union_id,可通过查询参数指定。 + *

如果查询的手机号、邮箱不存在,或者无权限查看对应的用户,则返回的用户ID列表为空。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/batch_get_id ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchGetIdUserSample.java ; + */ + public BatchGetIdUserResp batchGetId(BatchGetIdUserReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/users/batch_get_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchGetIdUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetIdUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/batch_get_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 通过手机号或邮箱获取用户 ID,通过该接口,可使用手机号/邮箱获取用户的 ID 信息,具体获取支持的 ID 类型包括 open_id、user_id、union_id,可通过查询参数指定。 + *

如果查询的手机号、邮箱不存在,或者无权限查看对应的用户,则返回的用户ID列表为空。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/batch_get_id ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchGetIdUserSample.java ; + */ + public BatchGetIdUserResp batchGetId(BatchGetIdUserReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/users/batch_get_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchGetIdUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetIdUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/batch_get_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建用户,使用该接口向通讯录创建一个用户,可以理解为员工入职。创建用户后只返回有数据权限的数据。具体的数据权限的与字段的对应关系请参照[应用权限](https://open.feishu.cn/document/ukTMukTMukTM/uQjN3QjL0YzN04CN2cDN)。 + *

- 新增用户的所有部门必须都在当前应用的通讯录授权范围内才允许新增用户,如果想要在根部门下新增用户,必须要有全员权限。;- 应用商店应用无权限调用此接口。;- 创建用户后,会给用户发送邀请短信/邮件,用户在操作同意后才可访问团队。;- 返回数据中不返回手机号,如果需要请重新查询用户信息获取手机号。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateUserSample.java ; + */ + public CreateUserResp create(CreateUserReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/users" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建用户,使用该接口向通讯录创建一个用户,可以理解为员工入职。创建用户后只返回有数据权限的数据。具体的数据权限的与字段的对应关系请参照[应用权限](https://open.feishu.cn/document/ukTMukTMukTM/uQjN3QjL0YzN04CN2cDN)。 + *

- 新增用户的所有部门必须都在当前应用的通讯录授权范围内才允许新增用户,如果想要在根部门下新增用户,必须要有全员权限。;- 应用商店应用无权限调用此接口。;- 创建用户后,会给用户发送邀请短信/邮件,用户在操作同意后才可访问团队。;- 返回数据中不返回手机号,如果需要请重新查询用户信息获取手机号。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateUserSample.java ; + */ + public CreateUserResp create(CreateUserReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/users" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除用户,该接口用于从通讯录删除一个用户信息,可以理解为员工离职。 + *

- 若用户归属部门A、部门B,应用的通讯录权限范围必须包括部门A和部门B才可以删除用户。;- 用户可以在删除员工时设置删除员工数据(如文档)的接收者,如果不设置则由其leader接收,如果该员工没有leader,则会将该员工的数据删除。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteUserSample.java ; + */ + public DeleteUserResp delete(DeleteUserReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/contact/v3/users/:user_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/:user_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除用户,该接口用于从通讯录删除一个用户信息,可以理解为员工离职。 + *

- 若用户归属部门A、部门B,应用的通讯录权限范围必须包括部门A和部门B才可以删除用户。;- 用户可以在删除员工时设置删除员工数据(如文档)的接收者,如果不设置则由其leader接收,如果该员工没有leader,则会将该员工的数据删除。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteUserSample.java ; + */ + public DeleteUserResp delete(DeleteUserReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/contact/v3/users/:user_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/:user_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取部门直属用户列表,基于部门ID获取部门直属用户列表。 + *

- 部门ID 必填,根部门的部门ID为0。;- 使用 `user_access_token` 情况下根据个人组织架构的通讯录可见范围进行权限过滤,返回个人组织架构通讯录范围([登录企业管理后台进行权限配置](https://www.feishu.cn/admin/security/permission/visibility))内可见的用户数据。;- 使用`tenant_access_token`会根据应用通讯录的范围进行权限过滤。 如果请求的部门ID为0,则校验应用是否具有全员通讯录权限; 如果是非0的部门ID,则会验证应用是否具有该部门的通讯录权限。 无权限返回无权限错误码,有权限则返回对应部门下的直接用户列表。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/find_by_department ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/FindByDepartmentUserSample.java ; + */ + public FindByDepartmentUserResp findByDepartment(FindByDepartmentUserReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/users/find_by_department" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + FindByDepartmentUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, FindByDepartmentUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/find_by_department" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取部门直属用户列表,基于部门ID获取部门直属用户列表。 + *

- 部门ID 必填,根部门的部门ID为0。;- 使用 `user_access_token` 情况下根据个人组织架构的通讯录可见范围进行权限过滤,返回个人组织架构通讯录范围([登录企业管理后台进行权限配置](https://www.feishu.cn/admin/security/permission/visibility))内可见的用户数据。;- 使用`tenant_access_token`会根据应用通讯录的范围进行权限过滤。 如果请求的部门ID为0,则校验应用是否具有全员通讯录权限; 如果是非0的部门ID,则会验证应用是否具有该部门的通讯录权限。 无权限返回无权限错误码,有权限则返回对应部门下的直接用户列表。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/find_by_department ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/FindByDepartmentUserSample.java ; + */ + public FindByDepartmentUserResp findByDepartment(FindByDepartmentUserReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/users/find_by_department" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + FindByDepartmentUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, FindByDepartmentUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/find_by_department" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取单个用户信息,该接口用于获取通讯录中单个用户的信息。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetUserSample.java ; + */ + public GetUserResp get(GetUserReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/users/:user_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/:user_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取单个用户信息,该接口用于获取通讯录中单个用户的信息。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetUserSample.java ; + */ + public GetUserResp get(GetUserReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/users/:user_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/:user_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=user&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListUserSample.java ; + */ + public ListUserResp list(ListUserReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/users" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=user&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListUserSample.java ; + */ + public ListUserResp list(ListUserReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/users" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改用户部分信息,该接口用于更新通讯录中用户的字段,未传递的参数不会更新。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchUserSample.java ; + */ + public PatchUserResp patch(PatchUserReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/contact/v3/users/:user_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/:user_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改用户部分信息,该接口用于更新通讯录中用户的字段,未传递的参数不会更新。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchUserSample.java ; + */ + public PatchUserResp patch(PatchUserReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/contact/v3/users/:user_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/:user_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 恢复已删除用户,该接口用于恢复已删除用户(已离职的成员),仅自建应用可申请,应用商店应用无权调用接口。 + *

- 仅支持恢复离职 30 天内的成员。恢复后,部分用户数据仍不可恢复,请谨慎调用。;- 待恢复成员的用户 ID 不能被企业内其他成员使用。如有重复,请先离职对应的成员,否则接口会报错。;- 待恢复成员的手机号和邮箱不能被企业内其他成员使用。如有重复,请先修改对应成员的信息,否则接口会报错。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/resurrect ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ResurrectUserSample.java ; + */ + public ResurrectUserResp resurrect(ResurrectUserReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/users/:user_id/resurrect" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ResurrectUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ResurrectUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/:user_id/resurrect" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 恢复已删除用户,该接口用于恢复已删除用户(已离职的成员),仅自建应用可申请,应用商店应用无权调用接口。 + *

- 仅支持恢复离职 30 天内的成员。恢复后,部分用户数据仍不可恢复,请谨慎调用。;- 待恢复成员的用户 ID 不能被企业内其他成员使用。如有重复,请先离职对应的成员,否则接口会报错。;- 待恢复成员的手机号和邮箱不能被企业内其他成员使用。如有重复,请先修改对应成员的信息,否则接口会报错。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/resurrect ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ResurrectUserSample.java ; + */ + public ResurrectUserResp resurrect(ResurrectUserReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/contact/v3/users/:user_id/resurrect" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ResurrectUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ResurrectUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/:user_id/resurrect" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新用户所有信息,该接口用于更新通讯录中用户的字段。 + *

应用需要拥有待更新用户的通讯录授权,如果涉及到用户部门变更,还需要同时拥有变更前、后所有新部门的通讯录授权。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateUserSample.java ; + */ + public UpdateUserResp update(UpdateUserReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/contact/v3/users/:user_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/:user_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新用户所有信息,该接口用于更新通讯录中用户的字段。 + *

应用需要拥有待更新用户的通讯录授权,如果涉及到用户部门变更,还需要同时拥有变更前、后所有新部门的通讯录授权。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateUserSample.java ; + */ + public UpdateUserResp update(UpdateUserReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/contact/v3/users/:user_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/:user_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_user_id&project=contact&resource=user&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateUserIdUserSample.java ; + */ + public UpdateUserIdUserResp updateUserId(UpdateUserIdUserReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/contact/v3/users/:user_id/update_user_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateUserIdUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateUserIdUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/:user_id/update_user_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_user_id&project=contact&resource=user&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateUserIdUserSample.java ; + */ + public UpdateUserIdUserResp updateUserId(UpdateUserIdUserReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/contact/v3/users/:user_id/update_user_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateUserIdUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateUserIdUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/users/:user_id/update_user_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/WorkCity.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/WorkCity.java new file mode 100644 index 000000000..aec641819 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/contact/v3/resource/WorkCity.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.contact.v3.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.contact.v3.model.GetWorkCityReq; +import com.lark.oapi.service.contact.v3.model.GetWorkCityResp; +import com.lark.oapi.service.contact.v3.model.ListWorkCityReq; +import com.lark.oapi.service.contact.v3.model.ListWorkCityResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class WorkCity { + private static final Logger log = LoggerFactory.getLogger(WorkCity.class); + private final Config config; + + public WorkCity(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=work_city&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetWorkCitySample.java ; + */ + public GetWorkCityResp get(GetWorkCityReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/work_cities/:work_city_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetWorkCityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetWorkCityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/work_cities/:work_city_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=work_city&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetWorkCitySample.java ; + */ + public GetWorkCityResp get(GetWorkCityReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/work_cities/:work_city_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetWorkCityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetWorkCityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/work_cities/:work_city_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=work_city&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListWorkCitySample.java ; + */ + public ListWorkCityResp list(ListWorkCityReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/work_cities" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListWorkCityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListWorkCityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/work_cities" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=work_city&version=v3 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListWorkCitySample.java ; + */ + public ListWorkCityResp list(ListWorkCityReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/contact/v3/work_cities" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListWorkCityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListWorkCityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/contact/v3/work_cities" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/CorehrService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/CorehrService.java new file mode 100644 index 000000000..ec6a0f26c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/CorehrService.java @@ -0,0 +1,443 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr; + +import com.lark.oapi.core.Config; +import com.lark.oapi.event.IEventHandler; +import com.lark.oapi.service.corehr.v1.V1; +import com.lark.oapi.service.corehr.v1.model.*; +import com.lark.oapi.service.corehr.v1.resource.Company; +import com.lark.oapi.service.corehr.v1.resource.Contract; +import com.lark.oapi.service.corehr.v1.resource.CountryRegion; +import com.lark.oapi.service.corehr.v1.resource.Currency; +import com.lark.oapi.service.corehr.v1.resource.CustomField; +import com.lark.oapi.service.corehr.v1.resource.Department; +import com.lark.oapi.service.corehr.v1.resource.EmployeeType; +import com.lark.oapi.service.corehr.v1.resource.Employment; +import com.lark.oapi.service.corehr.v1.resource.File; +import com.lark.oapi.service.corehr.v1.resource.Job; +import com.lark.oapi.service.corehr.v1.resource.JobChange; +import com.lark.oapi.service.corehr.v1.resource.JobData; +import com.lark.oapi.service.corehr.v1.resource.JobFamily; +import com.lark.oapi.service.corehr.v1.resource.JobLevel; +import com.lark.oapi.service.corehr.v1.resource.LeaveGrantingRecord; +import com.lark.oapi.service.corehr.v1.resource.Location; +import com.lark.oapi.service.corehr.v1.resource.NationalIdType; +import com.lark.oapi.service.corehr.v1.resource.Offboarding; +import com.lark.oapi.service.corehr.v1.resource.Person; +import com.lark.oapi.service.corehr.v1.resource.PreHire; +import com.lark.oapi.service.corehr.v1.resource.SecurityGroup; +import com.lark.oapi.service.corehr.v1.resource.Subdivision; +import com.lark.oapi.service.corehr.v1.resource.Subregion; +import com.lark.oapi.service.corehr.v1.resource.TransferReason; +import com.lark.oapi.service.corehr.v1.resource.TransferType; +import com.lark.oapi.service.corehr.v1.resource.WorkingHoursType; +import com.lark.oapi.service.corehr.v1.resource.*; +import com.lark.oapi.service.corehr.v2.V2; +import com.lark.oapi.service.corehr.v2.model.P2ProbationUpdatedV2; +import com.lark.oapi.service.corehr.v2.model.P2ProcessApproverUpdatedV2; +import com.lark.oapi.service.corehr.v2.model.P2ProcessCcUpdatedV2; +import com.lark.oapi.service.corehr.v2.model.P2ProcessUpdatedV2; + +public class CorehrService { + private final V1 v1; + private final AssignedUser assignedUser; // assigned_user + private final Company company; // 公司 + private final CompensationStandard compensationStandard; // compensation_standard + private final Contract contract; // 合同 + private final CountryRegion countryRegion; // 地理库信息 + private final Currency currency; // 货币信息 + private final CustomField customField; // 自定义字段 + private final Department department; // 部门 + private final EmployeeType employeeType; // 人员类型 + private final Employment employment; // 雇佣信息 + private final File file; // file + private final Job job; // 职务 + private final JobChange jobChange; // 异动信息 + private final JobData jobData; // 任职信息 + private final JobFamily jobFamily; // 职务序列 + private final JobLevel jobLevel; // 职务级别 + private final Leave leave; // 休假管理 + private final LeaveGrantingRecord leaveGrantingRecord; // leave_granting_record + private final Location location; // 地点 + private final NationalIdType nationalIdType; // 国家证件类型 + private final Offboarding offboarding; // 员工离职 + private final OrgRoleAuthorization orgRoleAuthorization; // org_role_authorization + private final Person person; // 个人信息 + private final PreHire preHire; // 待入职 + private final ProcessFormVariableData processFormVariableData; // 流程管理 + private final SecurityGroup securityGroup; // security_group + private final Subdivision subdivision; // 地理库信息 + private final Subregion subregion; // 地理库信息 + private final TransferReason transferReason; // 异动原因 + private final TransferType transferType; // 异动类型 + private final WorkingHoursType workingHoursType; // 工时制度 + private final V2 v2; + + public CorehrService(Config config) { + this.v1 = new V1(config); + this.assignedUser = new AssignedUser(config); + this.company = new Company(config); + this.compensationStandard = new CompensationStandard(config); + this.contract = new Contract(config); + this.countryRegion = new CountryRegion(config); + this.currency = new Currency(config); + this.customField = new CustomField(config); + this.department = new Department(config); + this.employeeType = new EmployeeType(config); + this.employment = new Employment(config); + this.file = new File(config); + this.job = new Job(config); + this.jobChange = new JobChange(config); + this.jobData = new JobData(config); + this.jobFamily = new JobFamily(config); + this.jobLevel = new JobLevel(config); + this.leave = new Leave(config); + this.leaveGrantingRecord = new LeaveGrantingRecord(config); + this.location = new Location(config); + this.nationalIdType = new NationalIdType(config); + this.offboarding = new Offboarding(config); + this.orgRoleAuthorization = new OrgRoleAuthorization(config); + this.person = new Person(config); + this.preHire = new PreHire(config); + this.processFormVariableData = new ProcessFormVariableData(config); + this.securityGroup = new SecurityGroup(config); + this.subdivision = new Subdivision(config); + this.subregion = new Subregion(config); + this.transferReason = new TransferReason(config); + this.transferType = new TransferType(config); + this.workingHoursType = new WorkingHoursType(config); + this.v2 = new V2(config); + } + + public V1 v1() { + return v1; + } + + public AssignedUser assignedUser() { + return assignedUser; + } + + public Company company() { + return company; + } + + public CompensationStandard compensationStandard() { + return compensationStandard; + } + + public Contract contract() { + return contract; + } + + public CountryRegion countryRegion() { + return countryRegion; + } + + public Currency currency() { + return currency; + } + + public CustomField customField() { + return customField; + } + + public Department department() { + return department; + } + + public EmployeeType employeeType() { + return employeeType; + } + + public Employment employment() { + return employment; + } + + public File file() { + return file; + } + + public Job job() { + return job; + } + + public JobChange jobChange() { + return jobChange; + } + + public JobData jobData() { + return jobData; + } + + public JobFamily jobFamily() { + return jobFamily; + } + + public JobLevel jobLevel() { + return jobLevel; + } + + public Leave leave() { + return leave; + } + + public LeaveGrantingRecord leaveGrantingRecord() { + return leaveGrantingRecord; + } + + public Location location() { + return location; + } + + public NationalIdType nationalIdType() { + return nationalIdType; + } + + public Offboarding offboarding() { + return offboarding; + } + + public OrgRoleAuthorization orgRoleAuthorization() { + return orgRoleAuthorization; + } + + public Person person() { + return person; + } + + public PreHire preHire() { + return preHire; + } + + public ProcessFormVariableData processFormVariableData() { + return processFormVariableData; + } + + public SecurityGroup securityGroup() { + return securityGroup; + } + + public Subdivision subdivision() { + return subdivision; + } + + public Subregion subregion() { + return subregion; + } + + public TransferReason transferReason() { + return transferReason; + } + + public TransferType transferType() { + return transferType; + } + + public WorkingHoursType workingHoursType() { + return workingHoursType; + } + + public V2 v2() { + return v2; + } + + public abstract static class P2ContractCreatedV1Handler implements IEventHandler { + @Override + public P2ContractCreatedV1 getEvent() { + return new P2ContractCreatedV1(); + } + } + + public abstract static class P2ContractDeletedV1Handler implements IEventHandler { + @Override + public P2ContractDeletedV1 getEvent() { + return new P2ContractDeletedV1(); + } + } + + public abstract static class P2ContractUpdatedV1Handler implements IEventHandler { + @Override + public P2ContractUpdatedV1 getEvent() { + return new P2ContractUpdatedV1(); + } + } + + public abstract static class P2DepartmentCreatedV1Handler implements IEventHandler { + @Override + public P2DepartmentCreatedV1 getEvent() { + return new P2DepartmentCreatedV1(); + } + } + + public abstract static class P2DepartmentDeletedV1Handler implements IEventHandler { + @Override + public P2DepartmentDeletedV1 getEvent() { + return new P2DepartmentDeletedV1(); + } + } + + public abstract static class P2DepartmentUpdatedV1Handler implements IEventHandler { + @Override + public P2DepartmentUpdatedV1 getEvent() { + return new P2DepartmentUpdatedV1(); + } + } + + public abstract static class P2EmploymentConvertedV1Handler implements IEventHandler { + @Override + public P2EmploymentConvertedV1 getEvent() { + return new P2EmploymentConvertedV1(); + } + } + + public abstract static class P2EmploymentCreatedV1Handler implements IEventHandler { + @Override + public P2EmploymentCreatedV1 getEvent() { + return new P2EmploymentCreatedV1(); + } + } + + public abstract static class P2EmploymentDeletedV1Handler implements IEventHandler { + @Override + public P2EmploymentDeletedV1 getEvent() { + return new P2EmploymentDeletedV1(); + } + } + + public abstract static class P2EmploymentResignedV1Handler implements IEventHandler { + @Override + public P2EmploymentResignedV1 getEvent() { + return new P2EmploymentResignedV1(); + } + } + + public abstract static class P2EmploymentUpdatedV1Handler implements IEventHandler { + @Override + public P2EmploymentUpdatedV1 getEvent() { + return new P2EmploymentUpdatedV1(); + } + } + + public abstract static class P2JobCreatedV1Handler implements IEventHandler { + @Override + public P2JobCreatedV1 getEvent() { + return new P2JobCreatedV1(); + } + } + + public abstract static class P2JobDeletedV1Handler implements IEventHandler { + @Override + public P2JobDeletedV1 getEvent() { + return new P2JobDeletedV1(); + } + } + + public abstract static class P2JobUpdatedV1Handler implements IEventHandler { + @Override + public P2JobUpdatedV1 getEvent() { + return new P2JobUpdatedV1(); + } + } + + public abstract static class P2JobChangeUpdatedV1Handler implements IEventHandler { + @Override + public P2JobChangeUpdatedV1 getEvent() { + return new P2JobChangeUpdatedV1(); + } + } + + public abstract static class P2JobDataChangedV1Handler implements IEventHandler { + @Override + public P2JobDataChangedV1 getEvent() { + return new P2JobDataChangedV1(); + } + } + + public abstract static class P2JobDataEmployedV1Handler implements IEventHandler { + @Override + public P2JobDataEmployedV1 getEvent() { + return new P2JobDataEmployedV1(); + } + } + + public abstract static class P2OffboardingUpdatedV1Handler implements IEventHandler { + @Override + public P2OffboardingUpdatedV1 getEvent() { + return new P2OffboardingUpdatedV1(); + } + } + + public abstract static class P2OrgRoleAuthorizationUpdatedV1Handler implements IEventHandler { + @Override + public P2OrgRoleAuthorizationUpdatedV1 getEvent() { + return new P2OrgRoleAuthorizationUpdatedV1(); + } + } + + public abstract static class P2PersonCreatedV1Handler implements IEventHandler { + @Override + public P2PersonCreatedV1 getEvent() { + return new P2PersonCreatedV1(); + } + } + + public abstract static class P2PersonDeletedV1Handler implements IEventHandler { + @Override + public P2PersonDeletedV1 getEvent() { + return new P2PersonDeletedV1(); + } + } + + public abstract static class P2PersonUpdatedV1Handler implements IEventHandler { + @Override + public P2PersonUpdatedV1 getEvent() { + return new P2PersonUpdatedV1(); + } + } + + public abstract static class P2PreHireUpdatedV1Handler implements IEventHandler { + @Override + public P2PreHireUpdatedV1 getEvent() { + return new P2PreHireUpdatedV1(); + } + } + + public abstract static class P2ProbationUpdatedV2Handler implements IEventHandler { + @Override + public P2ProbationUpdatedV2 getEvent() { + return new P2ProbationUpdatedV2(); + } + } + + public abstract static class P2ProcessUpdatedV2Handler implements IEventHandler { + @Override + public P2ProcessUpdatedV2 getEvent() { + return new P2ProcessUpdatedV2(); + } + } + + public abstract static class P2ProcessApproverUpdatedV2Handler implements IEventHandler { + @Override + public P2ProcessApproverUpdatedV2 getEvent() { + return new P2ProcessApproverUpdatedV2(); + } + } + + public abstract static class P2ProcessCcUpdatedV2Handler implements IEventHandler { + @Override + public P2ProcessCcUpdatedV2 getEvent() { + return new P2ProcessCcUpdatedV2(); + } + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/CorehrService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/CorehrService.java deleted file mode 100644 index 872e7d719..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/CorehrService.java +++ /dev/null @@ -1,6795 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.event.IEventHandler; -import com.lark.oapi.service.corehr.v1.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.ByteArrayOutputStream; -import java.nio.charset.StandardCharsets; - -public class CorehrService { - private static final Logger log = LoggerFactory.getLogger(CorehrService.class); - private final AssignedUser assignedUser; // assigned_user - private final Company company; // 公司 - private final CompensationStandard compensationStandard; // compensation_standard - private final Contract contract; // 合同 - private final CountryRegion countryRegion; // 地理库信息 - private final Currency currency; // 货币信息 - private final CustomField customField; // 自定义字段 - private final Department department; // 部门 - private final EmployeeType employeeType; // 人员类型 - private final Employment employment; // 雇佣信息 - private final File file; // file - private final Job job; // 职务 - private final JobChange jobChange; // 异动信息 - private final JobData jobData; // 任职信息 - private final JobFamily jobFamily; // 职务序列 - private final JobLevel jobLevel; // 职务级别 - private final Leave leave; // 休假管理 - private final LeaveGrantingRecord leaveGrantingRecord; // leave_granting_record - private final Location location; // 地点 - private final NationalIdType nationalIdType; // 国家证件类型 - private final Offboarding offboarding; // 员工离职 - private final OrgRoleAuthorization orgRoleAuthorization; // org_role_authorization - private final Person person; // 个人信息 - private final PreHire preHire; // 待入职 - private final ProcessFormVariableData processFormVariableData; // 流程管理 - private final SecurityGroup securityGroup; // security_group - private final Subdivision subdivision; // 地理库信息 - private final Subregion subregion; // 地理库信息 - private final TransferReason transferReason; // 异动原因 - private final TransferType transferType; // 异动类型 - private final WorkingHoursType workingHoursType; // 工时制度 - - public CorehrService(Config config) { - this.assignedUser = new AssignedUser(config); - this.company = new Company(config); - this.compensationStandard = new CompensationStandard(config); - this.contract = new Contract(config); - this.countryRegion = new CountryRegion(config); - this.currency = new Currency(config); - this.customField = new CustomField(config); - this.department = new Department(config); - this.employeeType = new EmployeeType(config); - this.employment = new Employment(config); - this.file = new File(config); - this.job = new Job(config); - this.jobChange = new JobChange(config); - this.jobData = new JobData(config); - this.jobFamily = new JobFamily(config); - this.jobLevel = new JobLevel(config); - this.leave = new Leave(config); - this.leaveGrantingRecord = new LeaveGrantingRecord(config); - this.location = new Location(config); - this.nationalIdType = new NationalIdType(config); - this.offboarding = new Offboarding(config); - this.orgRoleAuthorization = new OrgRoleAuthorization(config); - this.person = new Person(config); - this.preHire = new PreHire(config); - this.processFormVariableData = new ProcessFormVariableData(config); - this.securityGroup = new SecurityGroup(config); - this.subdivision = new Subdivision(config); - this.subregion = new Subregion(config); - this.transferReason = new TransferReason(config); - this.transferType = new TransferType(config); - this.workingHoursType = new WorkingHoursType(config); - } - - /** - * assigned_user - * - * @return - */ - public AssignedUser assignedUser() { - return assignedUser; - } - - /** - * 公司 - * - * @return - */ - public Company company() { - return company; - } - - /** - * compensation_standard - * - * @return - */ - public CompensationStandard compensationStandard() { - return compensationStandard; - } - - /** - * 合同 - * - * @return - */ - public Contract contract() { - return contract; - } - - /** - * 地理库信息 - * - * @return - */ - public CountryRegion countryRegion() { - return countryRegion; - } - - /** - * 货币信息 - * - * @return - */ - public Currency currency() { - return currency; - } - - /** - * 自定义字段 - * - * @return - */ - public CustomField customField() { - return customField; - } - - /** - * 部门 - * - * @return - */ - public Department department() { - return department; - } - - /** - * 人员类型 - * - * @return - */ - public EmployeeType employeeType() { - return employeeType; - } - - /** - * 雇佣信息 - * - * @return - */ - public Employment employment() { - return employment; - } - - /** - * file - * - * @return - */ - public File file() { - return file; - } - - /** - * 职务 - * - * @return - */ - public Job job() { - return job; - } - - /** - * 异动信息 - * - * @return - */ - public JobChange jobChange() { - return jobChange; - } - - /** - * 任职信息 - * - * @return - */ - public JobData jobData() { - return jobData; - } - - /** - * 职务序列 - * - * @return - */ - public JobFamily jobFamily() { - return jobFamily; - } - - /** - * 职务级别 - * - * @return - */ - public JobLevel jobLevel() { - return jobLevel; - } - - /** - * 休假管理 - * - * @return - */ - public Leave leave() { - return leave; - } - - /** - * leave_granting_record - * - * @return - */ - public LeaveGrantingRecord leaveGrantingRecord() { - return leaveGrantingRecord; - } - - /** - * 地点 - * - * @return - */ - public Location location() { - return location; - } - - /** - * 国家证件类型 - * - * @return - */ - public NationalIdType nationalIdType() { - return nationalIdType; - } - - /** - * 员工离职 - * - * @return - */ - public Offboarding offboarding() { - return offboarding; - } - - /** - * org_role_authorization - * - * @return - */ - public OrgRoleAuthorization orgRoleAuthorization() { - return orgRoleAuthorization; - } - - /** - * 个人信息 - * - * @return - */ - public Person person() { - return person; - } - - /** - * 待入职 - * - * @return - */ - public PreHire preHire() { - return preHire; - } - - /** - * 流程管理 - * - * @return - */ - public ProcessFormVariableData processFormVariableData() { - return processFormVariableData; - } - - /** - * security_group - * - * @return - */ - public SecurityGroup securityGroup() { - return securityGroup; - } - - /** - * 地理库信息 - * - * @return - */ - public Subdivision subdivision() { - return subdivision; - } - - /** - * 地理库信息 - * - * @return - */ - public Subregion subregion() { - return subregion; - } - - /** - * 异动原因 - * - * @return - */ - public TransferReason transferReason() { - return transferReason; - } - - /** - * 异动类型 - * - * @return - */ - public TransferType transferType() { - return transferType; - } - - /** - * 工时制度 - * - * @return - */ - public WorkingHoursType workingHoursType() { - return workingHoursType; - } - - public static class AssignedUser { - private final Config config; - - public AssignedUser(Config config) { - this.config = config; - } - - /** - * 获取组织类角色授权列表,查询组织类角色的授权信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/assigned_user/search ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/SearchAssignedUserSample.java ; - */ - public SearchAssignedUserResp search(SearchAssignedUserReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/assigned_users/search" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SearchAssignedUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchAssignedUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/assigned_users/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取组织类角色授权列表,查询组织类角色的授权信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/assigned_user/search ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/SearchAssignedUserSample.java ; - */ - public SearchAssignedUserResp search(SearchAssignedUserReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/assigned_users/search" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SearchAssignedUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchAssignedUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/assigned_users/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Company { - private final Config config; - - public Company(Config config) { - this.config = config; - } - - /** - * 创建公司,创建公司 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/company/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateCompanySample.java ; - */ - public CreateCompanyResp create(CreateCompanyReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/companies" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateCompanyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCompanyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/companies" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建公司,创建公司 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/company/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateCompanySample.java ; - */ - public CreateCompanyResp create(CreateCompanyReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/companies" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateCompanyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCompanyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/companies" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除公司,删除公司 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/company/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteCompanySample.java ; - */ - public DeleteCompanyResp delete(DeleteCompanyReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/companies/:company_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteCompanyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteCompanyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/companies/:company_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除公司,删除公司 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/company/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteCompanySample.java ; - */ - public DeleteCompanyResp delete(DeleteCompanyReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/companies/:company_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteCompanyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteCompanyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/companies/:company_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个公司,根据 ID 查询单个公司 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/company/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetCompanySample.java ; - */ - public GetCompanyResp get(GetCompanyReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/companies/:company_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetCompanyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCompanyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/companies/:company_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个公司,根据 ID 查询单个公司 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/company/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetCompanySample.java ; - */ - public GetCompanyResp get(GetCompanyReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/companies/:company_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetCompanyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCompanyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/companies/:company_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询公司,批量查询公司 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/company/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListCompanySample.java ; - */ - public ListCompanyResp list(ListCompanyReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/companies" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListCompanyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCompanyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/companies" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询公司,批量查询公司 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/company/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListCompanySample.java ; - */ - public ListCompanyResp list(ListCompanyReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/companies" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListCompanyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCompanyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/companies" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class CompensationStandard { - private final Config config; - - public CompensationStandard(Config config) { - this.config = config; - } - - /** - * ,分页查询地点数据 - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=match&project=corehr&resource=compensation_standard&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/MatchCompensationStandardSample.java ; - */ - public MatchCompensationStandardResp match(MatchCompensationStandardReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/compensation_standards/match" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - MatchCompensationStandardResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MatchCompensationStandardResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/compensation_standards/match" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * ,分页查询地点数据 - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=match&project=corehr&resource=compensation_standard&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/MatchCompensationStandardSample.java ; - */ - public MatchCompensationStandardResp match(MatchCompensationStandardReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/compensation_standards/match" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - MatchCompensationStandardResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MatchCompensationStandardResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/compensation_standards/match" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Contract { - private final Config config; - - public Contract(Config config) { - this.config = config; - } - - /** - * 创建合同,创建合同 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateContractSample.java ; - */ - public CreateContractResp create(CreateContractReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/contracts" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateContractResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateContractResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/contracts" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建合同,创建合同 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateContractSample.java ; - */ - public CreateContractResp create(CreateContractReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/contracts" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateContractResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateContractResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/contracts" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除合同,删除合同 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteContractSample.java ; - */ - public DeleteContractResp delete(DeleteContractReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/contracts/:contract_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteContractResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteContractResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/contracts/:contract_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除合同,删除合同 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteContractSample.java ; - */ - public DeleteContractResp delete(DeleteContractReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/contracts/:contract_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteContractResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteContractResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/contracts/:contract_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个合同,根据 ID 查询单个合同 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetContractSample.java ; - */ - public GetContractResp get(GetContractReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/contracts/:contract_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetContractResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetContractResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/contracts/:contract_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个合同,根据 ID 查询单个合同 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetContractSample.java ; - */ - public GetContractResp get(GetContractReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/contracts/:contract_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetContractResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetContractResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/contracts/:contract_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询合同,批量查询合同 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListContractSample.java ; - */ - public ListContractResp list(ListContractReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/contracts" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListContractResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListContractResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/contracts" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询合同,批量查询合同 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListContractSample.java ; - */ - public ListContractResp list(ListContractReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/contracts" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListContractResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListContractResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/contracts" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新合同,更新合同 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchContractSample.java ; - */ - public PatchContractResp patch(PatchContractReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/corehr/v1/contracts/:contract_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchContractResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchContractResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/contracts/:contract_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新合同,更新合同 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchContractSample.java ; - */ - public PatchContractResp patch(PatchContractReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/corehr/v1/contracts/:contract_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchContractResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchContractResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/contracts/:contract_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class CountryRegion { - private final Config config; - - public CountryRegion(Config config) { - this.config = config; - } - - /** - * 查询单条国家/地区信息,查询单条国家/地区信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/country_region/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetCountryRegionSample.java ; - */ - public GetCountryRegionResp get(GetCountryRegionReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/country_regions/:country_region_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetCountryRegionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCountryRegionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/country_regions/:country_region_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单条国家/地区信息,查询单条国家/地区信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/country_region/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetCountryRegionSample.java ; - */ - public GetCountryRegionResp get(GetCountryRegionReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/country_regions/:country_region_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetCountryRegionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCountryRegionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/country_regions/:country_region_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询国家/地区信息,批量查询国家/地区信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/country_region/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListCountryRegionSample.java ; - */ - public ListCountryRegionResp list(ListCountryRegionReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/country_regions" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListCountryRegionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCountryRegionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/country_regions" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询国家/地区信息,批量查询国家/地区信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/country_region/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListCountryRegionSample.java ; - */ - public ListCountryRegionResp list(ListCountryRegionReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/country_regions" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListCountryRegionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCountryRegionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/country_regions" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Currency { - private final Config config; - - public Currency(Config config) { - this.config = config; - } - - /** - * 查询单个货币信息,查询单个货币信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/currency/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetCurrencySample.java ; - */ - public GetCurrencyResp get(GetCurrencyReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/currencies/:currency_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetCurrencyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCurrencyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/currencies/:currency_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个货币信息,查询单个货币信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/currency/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetCurrencySample.java ; - */ - public GetCurrencyResp get(GetCurrencyReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/currencies/:currency_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetCurrencyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCurrencyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/currencies/:currency_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询货币信息,批量查询货币信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/currency/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListCurrencySample.java ; - */ - public ListCurrencyResp list(ListCurrencyReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/currencies" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListCurrencyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCurrencyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/currencies" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询货币信息,批量查询货币信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/currency/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListCurrencySample.java ; - */ - public ListCurrencyResp list(ListCurrencyReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/currencies" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListCurrencyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCurrencyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/currencies" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class CustomField { - private final Config config; - - public CustomField(Config config) { - this.config = config; - } - - /** - * 获取自定义字段详情,获取「飞书人事」具体对象下某自定义字段的详细信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/custom_field/get_by_param ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetByParamCustomFieldSample.java ; - */ - public GetByParamCustomFieldResp getByParam(GetByParamCustomFieldReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/custom_fields/get_by_param" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetByParamCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetByParamCustomFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/custom_fields/get_by_param" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取自定义字段详情,获取「飞书人事」具体对象下某自定义字段的详细信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/custom_field/get_by_param ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetByParamCustomFieldSample.java ; - */ - public GetByParamCustomFieldResp getByParam(GetByParamCustomFieldReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/custom_fields/get_by_param" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetByParamCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetByParamCustomFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/custom_fields/get_by_param" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取飞书人事对象列表,获取「飞书人事」中的对象列表,含系统预置对象与自定义对象 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/custom_field/list_object_api_name ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListObjectApiNameCustomFieldSample.java ; - */ - public ListObjectApiNameCustomFieldResp listObjectApiName(ListObjectApiNameCustomFieldReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/custom_fields/list_object_api_name" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListObjectApiNameCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListObjectApiNameCustomFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/custom_fields/list_object_api_name" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取飞书人事对象列表,获取「飞书人事」中的对象列表,含系统预置对象与自定义对象 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/custom_field/list_object_api_name ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListObjectApiNameCustomFieldSample.java ; - */ - public ListObjectApiNameCustomFieldResp listObjectApiName(ListObjectApiNameCustomFieldReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/custom_fields/list_object_api_name" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListObjectApiNameCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListObjectApiNameCustomFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/custom_fields/list_object_api_name" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取自定义字段列表,获取「飞书人事」具体对象下的自定义字段列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/custom_field/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryCustomFieldSample.java ; - */ - public QueryCustomFieldResp query(QueryCustomFieldReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/custom_fields/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryCustomFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/custom_fields/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取自定义字段列表,获取「飞书人事」具体对象下的自定义字段列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/custom_field/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryCustomFieldSample.java ; - */ - public QueryCustomFieldResp query(QueryCustomFieldReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/custom_fields/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryCustomFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/custom_fields/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Department { - private final Config config; - - public Department(Config config) { - this.config = config; - } - - /** - * 创建部门,创建部门 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateDepartmentSample.java ; - */ - public CreateDepartmentResp create(CreateDepartmentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/departments" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/departments" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建部门,创建部门 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateDepartmentSample.java ; - */ - public CreateDepartmentResp create(CreateDepartmentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/departments" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/departments" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除部门,删除部门 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteDepartmentSample.java ; - */ - public DeleteDepartmentResp delete(DeleteDepartmentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/departments/:department_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/departments/:department_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除部门,删除部门 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteDepartmentSample.java ; - */ - public DeleteDepartmentResp delete(DeleteDepartmentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/departments/:department_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/departments/:department_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个部门,根据 ID 查询单个部门 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetDepartmentSample.java ; - */ - public GetDepartmentResp get(GetDepartmentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/departments/:department_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/departments/:department_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个部门,根据 ID 查询单个部门 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetDepartmentSample.java ; - */ - public GetDepartmentResp get(GetDepartmentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/departments/:department_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/departments/:department_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询部门,批量查询部门 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListDepartmentSample.java ; - */ - public ListDepartmentResp list(ListDepartmentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/departments" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/departments" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询部门,批量查询部门 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListDepartmentSample.java ; - */ - public ListDepartmentResp list(ListDepartmentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/departments" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/departments" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新部门,更新部门 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchDepartmentSample.java ; - */ - public PatchDepartmentResp patch(PatchDepartmentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/corehr/v1/departments/:department_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/departments/:department_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新部门,更新部门 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchDepartmentSample.java ; - */ - public PatchDepartmentResp patch(PatchDepartmentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/corehr/v1/departments/:department_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchDepartmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/departments/:department_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class EmployeeType { - private final Config config; - - public EmployeeType(Config config) { - this.config = config; - } - - /** - * 创建人员类型,创建人员类型 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateEmployeeTypeSample.java ; - */ - public CreateEmployeeTypeResp create(CreateEmployeeTypeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/employee_types" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateEmployeeTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEmployeeTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employee_types" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建人员类型,创建人员类型 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateEmployeeTypeSample.java ; - */ - public CreateEmployeeTypeResp create(CreateEmployeeTypeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/employee_types" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateEmployeeTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEmployeeTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employee_types" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除人员类型,删除人员类型 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteEmployeeTypeSample.java ; - */ - public DeleteEmployeeTypeResp delete(DeleteEmployeeTypeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/employee_types/:employee_type_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteEmployeeTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteEmployeeTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employee_types/:employee_type_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除人员类型,删除人员类型 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteEmployeeTypeSample.java ; - */ - public DeleteEmployeeTypeResp delete(DeleteEmployeeTypeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/employee_types/:employee_type_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteEmployeeTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteEmployeeTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employee_types/:employee_type_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个人员类型,根据 ID 查询单个人员类型 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetEmployeeTypeSample.java ; - */ - public GetEmployeeTypeResp get(GetEmployeeTypeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/employee_types/:employee_type_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetEmployeeTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetEmployeeTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employee_types/:employee_type_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个人员类型,根据 ID 查询单个人员类型 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetEmployeeTypeSample.java ; - */ - public GetEmployeeTypeResp get(GetEmployeeTypeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/employee_types/:employee_type_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetEmployeeTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetEmployeeTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employee_types/:employee_type_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询人员类型,批量查询人员类型 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListEmployeeTypeSample.java ; - */ - public ListEmployeeTypeResp list(ListEmployeeTypeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/employee_types" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListEmployeeTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListEmployeeTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employee_types" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询人员类型,批量查询人员类型 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListEmployeeTypeSample.java ; - */ - public ListEmployeeTypeResp list(ListEmployeeTypeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/employee_types" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListEmployeeTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListEmployeeTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employee_types" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新人员类型数据,更新人员类型数据 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchEmployeeTypeSample.java ; - */ - public PatchEmployeeTypeResp patch(PatchEmployeeTypeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/corehr/v1/employee_types/:employee_type_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchEmployeeTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchEmployeeTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employee_types/:employee_type_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新人员类型数据,更新人员类型数据 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchEmployeeTypeSample.java ; - */ - public PatchEmployeeTypeResp patch(PatchEmployeeTypeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/corehr/v1/employee_types/:employee_type_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchEmployeeTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchEmployeeTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employee_types/:employee_type_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Employment { - private final Config config; - - public Employment(Config config) { - this.config = config; - } - - /** - * 创建雇佣信息,创建人员的雇佣信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employment/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateEmploymentSample.java ; - */ - public CreateEmploymentResp create(CreateEmploymentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/employments" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateEmploymentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEmploymentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employments" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建雇佣信息,创建人员的雇佣信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employment/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateEmploymentSample.java ; - */ - public CreateEmploymentResp create(CreateEmploymentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/employments" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateEmploymentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEmploymentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employments" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除雇佣信息,删除人员的雇佣信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employment/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteEmploymentSample.java ; - */ - public DeleteEmploymentResp delete(DeleteEmploymentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/employments/:employment_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteEmploymentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteEmploymentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employments/:employment_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除雇佣信息,删除人员的雇佣信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employment/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteEmploymentSample.java ; - */ - public DeleteEmploymentResp delete(DeleteEmploymentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/employments/:employment_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteEmploymentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteEmploymentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employments/:employment_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新雇佣信息,更新雇佣信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employment/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchEmploymentSample.java ; - */ - public PatchEmploymentResp patch(PatchEmploymentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/corehr/v1/employments/:employment_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchEmploymentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchEmploymentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employments/:employment_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新雇佣信息,更新雇佣信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employment/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchEmploymentSample.java ; - */ - public PatchEmploymentResp patch(PatchEmploymentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/corehr/v1/employments/:employment_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchEmploymentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchEmploymentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employments/:employment_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class File { - private final Config config; - - public File(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=corehr&resource=file&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetFileSample.java ; - */ - public GetFileResp get(GetFileReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/files/:id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - if (httpResponse.getStatusCode() == 200) { - GetFileResp resp = new GetFileResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - GetFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/files/:id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=corehr&resource=file&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetFileSample.java ; - */ - public GetFileResp get(GetFileReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/files/:id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 下载请求,返回流 - if (httpResponse.getStatusCode() == 200) { - GetFileResp resp = new GetFileResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - GetFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/files/:id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Job { - private final Config config; - - public Job(Config config) { - this.config = config; - } - - /** - * 创建职务,创建职务 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobSample.java ; - */ - public CreateJobResp create(CreateJobReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/jobs" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/jobs" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建职务,创建职务 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobSample.java ; - */ - public CreateJobResp create(CreateJobReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/jobs" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/jobs" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除职务,删除职务 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobSample.java ; - */ - public DeleteJobResp delete(DeleteJobReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/jobs/:job_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/jobs/:job_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除职务,删除职务 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobSample.java ; - */ - public DeleteJobResp delete(DeleteJobReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/jobs/:job_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/jobs/:job_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个职务,根据 ID 查询单个职务 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobSample.java ; - */ - public GetJobResp get(GetJobReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/jobs/:job_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/jobs/:job_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个职务,根据 ID 查询单个职务 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobSample.java ; - */ - public GetJobResp get(GetJobReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/jobs/:job_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/jobs/:job_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询职务,批量查询职务 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobSample.java ; - */ - public ListJobResp list(ListJobReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/jobs" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/jobs" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询职务,批量查询职务 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobSample.java ; - */ - public ListJobResp list(ListJobReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/jobs" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/jobs" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新职务,更新职务 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobSample.java ; - */ - public PatchJobResp patch(PatchJobReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/corehr/v1/jobs/:job_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchJobResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/jobs/:job_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新职务,更新职务 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobSample.java ; - */ - public PatchJobResp patch(PatchJobReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/corehr/v1/jobs/:job_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchJobResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/jobs/:job_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class JobChange { - private final Config config; - - public JobChange(Config config) { - this.config = config; - } - - /** - * 发起员工异动,创建员工异动信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_change/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobChangeSample.java ; - */ - public CreateJobChangeResp create(CreateJobChangeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/job_changes" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateJobChangeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobChangeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_changes" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 发起员工异动,创建员工异动信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_change/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobChangeSample.java ; - */ - public CreateJobChangeResp create(CreateJobChangeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/job_changes" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateJobChangeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobChangeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_changes" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class JobData { - private final Config config; - - public JobData(Config config) { - this.config = config; - } - - /** - * 创建任职信息,在系统中第一次创建员工任职数据,通常在员工入职或者做数据批量导入的时候使用,【任职原因】只支持填写“入职” - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobDataSample.java ; - */ - public CreateJobDataResp create(CreateJobDataReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/job_datas" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateJobDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobDataResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_datas" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建任职信息,在系统中第一次创建员工任职数据,通常在员工入职或者做数据批量导入的时候使用,【任职原因】只支持填写“入职” - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobDataSample.java ; - */ - public CreateJobDataResp create(CreateJobDataReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/job_datas" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateJobDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobDataResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_datas" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除任职信息,删除人员的任职信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobDataSample.java ; - */ - public DeleteJobDataResp delete(DeleteJobDataReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/job_datas/:job_data_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteJobDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobDataResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_datas/:job_data_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除任职信息,删除人员的任职信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobDataSample.java ; - */ - public DeleteJobDataResp delete(DeleteJobDataReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/job_datas/:job_data_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteJobDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobDataResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_datas/:job_data_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个任职信息,根据 ID 查询单任职信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobDataSample.java ; - */ - public GetJobDataResp get(GetJobDataReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/job_datas/:job_data_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetJobDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobDataResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_datas/:job_data_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个任职信息,根据 ID 查询单任职信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobDataSample.java ; - */ - public GetJobDataResp get(GetJobDataReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/job_datas/:job_data_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetJobDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobDataResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_datas/:job_data_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询任职信息,批量查询人员的任职信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobDataSample.java ; - */ - public ListJobDataResp list(ListJobDataReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/job_datas" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListJobDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobDataResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_datas" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询任职信息,批量查询人员的任职信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobDataSample.java ; - */ - public ListJobDataResp list(ListJobDataReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/job_datas" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListJobDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobDataResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_datas" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新任职信息,更新任职信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobDataSample.java ; - */ - public PatchJobDataResp patch(PatchJobDataReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/corehr/v1/job_datas/:job_data_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchJobDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchJobDataResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_datas/:job_data_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新任职信息,更新任职信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobDataSample.java ; - */ - public PatchJobDataResp patch(PatchJobDataReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/corehr/v1/job_datas/:job_data_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchJobDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchJobDataResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_datas/:job_data_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class JobFamily { - private final Config config; - - public JobFamily(Config config) { - this.config = config; - } - - /** - * 创建职务序列,创建职务序列 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobFamilySample.java ; - */ - public CreateJobFamilyResp create(CreateJobFamilyReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/job_families" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobFamilyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_families" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建职务序列,创建职务序列 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobFamilySample.java ; - */ - public CreateJobFamilyResp create(CreateJobFamilyReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/job_families" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobFamilyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_families" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除职务序列,删除职务序列 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobFamilySample.java ; - */ - public DeleteJobFamilyResp delete(DeleteJobFamilyReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/job_families/:job_family_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobFamilyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_families/:job_family_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除职务序列,删除职务序列 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobFamilySample.java ; - */ - public DeleteJobFamilyResp delete(DeleteJobFamilyReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/job_families/:job_family_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobFamilyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_families/:job_family_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个职务序列,根据 ID 查询单个职务序列 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobFamilySample.java ; - */ - public GetJobFamilyResp get(GetJobFamilyReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/job_families/:job_family_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobFamilyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_families/:job_family_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个职务序列,根据 ID 查询单个职务序列 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobFamilySample.java ; - */ - public GetJobFamilyResp get(GetJobFamilyReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/job_families/:job_family_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobFamilyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_families/:job_family_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询职务序列,批量查询职务序列 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobFamilySample.java ; - */ - public ListJobFamilyResp list(ListJobFamilyReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/job_families" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobFamilyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_families" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询职务序列,批量查询职务序列 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobFamilySample.java ; - */ - public ListJobFamilyResp list(ListJobFamilyReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/job_families" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobFamilyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_families" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新职务序列,更新职务序列 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobFamilySample.java ; - */ - public PatchJobFamilyResp patch(PatchJobFamilyReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/corehr/v1/job_families/:job_family_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchJobFamilyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_families/:job_family_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新职务序列,更新职务序列 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobFamilySample.java ; - */ - public PatchJobFamilyResp patch(PatchJobFamilyReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/corehr/v1/job_families/:job_family_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchJobFamilyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_families/:job_family_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class JobLevel { - private final Config config; - - public JobLevel(Config config) { - this.config = config; - } - - /** - * 创建职务级别,创建职务级别 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobLevelSample.java ; - */ - public CreateJobLevelResp create(CreateJobLevelReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/job_levels" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_levels" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建职务级别,创建职务级别 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobLevelSample.java ; - */ - public CreateJobLevelResp create(CreateJobLevelReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/job_levels" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_levels" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除职务级别,删除职务级别 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobLevelSample.java ; - */ - public DeleteJobLevelResp delete(DeleteJobLevelReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/job_levels/:job_level_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_levels/:job_level_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除职务级别,删除职务级别 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobLevelSample.java ; - */ - public DeleteJobLevelResp delete(DeleteJobLevelReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/job_levels/:job_level_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_levels/:job_level_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个职务级别,根据 ID 查询单个职务级别 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobLevelSample.java ; - */ - public GetJobLevelResp get(GetJobLevelReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/job_levels/:job_level_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_levels/:job_level_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个职务级别,根据 ID 查询单个职务级别 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobLevelSample.java ; - */ - public GetJobLevelResp get(GetJobLevelReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/job_levels/:job_level_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_levels/:job_level_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询职务级别,批量查询职务级别 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobLevelSample.java ; - */ - public ListJobLevelResp list(ListJobLevelReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/job_levels" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_levels" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询职务级别,批量查询职务级别 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobLevelSample.java ; - */ - public ListJobLevelResp list(ListJobLevelReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/job_levels" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_levels" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新职务级别,更新职务级别 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobLevelSample.java ; - */ - public PatchJobLevelResp patch(PatchJobLevelReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/corehr/v1/job_levels/:job_level_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchJobLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_levels/:job_level_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新职务级别,更新职务级别 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobLevelSample.java ; - */ - public PatchJobLevelResp patch(PatchJobLevelReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/corehr/v1/job_levels/:job_level_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchJobLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_levels/:job_level_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Leave { - private final Config config; - - public Leave(Config config) { - this.config = config; - } - - /** - * 批量查询员工假期余额,批量获取员工各个假期的余额数据 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave/leave_balances ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/LeaveBalancesLeaveSample.java ; - */ - public LeaveBalancesLeaveResp leaveBalances(LeaveBalancesLeaveReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/leaves/leave_balances" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - LeaveBalancesLeaveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, LeaveBalancesLeaveResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/leaves/leave_balances" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询员工假期余额,批量获取员工各个假期的余额数据 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave/leave_balances ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/LeaveBalancesLeaveSample.java ; - */ - public LeaveBalancesLeaveResp leaveBalances(LeaveBalancesLeaveReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/leaves/leave_balances" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - LeaveBalancesLeaveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, LeaveBalancesLeaveResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/leaves/leave_balances" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询员工请假记录,批量获取员工的请假记录数据 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave/leave_request_history ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/LeaveRequestHistoryLeaveSample.java ; - */ - public LeaveRequestHistoryLeaveResp leaveRequestHistory(LeaveRequestHistoryLeaveReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/leaves/leave_request_history" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - LeaveRequestHistoryLeaveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, LeaveRequestHistoryLeaveResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/leaves/leave_request_history" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询员工请假记录,批量获取员工的请假记录数据 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave/leave_request_history ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/LeaveRequestHistoryLeaveSample.java ; - */ - public LeaveRequestHistoryLeaveResp leaveRequestHistory(LeaveRequestHistoryLeaveReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/leaves/leave_request_history" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - LeaveRequestHistoryLeaveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, LeaveRequestHistoryLeaveResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/leaves/leave_request_history" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取假期类型列表,获取休假设置后台配置的假期类型列表(比如年假、事假、婚假等) - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave/leave_types ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/LeaveTypesLeaveSample.java ; - */ - public LeaveTypesLeaveResp leaveTypes(LeaveTypesLeaveReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/leaves/leave_types" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - LeaveTypesLeaveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, LeaveTypesLeaveResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/leaves/leave_types" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取假期类型列表,获取休假设置后台配置的假期类型列表(比如年假、事假、婚假等) - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave/leave_types ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/LeaveTypesLeaveSample.java ; - */ - public LeaveTypesLeaveResp leaveTypes(LeaveTypesLeaveReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/leaves/leave_types" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - LeaveTypesLeaveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, LeaveTypesLeaveResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/leaves/leave_types" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class LeaveGrantingRecord { - private final Config config; - - public LeaveGrantingRecord(Config config) { - this.config = config; - } - - /** - * 创建假期授予记录,向飞书人事休假系统写入假期授予记录 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave_granting_record/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateLeaveGrantingRecordSample.java ; - */ - public CreateLeaveGrantingRecordResp create(CreateLeaveGrantingRecordReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/leave_granting_records" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateLeaveGrantingRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateLeaveGrantingRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/leave_granting_records" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建假期授予记录,向飞书人事休假系统写入假期授予记录 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave_granting_record/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateLeaveGrantingRecordSample.java ; - */ - public CreateLeaveGrantingRecordResp create(CreateLeaveGrantingRecordReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/leave_granting_records" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateLeaveGrantingRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateLeaveGrantingRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/leave_granting_records" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除假期授予记录,删除飞书人事休假系统中的假期授予记录(仅支持删除授予来源是「手动授予」或「外部系统授予」的记录) - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave_granting_record/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteLeaveGrantingRecordSample.java ; - */ - public DeleteLeaveGrantingRecordResp delete(DeleteLeaveGrantingRecordReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/leave_granting_records/:leave_granting_record_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteLeaveGrantingRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteLeaveGrantingRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/leave_granting_records/:leave_granting_record_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除假期授予记录,删除飞书人事休假系统中的假期授予记录(仅支持删除授予来源是「手动授予」或「外部系统授予」的记录) - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave_granting_record/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteLeaveGrantingRecordSample.java ; - */ - public DeleteLeaveGrantingRecordResp delete(DeleteLeaveGrantingRecordReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/leave_granting_records/:leave_granting_record_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteLeaveGrantingRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteLeaveGrantingRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/leave_granting_records/:leave_granting_record_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Location { - private final Config config; - - public Location(Config config) { - this.config = config; - } - - /** - * 创建地点,创建地点 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateLocationSample.java ; - */ - public CreateLocationResp create(CreateLocationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/locations" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateLocationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateLocationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/locations" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建地点,创建地点 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateLocationSample.java ; - */ - public CreateLocationResp create(CreateLocationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/locations" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateLocationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateLocationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/locations" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除地点,删除地点 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteLocationSample.java ; - */ - public DeleteLocationResp delete(DeleteLocationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/locations/:location_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteLocationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteLocationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/locations/:location_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除地点,删除地点 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteLocationSample.java ; - */ - public DeleteLocationResp delete(DeleteLocationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/locations/:location_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteLocationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteLocationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/locations/:location_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个地点,根据 ID 查询单个地点 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetLocationSample.java ; - */ - public GetLocationResp get(GetLocationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/locations/:location_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetLocationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetLocationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/locations/:location_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个地点,根据 ID 查询单个地点 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetLocationSample.java ; - */ - public GetLocationResp get(GetLocationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/locations/:location_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetLocationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetLocationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/locations/:location_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询地点,批量查询地点 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListLocationSample.java ; - */ - public ListLocationResp list(ListLocationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/locations" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListLocationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListLocationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/locations" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询地点,批量查询地点 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListLocationSample.java ; - */ - public ListLocationResp list(ListLocationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/locations" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListLocationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListLocationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/locations" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class NationalIdType { - private final Config config; - - public NationalIdType(Config config) { - this.config = config; - } - - /** - * 创建国家证件类型,创建国家证件类型 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateNationalIdTypeSample.java ; - */ - public CreateNationalIdTypeResp create(CreateNationalIdTypeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/national_id_types" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateNationalIdTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateNationalIdTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/national_id_types" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建国家证件类型,创建国家证件类型 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateNationalIdTypeSample.java ; - */ - public CreateNationalIdTypeResp create(CreateNationalIdTypeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/national_id_types" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateNationalIdTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateNationalIdTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/national_id_types" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除国家证件类型,删除国家证件类型 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteNationalIdTypeSample.java ; - */ - public DeleteNationalIdTypeResp delete(DeleteNationalIdTypeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/national_id_types/:national_id_type_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteNationalIdTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteNationalIdTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/national_id_types/:national_id_type_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除国家证件类型,删除国家证件类型 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteNationalIdTypeSample.java ; - */ - public DeleteNationalIdTypeResp delete(DeleteNationalIdTypeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/national_id_types/:national_id_type_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteNationalIdTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteNationalIdTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/national_id_types/:national_id_type_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个国家证件类型,根据 ID 查询单个国家证件类型 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetNationalIdTypeSample.java ; - */ - public GetNationalIdTypeResp get(GetNationalIdTypeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/national_id_types/:national_id_type_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetNationalIdTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetNationalIdTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/national_id_types/:national_id_type_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个国家证件类型,根据 ID 查询单个国家证件类型 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetNationalIdTypeSample.java ; - */ - public GetNationalIdTypeResp get(GetNationalIdTypeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/national_id_types/:national_id_type_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetNationalIdTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetNationalIdTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/national_id_types/:national_id_type_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询国家证件类型,批量查询国家证件类型 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListNationalIdTypeSample.java ; - */ - public ListNationalIdTypeResp list(ListNationalIdTypeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/national_id_types" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListNationalIdTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListNationalIdTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/national_id_types" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询国家证件类型,批量查询国家证件类型 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListNationalIdTypeSample.java ; - */ - public ListNationalIdTypeResp list(ListNationalIdTypeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/national_id_types" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListNationalIdTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListNationalIdTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/national_id_types" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新国家证件类型,更新国家证件类型 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchNationalIdTypeSample.java ; - */ - public PatchNationalIdTypeResp patch(PatchNationalIdTypeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/corehr/v1/national_id_types/:national_id_type_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchNationalIdTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchNationalIdTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/national_id_types/:national_id_type_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新国家证件类型,更新国家证件类型 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchNationalIdTypeSample.java ; - */ - public PatchNationalIdTypeResp patch(PatchNationalIdTypeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/corehr/v1/national_id_types/:national_id_type_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchNationalIdTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchNationalIdTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/national_id_types/:national_id_type_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Offboarding { - private final Config config; - - public Offboarding(Config config) { - this.config = config; - } - - /** - * 查询员工离职原因列表,查询「飞书人事」-「离职设置」中的离职原因 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/offboarding/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryOffboardingSample.java ; - */ - public QueryOffboardingResp query(QueryOffboardingReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/offboardings/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryOffboardingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryOffboardingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/offboardings/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询员工离职原因列表,查询「飞书人事」-「离职设置」中的离职原因 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/offboarding/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryOffboardingSample.java ; - */ - public QueryOffboardingResp query(QueryOffboardingReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/offboardings/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryOffboardingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryOffboardingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/offboardings/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * ,根据 雇佣 ID 查询员工离职信息 - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=offboarding&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/SearchOffboardingSample.java ; - */ - public SearchOffboardingResp search(SearchOffboardingReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/offboardings/search" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SearchOffboardingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchOffboardingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/offboardings/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * ,根据 雇佣 ID 查询员工离职信息 - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=offboarding&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/SearchOffboardingSample.java ; - */ - public SearchOffboardingResp search(SearchOffboardingReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/offboardings/search" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SearchOffboardingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchOffboardingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/offboardings/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 操作员工离职,操作员工直接离职 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/offboarding/submit ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/SubmitOffboardingSample.java ; - */ - public SubmitOffboardingResp submit(SubmitOffboardingReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/offboardings/submit" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SubmitOffboardingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubmitOffboardingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/offboardings/submit" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 操作员工离职,操作员工直接离职 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/offboarding/submit ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/SubmitOffboardingSample.java ; - */ - public SubmitOffboardingResp submit(SubmitOffboardingReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/offboardings/submit" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SubmitOffboardingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubmitOffboardingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/offboardings/submit" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class OrgRoleAuthorization { - private final Config config; - - public OrgRoleAuthorization(Config config) { - this.config = config; - } - } - - public static class Person { - private final Config config; - - public Person(Config config) { - this.config = config; - } - - /** - * 删除个人信息,删除人员的个人信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/person/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeletePersonSample.java ; - */ - public DeletePersonResp delete(DeletePersonReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/persons/:person_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeletePersonResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePersonResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/persons/:person_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除个人信息,删除人员的个人信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/person/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeletePersonSample.java ; - */ - public DeletePersonResp delete(DeletePersonReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/persons/:person_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeletePersonResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePersonResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/persons/:person_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个个人信息,根据 ID 查询单个人员的个人信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/person/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetPersonSample.java ; - */ - public GetPersonResp get(GetPersonReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/persons/:person_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetPersonResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetPersonResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/persons/:person_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个个人信息,根据 ID 查询单个人员的个人信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/person/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetPersonSample.java ; - */ - public GetPersonResp get(GetPersonReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/persons/:person_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetPersonResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetPersonResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/persons/:person_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 上传文件,上传文件 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/person/upload ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/UploadPersonSample.java ; - */ - public UploadPersonResp upload(UploadPersonReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/persons/upload" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UploadPersonResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadPersonResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/persons/upload" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 上传文件,上传文件 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/person/upload ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/UploadPersonSample.java ; - */ - public UploadPersonResp upload(UploadPersonReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/persons/upload" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UploadPersonResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadPersonResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/persons/upload" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class PreHire { - private final Config config; - - public PreHire(Config config) { - this.config = config; - } - - /** - * 删除待入职人员,删除待入职人员 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/pre_hire/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeletePreHireSample.java ; - */ - public DeletePreHireResp delete(DeletePreHireReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/pre_hires/:pre_hire_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeletePreHireResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePreHireResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/pre_hires/:pre_hire_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除待入职人员,删除待入职人员 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/pre_hire/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeletePreHireSample.java ; - */ - public DeletePreHireResp delete(DeletePreHireReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/pre_hires/:pre_hire_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeletePreHireResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePreHireResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/pre_hires/:pre_hire_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个待入职人员,根据 ID 查询单个待入职人员 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/pre_hire/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetPreHireSample.java ; - */ - public GetPreHireResp get(GetPreHireReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/pre_hires/:pre_hire_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetPreHireResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetPreHireResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/pre_hires/:pre_hire_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个待入职人员,根据 ID 查询单个待入职人员 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/pre_hire/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetPreHireSample.java ; - */ - public GetPreHireResp get(GetPreHireReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/pre_hires/:pre_hire_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetPreHireResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetPreHireResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/pre_hires/:pre_hire_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询待入职人员,批量查询待入职人员 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/pre_hire/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListPreHireSample.java ; - */ - public ListPreHireResp list(ListPreHireReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/pre_hires" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListPreHireResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPreHireResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/pre_hires" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询待入职人员,批量查询待入职人员 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/pre_hire/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListPreHireSample.java ; - */ - public ListPreHireResp list(ListPreHireReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/pre_hires" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListPreHireResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPreHireResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/pre_hires" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新待入职数据,更新待入职数据 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/pre_hire/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchPreHireSample.java ; - */ - public PatchPreHireResp patch(PatchPreHireReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/corehr/v1/pre_hires/:pre_hire_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchPreHireResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchPreHireResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/pre_hires/:pre_hire_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新待入职数据,更新待入职数据 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/pre_hire/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchPreHireSample.java ; - */ - public PatchPreHireResp patch(PatchPreHireReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/corehr/v1/pre_hires/:pre_hire_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchPreHireResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchPreHireResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/pre_hires/:pre_hire_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ProcessFormVariableData { - private final Config config; - - public ProcessFormVariableData(Config config) { - this.config = config; - } - - /** - * 获取流程表单数据,获取流程表单数据 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/process-form_variable_data/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetProcessFormVariableDataSample.java ; - */ - public GetProcessFormVariableDataResp get(GetProcessFormVariableDataReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/processes/:process_id/form_variable_data" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetProcessFormVariableDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetProcessFormVariableDataResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/processes/:process_id/form_variable_data" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取流程表单数据,获取流程表单数据 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/process-form_variable_data/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetProcessFormVariableDataSample.java ; - */ - public GetProcessFormVariableDataResp get(GetProcessFormVariableDataReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/processes/:process_id/form_variable_data" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetProcessFormVariableDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetProcessFormVariableDataResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/processes/:process_id/form_variable_data" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class SecurityGroup { - private final Config config; - - public SecurityGroup(Config config) { - this.config = config; - } - - /** - * 批量获取角色列表,批量查询「飞书人事」-「权限设置」-「角色设置」中的角色列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/security_group/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListSecurityGroupSample.java ; - */ - public ListSecurityGroupResp list(ListSecurityGroupReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/security_groups" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListSecurityGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListSecurityGroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/security_groups" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量获取角色列表,批量查询「飞书人事」-「权限设置」-「角色设置」中的角色列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/security_group/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListSecurityGroupSample.java ; - */ - public ListSecurityGroupResp list(ListSecurityGroupReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/security_groups" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListSecurityGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListSecurityGroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/security_groups" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * HRBP/属地 BP 查询,通过部门或工作地点,查询对应的 HRBP/属地 BP - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/security_group/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QuerySecurityGroupSample.java ; - */ - public QuerySecurityGroupResp query(QuerySecurityGroupReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/security_groups/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QuerySecurityGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QuerySecurityGroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/security_groups/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * HRBP/属地 BP 查询,通过部门或工作地点,查询对应的 HRBP/属地 BP - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/security_group/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QuerySecurityGroupSample.java ; - */ - public QuerySecurityGroupResp query(QuerySecurityGroupReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/security_groups/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QuerySecurityGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QuerySecurityGroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/security_groups/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Subdivision { - private final Config config; - - public Subdivision(Config config) { - this.config = config; - } - - /** - * 查询单条省份/行政区信息,查询单条省份/行政区信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/subdivision/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetSubdivisionSample.java ; - */ - public GetSubdivisionResp get(GetSubdivisionReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/subdivisions/:subdivision_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetSubdivisionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSubdivisionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/subdivisions/:subdivision_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单条省份/行政区信息,查询单条省份/行政区信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/subdivision/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetSubdivisionSample.java ; - */ - public GetSubdivisionResp get(GetSubdivisionReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/subdivisions/:subdivision_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetSubdivisionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSubdivisionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/subdivisions/:subdivision_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询省份/行政区信息,批量查询省份/行政区信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/subdivision/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListSubdivisionSample.java ; - */ - public ListSubdivisionResp list(ListSubdivisionReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/subdivisions" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListSubdivisionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListSubdivisionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/subdivisions" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询省份/行政区信息,批量查询省份/行政区信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/subdivision/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListSubdivisionSample.java ; - */ - public ListSubdivisionResp list(ListSubdivisionReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/subdivisions" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListSubdivisionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListSubdivisionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/subdivisions" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Subregion { - private final Config config; - - public Subregion(Config config) { - this.config = config; - } - - /** - * 查询单条城市/区域信息,查询单条城市/区域信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/subregion/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetSubregionSample.java ; - */ - public GetSubregionResp get(GetSubregionReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/subregions/:subregion_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetSubregionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSubregionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/subregions/:subregion_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单条城市/区域信息,查询单条城市/区域信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/subregion/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetSubregionSample.java ; - */ - public GetSubregionResp get(GetSubregionReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/subregions/:subregion_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetSubregionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSubregionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/subregions/:subregion_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询城市/区域信息,批量查询城市/区域信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/subregion/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListSubregionSample.java ; - */ - public ListSubregionResp list(ListSubregionReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/subregions" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListSubregionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListSubregionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/subregions" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询城市/区域信息,批量查询城市/区域信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/subregion/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListSubregionSample.java ; - */ - public ListSubregionResp list(ListSubregionReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/subregions" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListSubregionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListSubregionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/subregions" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class TransferReason { - private final Config config; - - public TransferReason(Config config) { - this.config = config; - } - - /** - * 获取异动原因列表,获取异动原因列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/transfer_reason/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryTransferReasonSample.java ; - */ - public QueryTransferReasonResp query(QueryTransferReasonReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/transfer_reasons/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryTransferReasonResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryTransferReasonResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/transfer_reasons/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取异动原因列表,获取异动原因列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/transfer_reason/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryTransferReasonSample.java ; - */ - public QueryTransferReasonResp query(QueryTransferReasonReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/transfer_reasons/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryTransferReasonResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryTransferReasonResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/transfer_reasons/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class TransferType { - private final Config config; - - public TransferType(Config config) { - this.config = config; - } - - /** - * 获取异动类型列表,获取异动类型列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/transfer_type/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryTransferTypeSample.java ; - */ - public QueryTransferTypeResp query(QueryTransferTypeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/transfer_types/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryTransferTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryTransferTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/transfer_types/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取异动类型列表,获取异动类型列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/transfer_type/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryTransferTypeSample.java ; - */ - public QueryTransferTypeResp query(QueryTransferTypeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/transfer_types/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryTransferTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryTransferTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/transfer_types/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class WorkingHoursType { - private final Config config; - - public WorkingHoursType(Config config) { - this.config = config; - } - - /** - * 创建工时制度,创建工时制度 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateWorkingHoursTypeSample.java ; - */ - public CreateWorkingHoursTypeResp create(CreateWorkingHoursTypeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/working_hours_types" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateWorkingHoursTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateWorkingHoursTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/working_hours_types" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建工时制度,创建工时制度 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateWorkingHoursTypeSample.java ; - */ - public CreateWorkingHoursTypeResp create(CreateWorkingHoursTypeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/corehr/v1/working_hours_types" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateWorkingHoursTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateWorkingHoursTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/working_hours_types" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除工时制度,删除工时制度 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteWorkingHoursTypeSample.java ; - */ - public DeleteWorkingHoursTypeResp delete(DeleteWorkingHoursTypeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/working_hours_types/:working_hours_type_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteWorkingHoursTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteWorkingHoursTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/working_hours_types/:working_hours_type_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除工时制度,删除工时制度 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteWorkingHoursTypeSample.java ; - */ - public DeleteWorkingHoursTypeResp delete(DeleteWorkingHoursTypeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/corehr/v1/working_hours_types/:working_hours_type_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteWorkingHoursTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteWorkingHoursTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/working_hours_types/:working_hours_type_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个工时制度,根据 ID 查询单个工时制度 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetWorkingHoursTypeSample.java ; - */ - public GetWorkingHoursTypeResp get(GetWorkingHoursTypeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/working_hours_types/:working_hours_type_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetWorkingHoursTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetWorkingHoursTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/working_hours_types/:working_hours_type_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询单个工时制度,根据 ID 查询单个工时制度 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetWorkingHoursTypeSample.java ; - */ - public GetWorkingHoursTypeResp get(GetWorkingHoursTypeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/working_hours_types/:working_hours_type_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetWorkingHoursTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetWorkingHoursTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/working_hours_types/:working_hours_type_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询工时制度,批量查询工时制度 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListWorkingHoursTypeSample.java ; - */ - public ListWorkingHoursTypeResp list(ListWorkingHoursTypeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/working_hours_types" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListWorkingHoursTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListWorkingHoursTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/working_hours_types" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询工时制度,批量查询工时制度 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListWorkingHoursTypeSample.java ; - */ - public ListWorkingHoursTypeResp list(ListWorkingHoursTypeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/corehr/v1/working_hours_types" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListWorkingHoursTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListWorkingHoursTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/working_hours_types" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新工时制度,更新工时制度 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchWorkingHoursTypeSample.java ; - */ - public PatchWorkingHoursTypeResp patch(PatchWorkingHoursTypeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/corehr/v1/working_hours_types/:working_hours_type_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchWorkingHoursTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchWorkingHoursTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/working_hours_types/:working_hours_type_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新工时制度,更新工时制度 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchWorkingHoursTypeSample.java ; - */ - public PatchWorkingHoursTypeResp patch(PatchWorkingHoursTypeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/corehr/v1/working_hours_types/:working_hours_type_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchWorkingHoursTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchWorkingHoursTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/working_hours_types/:working_hours_type_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public abstract static class P2ContractCreatedV1Handler implements IEventHandler { - @Override - public P2ContractCreatedV1 getEvent() { - return new P2ContractCreatedV1(); - } - } - - public abstract static class P2ContractDeletedV1Handler implements IEventHandler { - @Override - public P2ContractDeletedV1 getEvent() { - return new P2ContractDeletedV1(); - } - } - - public abstract static class P2ContractUpdatedV1Handler implements IEventHandler { - @Override - public P2ContractUpdatedV1 getEvent() { - return new P2ContractUpdatedV1(); - } - } - - public abstract static class P2DepartmentCreatedV1Handler implements IEventHandler { - @Override - public P2DepartmentCreatedV1 getEvent() { - return new P2DepartmentCreatedV1(); - } - } - - public abstract static class P2DepartmentDeletedV1Handler implements IEventHandler { - @Override - public P2DepartmentDeletedV1 getEvent() { - return new P2DepartmentDeletedV1(); - } - } - - public abstract static class P2DepartmentUpdatedV1Handler implements IEventHandler { - @Override - public P2DepartmentUpdatedV1 getEvent() { - return new P2DepartmentUpdatedV1(); - } - } - - public abstract static class P2EmploymentConvertedV1Handler implements IEventHandler { - @Override - public P2EmploymentConvertedV1 getEvent() { - return new P2EmploymentConvertedV1(); - } - } - - public abstract static class P2EmploymentCreatedV1Handler implements IEventHandler { - @Override - public P2EmploymentCreatedV1 getEvent() { - return new P2EmploymentCreatedV1(); - } - } - - public abstract static class P2EmploymentDeletedV1Handler implements IEventHandler { - @Override - public P2EmploymentDeletedV1 getEvent() { - return new P2EmploymentDeletedV1(); - } - } - - public abstract static class P2EmploymentResignedV1Handler implements IEventHandler { - @Override - public P2EmploymentResignedV1 getEvent() { - return new P2EmploymentResignedV1(); - } - } - - public abstract static class P2EmploymentUpdatedV1Handler implements IEventHandler { - @Override - public P2EmploymentUpdatedV1 getEvent() { - return new P2EmploymentUpdatedV1(); - } - } - - public abstract static class P2JobChangeUpdatedV1Handler implements IEventHandler { - @Override - public P2JobChangeUpdatedV1 getEvent() { - return new P2JobChangeUpdatedV1(); - } - } - - public abstract static class P2JobDataChangedV1Handler implements IEventHandler { - @Override - public P2JobDataChangedV1 getEvent() { - return new P2JobDataChangedV1(); - } - } - - public abstract static class P2JobDataEmployedV1Handler implements IEventHandler { - @Override - public P2JobDataEmployedV1 getEvent() { - return new P2JobDataEmployedV1(); - } - } - - public abstract static class P2OffboardingUpdatedV1Handler implements IEventHandler { - @Override - public P2OffboardingUpdatedV1 getEvent() { - return new P2OffboardingUpdatedV1(); - } - } - - public abstract static class P2OrgRoleAuthorizationUpdatedV1Handler implements IEventHandler { - @Override - public P2OrgRoleAuthorizationUpdatedV1 getEvent() { - return new P2OrgRoleAuthorizationUpdatedV1(); - } - } - - public abstract static class P2PersonCreatedV1Handler implements IEventHandler { - @Override - public P2PersonCreatedV1 getEvent() { - return new P2PersonCreatedV1(); - } - } - - public abstract static class P2PersonDeletedV1Handler implements IEventHandler { - @Override - public P2PersonDeletedV1 getEvent() { - return new P2PersonDeletedV1(); - } - } - - public abstract static class P2PersonUpdatedV1Handler implements IEventHandler { - @Override - public P2PersonUpdatedV1 getEvent() { - return new P2PersonUpdatedV1(); - } - } - - public abstract static class P2PreHireUpdatedV1Handler implements IEventHandler { - @Override - public P2PreHireUpdatedV1 getEvent() { - return new P2PreHireUpdatedV1(); - } - } -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/V1.java new file mode 100644 index 000000000..127cdaf03 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/V1.java @@ -0,0 +1,209 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.corehr.v1.resource.*; + +public class V1 { + private final AssignedUser assignedUser; // assigned_user + private final Company company; // 公司 + private final CompensationStandard compensationStandard; // compensation_standard + private final Contract contract; // 合同 + private final CountryRegion countryRegion; // 地理库信息 + private final Currency currency; // 货币信息 + private final CustomField customField; // 自定义字段 + private final Department department; // 部门 + private final EmployeeType employeeType; // 人员类型 + private final Employment employment; // 雇佣信息 + private final File file; // file + private final Job job; // 职务 + private final JobChange jobChange; // 异动信息 + private final JobData jobData; // 任职信息 + private final JobFamily jobFamily; // 职务序列 + private final JobLevel jobLevel; // 职务级别 + private final Leave leave; // 休假管理 + private final LeaveGrantingRecord leaveGrantingRecord; // leave_granting_record + private final Location location; // 地点 + private final NationalIdType nationalIdType; // 国家证件类型 + private final Offboarding offboarding; // 员工离职 + private final OrgRoleAuthorization orgRoleAuthorization; // org_role_authorization + private final Person person; // 个人信息 + private final PreHire preHire; // 待入职 + private final ProcessFormVariableData processFormVariableData; // 流程管理 + private final SecurityGroup securityGroup; // security_group + private final Subdivision subdivision; // 地理库信息 + private final Subregion subregion; // 地理库信息 + private final TransferReason transferReason; // 异动原因 + private final TransferType transferType; // 异动类型 + private final WorkingHoursType workingHoursType; // 工时制度 + + public V1(Config config) { + this.assignedUser = new AssignedUser(config); + this.company = new Company(config); + this.compensationStandard = new CompensationStandard(config); + this.contract = new Contract(config); + this.countryRegion = new CountryRegion(config); + this.currency = new Currency(config); + this.customField = new CustomField(config); + this.department = new Department(config); + this.employeeType = new EmployeeType(config); + this.employment = new Employment(config); + this.file = new File(config); + this.job = new Job(config); + this.jobChange = new JobChange(config); + this.jobData = new JobData(config); + this.jobFamily = new JobFamily(config); + this.jobLevel = new JobLevel(config); + this.leave = new Leave(config); + this.leaveGrantingRecord = new LeaveGrantingRecord(config); + this.location = new Location(config); + this.nationalIdType = new NationalIdType(config); + this.offboarding = new Offboarding(config); + this.orgRoleAuthorization = new OrgRoleAuthorization(config); + this.person = new Person(config); + this.preHire = new PreHire(config); + this.processFormVariableData = new ProcessFormVariableData(config); + this.securityGroup = new SecurityGroup(config); + this.subdivision = new Subdivision(config); + this.subregion = new Subregion(config); + this.transferReason = new TransferReason(config); + this.transferType = new TransferType(config); + this.workingHoursType = new WorkingHoursType(config); + } + + public AssignedUser assignedUser() { + return assignedUser; + } + + public Company company() { + return company; + } + + public CompensationStandard compensationStandard() { + return compensationStandard; + } + + public Contract contract() { + return contract; + } + + public CountryRegion countryRegion() { + return countryRegion; + } + + public Currency currency() { + return currency; + } + + public CustomField customField() { + return customField; + } + + public Department department() { + return department; + } + + public EmployeeType employeeType() { + return employeeType; + } + + public Employment employment() { + return employment; + } + + public File file() { + return file; + } + + public Job job() { + return job; + } + + public JobChange jobChange() { + return jobChange; + } + + public JobData jobData() { + return jobData; + } + + public JobFamily jobFamily() { + return jobFamily; + } + + public JobLevel jobLevel() { + return jobLevel; + } + + public Leave leave() { + return leave; + } + + public LeaveGrantingRecord leaveGrantingRecord() { + return leaveGrantingRecord; + } + + public Location location() { + return location; + } + + public NationalIdType nationalIdType() { + return nationalIdType; + } + + public Offboarding offboarding() { + return offboarding; + } + + public OrgRoleAuthorization orgRoleAuthorization() { + return orgRoleAuthorization; + } + + public Person person() { + return person; + } + + public PreHire preHire() { + return preHire; + } + + public ProcessFormVariableData processFormVariableData() { + return processFormVariableData; + } + + public SecurityGroup securityGroup() { + return securityGroup; + } + + public Subdivision subdivision() { + return subdivision; + } + + public Subregion subregion() { + return subregion; + } + + public TransferReason transferReason() { + return transferReason; + } + + public TransferType transferType() { + return transferType; + } + + public WorkingHoursType workingHoursType() { + return workingHoursType; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/Company.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/Company.java index 5ea5964de..066839c78 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/Company.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/Company.java @@ -88,6 +88,36 @@ public class Company { */ @SerializedName("custom_fields") private ObjectFieldData[] customFields; + /** + * 默认币种 + *

示例值: + */ + @SerializedName("currency") + private Currency currency; + /** + * 电话 + *

示例值: + */ + @SerializedName("phone") + private PhoneNumberAndAreaCode phone; + /** + * 传真 + *

示例值: + */ + @SerializedName("fax") + private PhoneNumberAndAreaCode fax; + /** + * 注册地址 + *

示例值: + */ + @SerializedName("registered_office_address") + private I18n[] registeredOfficeAddress; + /** + * 办公地址 + *

示例值: + */ + @SerializedName("office_address") + private I18n[] officeAddress; // builder 开始 public Company() { @@ -154,6 +184,31 @@ public Company(Builder builder) { *

示例值: */ this.customFields = builder.customFields; + /** + * 默认币种 + *

示例值: + */ + this.currency = builder.currency; + /** + * 电话 + *

示例值: + */ + this.phone = builder.phone; + /** + * 传真 + *

示例值: + */ + this.fax = builder.fax; + /** + * 注册地址 + *

示例值: + */ + this.registeredOfficeAddress = builder.registeredOfficeAddress; + /** + * 办公地址 + *

示例值: + */ + this.officeAddress = builder.officeAddress; } public static Builder newBuilder() { @@ -256,6 +311,46 @@ public void setCustomFields(ObjectFieldData[] customFields) { this.customFields = customFields; } + public Currency getCurrency() { + return this.currency; + } + + public void setCurrency(Currency currency) { + this.currency = currency; + } + + public PhoneNumberAndAreaCode getPhone() { + return this.phone; + } + + public void setPhone(PhoneNumberAndAreaCode phone) { + this.phone = phone; + } + + public PhoneNumberAndAreaCode getFax() { + return this.fax; + } + + public void setFax(PhoneNumberAndAreaCode fax) { + this.fax = fax; + } + + public I18n[] getRegisteredOfficeAddress() { + return this.registeredOfficeAddress; + } + + public void setRegisteredOfficeAddress(I18n[] registeredOfficeAddress) { + this.registeredOfficeAddress = registeredOfficeAddress; + } + + public I18n[] getOfficeAddress() { + return this.officeAddress; + } + + public void setOfficeAddress(I18n[] officeAddress) { + this.officeAddress = officeAddress; + } + public static class Builder { /** * 公司 ID @@ -317,6 +412,31 @@ public static class Builder { *

示例值: */ private ObjectFieldData[] customFields; + /** + * 默认币种 + *

示例值: + */ + private Currency currency; + /** + * 电话 + *

示例值: + */ + private PhoneNumberAndAreaCode phone; + /** + * 传真 + *

示例值: + */ + private PhoneNumberAndAreaCode fax; + /** + * 注册地址 + *

示例值: + */ + private I18n[] registeredOfficeAddress; + /** + * 办公地址 + *

示例值: + */ + private I18n[] officeAddress; /** * 公司 ID @@ -474,6 +594,71 @@ public Builder customFields(ObjectFieldData[] customFields) { } + /** + * 默认币种 + *

示例值: + * + * @param currency + * @return + */ + public Builder currency(Currency currency) { + this.currency = currency; + return this; + } + + + /** + * 电话 + *

示例值: + * + * @param phone + * @return + */ + public Builder phone(PhoneNumberAndAreaCode phone) { + this.phone = phone; + return this; + } + + + /** + * 传真 + *

示例值: + * + * @param fax + * @return + */ + public Builder fax(PhoneNumberAndAreaCode fax) { + this.fax = fax; + return this; + } + + + /** + * 注册地址 + *

示例值: + * + * @param registeredOfficeAddress + * @return + */ + public Builder registeredOfficeAddress(I18n[] registeredOfficeAddress) { + this.registeredOfficeAddress = registeredOfficeAddress; + return this; + } + + + /** + * 办公地址 + *

示例值: + * + * @param officeAddress + * @return + */ + public Builder officeAddress(I18n[] officeAddress) { + this.officeAddress = officeAddress; + return this; + } + + public Company build() { return new Company(this); } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/CreateJobChangeReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/CreateJobChangeReqBody.java index b1a7895d7..3705c078c 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/CreateJobChangeReqBody.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/CreateJobChangeReqBody.java @@ -234,6 +234,7 @@ public Builder transferMode(Integer transferMode) { return this; } + /** * 雇员id *

示例值:ou_a294793e8fa21529f2a60e3e9de45520 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/LeaveRequest.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/LeaveRequest.java index 1f93f6b99..09f9eac7e 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/LeaveRequest.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/LeaveRequest.java @@ -154,6 +154,30 @@ public class LeaveRequest { */ @SerializedName("data_source") private Integer dataSource; + /** + * 请假申请流程ID + *

示例值: + */ + @SerializedName("leave_process_id") + private String[] leaveProcessId; + /** + * 请假更正流程ID + *

示例值: + */ + @SerializedName("leave_correct_process_id") + private String[] leaveCorrectProcessId; + /** + * 请假取消流程ID + *

示例值: + */ + @SerializedName("leave_cancel_process_id") + private String[] leaveCancelProcessId; + /** + * 请假返岗流程ID + *

示例值: + */ + @SerializedName("leave_return_process_id") + private String[] leaveReturnProcessId; // builder 开始 public LeaveRequest() { @@ -275,6 +299,26 @@ public LeaveRequest(Builder builder) { *

示例值:1 */ this.dataSource = builder.dataSource; + /** + * 请假申请流程ID + *

示例值: + */ + this.leaveProcessId = builder.leaveProcessId; + /** + * 请假更正流程ID + *

示例值: + */ + this.leaveCorrectProcessId = builder.leaveCorrectProcessId; + /** + * 请假取消流程ID + *

示例值: + */ + this.leaveCancelProcessId = builder.leaveCancelProcessId; + /** + * 请假返岗流程ID + *

示例值: + */ + this.leaveReturnProcessId = builder.leaveReturnProcessId; } public static Builder newBuilder() { @@ -465,6 +509,38 @@ public void setDataSource(Integer dataSource) { this.dataSource = dataSource; } + public String[] getLeaveProcessId() { + return this.leaveProcessId; + } + + public void setLeaveProcessId(String[] leaveProcessId) { + this.leaveProcessId = leaveProcessId; + } + + public String[] getLeaveCorrectProcessId() { + return this.leaveCorrectProcessId; + } + + public void setLeaveCorrectProcessId(String[] leaveCorrectProcessId) { + this.leaveCorrectProcessId = leaveCorrectProcessId; + } + + public String[] getLeaveCancelProcessId() { + return this.leaveCancelProcessId; + } + + public void setLeaveCancelProcessId(String[] leaveCancelProcessId) { + this.leaveCancelProcessId = leaveCancelProcessId; + } + + public String[] getLeaveReturnProcessId() { + return this.leaveReturnProcessId; + } + + public void setLeaveReturnProcessId(String[] leaveReturnProcessId) { + this.leaveReturnProcessId = leaveReturnProcessId; + } + public static class Builder { /** * 请假记录ID @@ -581,6 +657,26 @@ public static class Builder { *

示例值:1 */ private Integer dataSource; + /** + * 请假申请流程ID + *

示例值: + */ + private String[] leaveProcessId; + /** + * 请假更正流程ID + *

示例值: + */ + private String[] leaveCorrectProcessId; + /** + * 请假取消流程ID + *

示例值: + */ + private String[] leaveCancelProcessId; + /** + * 请假返岗流程ID + *

示例值: + */ + private String[] leaveReturnProcessId; /** * 请假记录ID @@ -881,6 +977,58 @@ public Builder dataSource(Integer dataSource) { } + /** + * 请假申请流程ID + *

示例值: + * + * @param leaveProcessId + * @return + */ + public Builder leaveProcessId(String[] leaveProcessId) { + this.leaveProcessId = leaveProcessId; + return this; + } + + + /** + * 请假更正流程ID + *

示例值: + * + * @param leaveCorrectProcessId + * @return + */ + public Builder leaveCorrectProcessId(String[] leaveCorrectProcessId) { + this.leaveCorrectProcessId = leaveCorrectProcessId; + return this; + } + + + /** + * 请假取消流程ID + *

示例值: + * + * @param leaveCancelProcessId + * @return + */ + public Builder leaveCancelProcessId(String[] leaveCancelProcessId) { + this.leaveCancelProcessId = leaveCancelProcessId; + return this; + } + + + /** + * 请假返岗流程ID + *

示例值: + * + * @param leaveReturnProcessId + * @return + */ + public Builder leaveReturnProcessId(String[] leaveReturnProcessId) { + this.leaveReturnProcessId = leaveReturnProcessId; + return this; + } + + public LeaveRequest build() { return new LeaveRequest(this); } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/Offboarding.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/Offboarding.java index 40f15c4c3..d5a57acdc 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/Offboarding.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/Offboarding.java @@ -46,6 +46,12 @@ public class Offboarding { */ @SerializedName("offboarding_checklist") private OffboardingChecklist offboardingChecklist; + /** + * 离职单据ID + *

示例值:7298499290417251879 + */ + @SerializedName("offboarding_id") + private String offboardingId; // builder 开始 public Offboarding() { @@ -77,6 +83,11 @@ public Offboarding(Builder builder) { *

示例值: */ this.offboardingChecklist = builder.offboardingChecklist; + /** + * 离职单据ID + *

示例值:7298499290417251879 + */ + this.offboardingId = builder.offboardingId; } public static Builder newBuilder() { @@ -123,6 +134,14 @@ public void setOffboardingChecklist(OffboardingChecklist offboardingChecklist) { this.offboardingChecklist = offboardingChecklist; } + public String getOffboardingId() { + return this.offboardingId; + } + + public void setOffboardingId(String offboardingId) { + this.offboardingId = offboardingId; + } + public static class Builder { /** * 离职发起类型,包括: @@ -149,6 +168,11 @@ public static class Builder { *

示例值: */ private OffboardingChecklist offboardingChecklist; + /** + * 离职单据ID + *

示例值:7298499290417251879 + */ + private String offboardingId; /** * 离职发起类型,包括: @@ -227,6 +251,19 @@ public Builder offboardingChecklist(OffboardingChecklist offboardingChecklist) { } + /** + * 离职单据ID + *

示例值:7298499290417251879 + * + * @param offboardingId + * @return + */ + public Builder offboardingId(String offboardingId) { + this.offboardingId = offboardingId; + return this; + } + + public Offboarding build() { return new Offboarding(this); } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/P2JobCreatedV1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/P2JobCreatedV1.java new file mode 100644 index 000000000..67e4153fb --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/P2JobCreatedV1.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.event.model.BaseEventV2; + +public class P2JobCreatedV1 extends BaseEventV2 { + /** + *

示例值: + */ + @SerializedName("event") + private P2JobCreatedV1Data event; + + public P2JobCreatedV1Data getEvent() { + return this.event; + } + + public void setEvent(P2JobCreatedV1Data event) { + this.event = event; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/P2JobCreatedV1Data.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/P2JobCreatedV1Data.java new file mode 100644 index 000000000..03692b66b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/P2JobCreatedV1Data.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class P2JobCreatedV1Data { + /** + * Job ID + *

示例值:201571108 + */ + @SerializedName("job_id") + private String jobId; + + public String getJobId() { + return this.jobId; + } + + public void setJobId(String jobId) { + this.jobId = jobId; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/P2JobDeletedV1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/P2JobDeletedV1.java new file mode 100644 index 000000000..d0aa9e62c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/P2JobDeletedV1.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.event.model.BaseEventV2; + +public class P2JobDeletedV1 extends BaseEventV2 { + /** + *

示例值: + */ + @SerializedName("event") + private P2JobDeletedV1Data event; + + public P2JobDeletedV1Data getEvent() { + return this.event; + } + + public void setEvent(P2JobDeletedV1Data event) { + this.event = event; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/P2JobDeletedV1Data.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/P2JobDeletedV1Data.java new file mode 100644 index 000000000..0662d388a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/P2JobDeletedV1Data.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class P2JobDeletedV1Data { + /** + * Job ID + *

示例值:201571108 + */ + @SerializedName("job_id") + private String jobId; + + public String getJobId() { + return this.jobId; + } + + public void setJobId(String jobId) { + this.jobId = jobId; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/P2JobUpdatedV1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/P2JobUpdatedV1.java new file mode 100644 index 000000000..5e023d6ec --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/P2JobUpdatedV1.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.event.model.BaseEventV2; + +public class P2JobUpdatedV1 extends BaseEventV2 { + /** + *

示例值: + */ + @SerializedName("event") + private P2JobUpdatedV1Data event; + + public P2JobUpdatedV1Data getEvent() { + return this.event; + } + + public void setEvent(P2JobUpdatedV1Data event) { + this.event = event; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/P2JobUpdatedV1Data.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/P2JobUpdatedV1Data.java new file mode 100644 index 000000000..7dbca2af9 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/P2JobUpdatedV1Data.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class P2JobUpdatedV1Data { + /** + * Job ID + *

示例值:201571108 + */ + @SerializedName("job_id") + private String jobId; + + public String getJobId() { + return this.jobId; + } + + public void setJobId(String jobId) { + this.jobId = jobId; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/PatchCompanyReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/PatchCompanyReq.java new file mode 100644 index 000000000..75c6a5936 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/PatchCompanyReq.java @@ -0,0 +1,133 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class PatchCompanyReq { + /** + * 根据client_token是否一致来判断是否为同一请求 + *

示例值:12454646 + */ + @Query + @SerializedName("client_token") + private String clientToken; + /** + * 需要更新的公司 ID + *

示例值:1616161616 + */ + @Path + @SerializedName("company_id") + private String companyId; + @Body + private Company body; + + // builder 开始 + public PatchCompanyReq() { + } + + public PatchCompanyReq(Builder builder) { + /** + * 根据client_token是否一致来判断是否为同一请求 + *

示例值:12454646 + */ + this.clientToken = builder.clientToken; + /** + * 需要更新的公司 ID + *

示例值:1616161616 + */ + this.companyId = builder.companyId; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getClientToken() { + return this.clientToken; + } + + public void setClientToken(String clientToken) { + this.clientToken = clientToken; + } + + public String getCompanyId() { + return this.companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + public Company getCompany() { + return this.body; + } + + public void setCompany(Company body) { + this.body = body; + } + + public static class Builder { + private String clientToken; // 根据client_token是否一致来判断是否为同一请求 + private String companyId; // 需要更新的公司 ID + private Company body; + + /** + * 根据client_token是否一致来判断是否为同一请求 + *

示例值:12454646 + * + * @param clientToken + * @return + */ + public Builder clientToken(String clientToken) { + this.clientToken = clientToken; + return this; + } + + /** + * 需要更新的公司 ID + *

示例值:1616161616 + * + * @param companyId + * @return + */ + public Builder companyId(String companyId) { + this.companyId = companyId; + return this; + } + + public Company getCompany() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder company(Company body) { + this.body = body; + return this; + } + + public PatchCompanyReq build() { + return new PatchCompanyReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/PatchCompanyResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/PatchCompanyResp.java new file mode 100644 index 000000000..255acacbd --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/PatchCompanyResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class PatchCompanyResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/PatchCompanyRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/PatchCompanyRespBody.java new file mode 100644 index 000000000..61952f2b7 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/PatchCompanyRespBody.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class PatchCompanyRespBody { + /** + *

示例值: + */ + @SerializedName("company") + private Company company; + + public Company getCompany() { + return this.company; + } + + public void setCompany(Company company) { + this.company = company; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/PhoneNumberAndAreaCode.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/PhoneNumberAndAreaCode.java new file mode 100644 index 000000000..04f9faf1e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/PhoneNumberAndAreaCode.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class PhoneNumberAndAreaCode { + /** + * 区号 + *

示例值:123123 + */ + @SerializedName("area_code") + private Enum areaCode; + /** + * 号码 + *

示例值:213213 + */ + @SerializedName("phone_number") + private String phoneNumber; + + // builder 开始 + public PhoneNumberAndAreaCode() { + } + + public PhoneNumberAndAreaCode(Builder builder) { + /** + * 区号 + *

示例值:123123 + */ + this.areaCode = builder.areaCode; + /** + * 号码 + *

示例值:213213 + */ + this.phoneNumber = builder.phoneNumber; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Enum getAreaCode() { + return this.areaCode; + } + + public void setAreaCode(Enum areaCode) { + this.areaCode = areaCode; + } + + public String getPhoneNumber() { + return this.phoneNumber; + } + + public void setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + public static class Builder { + /** + * 区号 + *

示例值:123123 + */ + private Enum areaCode; + /** + * 号码 + *

示例值:213213 + */ + private String phoneNumber; + + /** + * 区号 + *

示例值:123123 + * + * @param areaCode + * @return + */ + public Builder areaCode(Enum areaCode) { + this.areaCode = areaCode; + return this; + } + + + /** + * 号码 + *

示例值:213213 + * + * @param phoneNumber + * @return + */ + public Builder phoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + + public PhoneNumberAndAreaCode build() { + return new PhoneNumberAndAreaCode(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/TransferInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/TransferInfo.java index c14287605..93c48bccf 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/TransferInfo.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/model/TransferInfo.java @@ -304,6 +304,18 @@ public class TransferInfo { */ @SerializedName("target_employment_change") private TranferEmploymentInfo targetEmploymentChange; + /** + * 原职等 + *

示例值:7289005963599693366 + */ + @SerializedName("original_job_grade") + private String originalJobGrade; + /** + * 新职等 + *

示例值:7289005963599693366 + */ + @SerializedName("target_job_grade") + private String targetJobGrade; // builder 开始 public TransferInfo() { @@ -550,6 +562,16 @@ public TransferInfo(Builder builder) { *

示例值: */ this.targetEmploymentChange = builder.targetEmploymentChange; + /** + * 原职等 + *

示例值:7289005963599693366 + */ + this.originalJobGrade = builder.originalJobGrade; + /** + * 新职等 + *

示例值:7289005963599693366 + */ + this.targetJobGrade = builder.targetJobGrade; } public static Builder newBuilder() { @@ -940,6 +962,22 @@ public void setTargetEmploymentChange(TranferEmploymentInfo targetEmploymentChan this.targetEmploymentChange = targetEmploymentChange; } + public String getOriginalJobGrade() { + return this.originalJobGrade; + } + + public void setOriginalJobGrade(String originalJobGrade) { + this.originalJobGrade = originalJobGrade; + } + + public String getTargetJobGrade() { + return this.targetJobGrade; + } + + public void setTargetJobGrade(String targetJobGrade) { + this.targetJobGrade = targetJobGrade; + } + public static class Builder { /** * 备注 @@ -1181,6 +1219,16 @@ public static class Builder { *

示例值: */ private TranferEmploymentInfo targetEmploymentChange; + /** + * 原职等 + *

示例值:7289005963599693366 + */ + private String originalJobGrade; + /** + * 新职等 + *

示例值:7289005963599693366 + */ + private String targetJobGrade; /** * 备注 @@ -1806,6 +1854,32 @@ public Builder targetEmploymentChange(TranferEmploymentInfo targetEmploymentChan } + /** + * 原职等 + *

示例值:7289005963599693366 + * + * @param originalJobGrade + * @return + */ + public Builder originalJobGrade(String originalJobGrade) { + this.originalJobGrade = originalJobGrade; + return this; + } + + + /** + * 新职等 + *

示例值:7289005963599693366 + * + * @param targetJobGrade + * @return + */ + public Builder targetJobGrade(String targetJobGrade) { + this.targetJobGrade = targetJobGrade; + return this; + } + + public TransferInfo build() { return new TransferInfo(this); } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/AssignedUser.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/AssignedUser.java new file mode 100644 index 000000000..906b5bc51 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/AssignedUser.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.SearchAssignedUserReq; +import com.lark.oapi.service.corehr.v1.model.SearchAssignedUserResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class AssignedUser { + private static final Logger log = LoggerFactory.getLogger(AssignedUser.class); + private final Config config; + + public AssignedUser(Config config) { + this.config = config; + } + + + /** + * 获取组织类角色授权列表,查询组织类角色的授权信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/assigned_user/search ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/SearchAssignedUserSample.java ; + */ + public SearchAssignedUserResp search(SearchAssignedUserReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/assigned_users/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchAssignedUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchAssignedUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/assigned_users/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取组织类角色授权列表,查询组织类角色的授权信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/assigned_user/search ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/SearchAssignedUserSample.java ; + */ + public SearchAssignedUserResp search(SearchAssignedUserReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/assigned_users/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchAssignedUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchAssignedUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/assigned_users/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Company.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Company.java new file mode 100644 index 000000000..908521cd9 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Company.java @@ -0,0 +1,368 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Company { + private static final Logger log = LoggerFactory.getLogger(Company.class); + private final Config config; + + public Company(Config config) { + this.config = config; + } + + + /** + * 创建公司,创建公司 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/company/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateCompanySample.java ; + */ + public CreateCompanyResp create(CreateCompanyReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/companies" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateCompanyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCompanyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/companies" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建公司,创建公司 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/company/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateCompanySample.java ; + */ + public CreateCompanyResp create(CreateCompanyReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/companies" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateCompanyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCompanyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/companies" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除公司,删除公司 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/company/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteCompanySample.java ; + */ + public DeleteCompanyResp delete(DeleteCompanyReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/companies/:company_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteCompanyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteCompanyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/companies/:company_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除公司,删除公司 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/company/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteCompanySample.java ; + */ + public DeleteCompanyResp delete(DeleteCompanyReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/companies/:company_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteCompanyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteCompanyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/companies/:company_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个公司,根据 ID 查询单个公司 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/company/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetCompanySample.java ; + */ + public GetCompanyResp get(GetCompanyReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/companies/:company_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetCompanyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCompanyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/companies/:company_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个公司,根据 ID 查询单个公司 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/company/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetCompanySample.java ; + */ + public GetCompanyResp get(GetCompanyReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/companies/:company_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetCompanyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCompanyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/companies/:company_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询公司,批量查询公司 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/company/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListCompanySample.java ; + */ + public ListCompanyResp list(ListCompanyReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/companies" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListCompanyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCompanyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/companies" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询公司,批量查询公司 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/company/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListCompanySample.java ; + */ + public ListCompanyResp list(ListCompanyReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/companies" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListCompanyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCompanyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/companies" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,更新公司数据 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=company&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchCompanySample.java ; + */ + public PatchCompanyResp patch(PatchCompanyReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v1/companies/:company_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchCompanyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchCompanyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/companies/:company_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,更新公司数据 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=company&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchCompanySample.java ; + */ + public PatchCompanyResp patch(PatchCompanyReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v1/companies/:company_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchCompanyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchCompanyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/companies/:company_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/CompensationStandard.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/CompensationStandard.java new file mode 100644 index 000000000..a8afd1e4c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/CompensationStandard.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.MatchCompensationStandardReq; +import com.lark.oapi.service.corehr.v1.model.MatchCompensationStandardResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class CompensationStandard { + private static final Logger log = LoggerFactory.getLogger(CompensationStandard.class); + private final Config config; + + public CompensationStandard(Config config) { + this.config = config; + } + + + /** + * ,分页查询地点数据 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=match&project=corehr&resource=compensation_standard&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/MatchCompensationStandardSample.java ; + */ + public MatchCompensationStandardResp match(MatchCompensationStandardReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/compensation_standards/match" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + MatchCompensationStandardResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MatchCompensationStandardResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/compensation_standards/match" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,分页查询地点数据 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=match&project=corehr&resource=compensation_standard&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/MatchCompensationStandardSample.java ; + */ + public MatchCompensationStandardResp match(MatchCompensationStandardReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/compensation_standards/match" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + MatchCompensationStandardResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MatchCompensationStandardResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/compensation_standards/match" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Contract.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Contract.java new file mode 100644 index 000000000..f2b355670 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Contract.java @@ -0,0 +1,368 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Contract { + private static final Logger log = LoggerFactory.getLogger(Contract.class); + private final Config config; + + public Contract(Config config) { + this.config = config; + } + + + /** + * 创建合同,创建合同 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateContractSample.java ; + */ + public CreateContractResp create(CreateContractReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/contracts" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateContractResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateContractResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/contracts" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建合同,创建合同 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateContractSample.java ; + */ + public CreateContractResp create(CreateContractReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/contracts" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateContractResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateContractResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/contracts" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除合同,删除合同 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteContractSample.java ; + */ + public DeleteContractResp delete(DeleteContractReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/contracts/:contract_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteContractResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteContractResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/contracts/:contract_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除合同,删除合同 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteContractSample.java ; + */ + public DeleteContractResp delete(DeleteContractReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/contracts/:contract_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteContractResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteContractResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/contracts/:contract_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个合同,根据 ID 查询单个合同 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetContractSample.java ; + */ + public GetContractResp get(GetContractReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/contracts/:contract_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetContractResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetContractResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/contracts/:contract_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个合同,根据 ID 查询单个合同 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetContractSample.java ; + */ + public GetContractResp get(GetContractReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/contracts/:contract_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetContractResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetContractResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/contracts/:contract_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询合同,批量查询合同 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListContractSample.java ; + */ + public ListContractResp list(ListContractReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/contracts" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListContractResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListContractResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/contracts" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询合同,批量查询合同 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListContractSample.java ; + */ + public ListContractResp list(ListContractReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/contracts" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListContractResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListContractResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/contracts" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新合同,更新合同 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchContractSample.java ; + */ + public PatchContractResp patch(PatchContractReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v1/contracts/:contract_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchContractResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchContractResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/contracts/:contract_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新合同,更新合同 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchContractSample.java ; + */ + public PatchContractResp patch(PatchContractReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v1/contracts/:contract_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchContractResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchContractResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/contracts/:contract_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/CountryRegion.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/CountryRegion.java new file mode 100644 index 000000000..218a48686 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/CountryRegion.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.GetCountryRegionReq; +import com.lark.oapi.service.corehr.v1.model.GetCountryRegionResp; +import com.lark.oapi.service.corehr.v1.model.ListCountryRegionReq; +import com.lark.oapi.service.corehr.v1.model.ListCountryRegionResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class CountryRegion { + private static final Logger log = LoggerFactory.getLogger(CountryRegion.class); + private final Config config; + + public CountryRegion(Config config) { + this.config = config; + } + + + /** + * 查询单条国家/地区信息,查询单条国家/地区信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/country_region/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetCountryRegionSample.java ; + */ + public GetCountryRegionResp get(GetCountryRegionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/country_regions/:country_region_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetCountryRegionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCountryRegionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/country_regions/:country_region_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单条国家/地区信息,查询单条国家/地区信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/country_region/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetCountryRegionSample.java ; + */ + public GetCountryRegionResp get(GetCountryRegionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/country_regions/:country_region_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetCountryRegionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCountryRegionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/country_regions/:country_region_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询国家/地区信息,批量查询国家/地区信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/country_region/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListCountryRegionSample.java ; + */ + public ListCountryRegionResp list(ListCountryRegionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/country_regions" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListCountryRegionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCountryRegionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/country_regions" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询国家/地区信息,批量查询国家/地区信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/country_region/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListCountryRegionSample.java ; + */ + public ListCountryRegionResp list(ListCountryRegionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/country_regions" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListCountryRegionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCountryRegionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/country_regions" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Currency.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Currency.java new file mode 100644 index 000000000..b83f907a0 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Currency.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.GetCurrencyReq; +import com.lark.oapi.service.corehr.v1.model.GetCurrencyResp; +import com.lark.oapi.service.corehr.v1.model.ListCurrencyReq; +import com.lark.oapi.service.corehr.v1.model.ListCurrencyResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Currency { + private static final Logger log = LoggerFactory.getLogger(Currency.class); + private final Config config; + + public Currency(Config config) { + this.config = config; + } + + + /** + * 查询单个货币信息,查询单个货币信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/currency/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetCurrencySample.java ; + */ + public GetCurrencyResp get(GetCurrencyReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/currencies/:currency_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetCurrencyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCurrencyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/currencies/:currency_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个货币信息,查询单个货币信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/currency/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetCurrencySample.java ; + */ + public GetCurrencyResp get(GetCurrencyReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/currencies/:currency_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetCurrencyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCurrencyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/currencies/:currency_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询货币信息,批量查询货币信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/currency/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListCurrencySample.java ; + */ + public ListCurrencyResp list(ListCurrencyReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/currencies" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListCurrencyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCurrencyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/currencies" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询货币信息,批量查询货币信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/currency/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListCurrencySample.java ; + */ + public ListCurrencyResp list(ListCurrencyReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/currencies" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListCurrencyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCurrencyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/currencies" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/CustomField.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/CustomField.java new file mode 100644 index 000000000..13f12429a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/CustomField.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class CustomField { + private static final Logger log = LoggerFactory.getLogger(CustomField.class); + private final Config config; + + public CustomField(Config config) { + this.config = config; + } + + + /** + * 获取自定义字段详情,获取「飞书人事」具体对象下某自定义字段的详细信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/custom_field/get_by_param ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetByParamCustomFieldSample.java ; + */ + public GetByParamCustomFieldResp getByParam(GetByParamCustomFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/custom_fields/get_by_param" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetByParamCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetByParamCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/custom_fields/get_by_param" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取自定义字段详情,获取「飞书人事」具体对象下某自定义字段的详细信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/custom_field/get_by_param ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetByParamCustomFieldSample.java ; + */ + public GetByParamCustomFieldResp getByParam(GetByParamCustomFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/custom_fields/get_by_param" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetByParamCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetByParamCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/custom_fields/get_by_param" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取飞书人事对象列表,获取「飞书人事」中的对象列表,含系统预置对象与自定义对象 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/custom_field/list_object_api_name ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListObjectApiNameCustomFieldSample.java ; + */ + public ListObjectApiNameCustomFieldResp listObjectApiName(ListObjectApiNameCustomFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/custom_fields/list_object_api_name" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListObjectApiNameCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListObjectApiNameCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/custom_fields/list_object_api_name" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取飞书人事对象列表,获取「飞书人事」中的对象列表,含系统预置对象与自定义对象 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/custom_field/list_object_api_name ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListObjectApiNameCustomFieldSample.java ; + */ + public ListObjectApiNameCustomFieldResp listObjectApiName(ListObjectApiNameCustomFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/custom_fields/list_object_api_name" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListObjectApiNameCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListObjectApiNameCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/custom_fields/list_object_api_name" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取自定义字段列表,获取「飞书人事」具体对象下的自定义字段列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/custom_field/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryCustomFieldSample.java ; + */ + public QueryCustomFieldResp query(QueryCustomFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/custom_fields/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/custom_fields/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取自定义字段列表,获取「飞书人事」具体对象下的自定义字段列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/custom_field/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryCustomFieldSample.java ; + */ + public QueryCustomFieldResp query(QueryCustomFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/custom_fields/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/custom_fields/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Department.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Department.java new file mode 100644 index 000000000..10104d478 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Department.java @@ -0,0 +1,368 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Department { + private static final Logger log = LoggerFactory.getLogger(Department.class); + private final Config config; + + public Department(Config config) { + this.config = config; + } + + + /** + * 创建部门,创建部门 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateDepartmentSample.java ; + */ + public CreateDepartmentResp create(CreateDepartmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/departments" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/departments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建部门,创建部门 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateDepartmentSample.java ; + */ + public CreateDepartmentResp create(CreateDepartmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/departments" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/departments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除部门,删除部门 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteDepartmentSample.java ; + */ + public DeleteDepartmentResp delete(DeleteDepartmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/departments/:department_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/departments/:department_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除部门,删除部门 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteDepartmentSample.java ; + */ + public DeleteDepartmentResp delete(DeleteDepartmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/departments/:department_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/departments/:department_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个部门,根据 ID 查询单个部门 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetDepartmentSample.java ; + */ + public GetDepartmentResp get(GetDepartmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/departments/:department_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/departments/:department_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个部门,根据 ID 查询单个部门 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetDepartmentSample.java ; + */ + public GetDepartmentResp get(GetDepartmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/departments/:department_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/departments/:department_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询部门,批量查询部门 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListDepartmentSample.java ; + */ + public ListDepartmentResp list(ListDepartmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/departments" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/departments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询部门,批量查询部门 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListDepartmentSample.java ; + */ + public ListDepartmentResp list(ListDepartmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/departments" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/departments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新部门,更新部门 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchDepartmentSample.java ; + */ + public PatchDepartmentResp patch(PatchDepartmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v1/departments/:department_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/departments/:department_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新部门,更新部门 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchDepartmentSample.java ; + */ + public PatchDepartmentResp patch(PatchDepartmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v1/departments/:department_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/departments/:department_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/EmployeeType.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/EmployeeType.java new file mode 100644 index 000000000..8e75c3144 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/EmployeeType.java @@ -0,0 +1,368 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class EmployeeType { + private static final Logger log = LoggerFactory.getLogger(EmployeeType.class); + private final Config config; + + public EmployeeType(Config config) { + this.config = config; + } + + + /** + * 创建人员类型,创建人员类型 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateEmployeeTypeSample.java ; + */ + public CreateEmployeeTypeResp create(CreateEmployeeTypeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/employee_types" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateEmployeeTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEmployeeTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employee_types" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建人员类型,创建人员类型 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateEmployeeTypeSample.java ; + */ + public CreateEmployeeTypeResp create(CreateEmployeeTypeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/employee_types" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateEmployeeTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEmployeeTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employee_types" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除人员类型,删除人员类型 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteEmployeeTypeSample.java ; + */ + public DeleteEmployeeTypeResp delete(DeleteEmployeeTypeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/employee_types/:employee_type_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteEmployeeTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteEmployeeTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employee_types/:employee_type_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除人员类型,删除人员类型 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteEmployeeTypeSample.java ; + */ + public DeleteEmployeeTypeResp delete(DeleteEmployeeTypeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/employee_types/:employee_type_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteEmployeeTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteEmployeeTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employee_types/:employee_type_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个人员类型,根据 ID 查询单个人员类型 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetEmployeeTypeSample.java ; + */ + public GetEmployeeTypeResp get(GetEmployeeTypeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/employee_types/:employee_type_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetEmployeeTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetEmployeeTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employee_types/:employee_type_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个人员类型,根据 ID 查询单个人员类型 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetEmployeeTypeSample.java ; + */ + public GetEmployeeTypeResp get(GetEmployeeTypeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/employee_types/:employee_type_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetEmployeeTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetEmployeeTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employee_types/:employee_type_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询人员类型,批量查询人员类型 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListEmployeeTypeSample.java ; + */ + public ListEmployeeTypeResp list(ListEmployeeTypeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/employee_types" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListEmployeeTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListEmployeeTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employee_types" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询人员类型,批量查询人员类型 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListEmployeeTypeSample.java ; + */ + public ListEmployeeTypeResp list(ListEmployeeTypeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/employee_types" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListEmployeeTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListEmployeeTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employee_types" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新人员类型数据,更新人员类型数据 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchEmployeeTypeSample.java ; + */ + public PatchEmployeeTypeResp patch(PatchEmployeeTypeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v1/employee_types/:employee_type_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchEmployeeTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchEmployeeTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employee_types/:employee_type_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新人员类型数据,更新人员类型数据 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchEmployeeTypeSample.java ; + */ + public PatchEmployeeTypeResp patch(PatchEmployeeTypeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v1/employee_types/:employee_type_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchEmployeeTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchEmployeeTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employee_types/:employee_type_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Employment.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Employment.java new file mode 100644 index 000000000..4755262e4 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Employment.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Employment { + private static final Logger log = LoggerFactory.getLogger(Employment.class); + private final Config config; + + public Employment(Config config) { + this.config = config; + } + + + /** + * 创建雇佣信息,创建人员的雇佣信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employment/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateEmploymentSample.java ; + */ + public CreateEmploymentResp create(CreateEmploymentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/employments" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateEmploymentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEmploymentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建雇佣信息,创建人员的雇佣信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employment/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateEmploymentSample.java ; + */ + public CreateEmploymentResp create(CreateEmploymentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/employments" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateEmploymentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEmploymentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除雇佣信息,删除人员的雇佣信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employment/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteEmploymentSample.java ; + */ + public DeleteEmploymentResp delete(DeleteEmploymentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/employments/:employment_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteEmploymentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteEmploymentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employments/:employment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除雇佣信息,删除人员的雇佣信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employment/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteEmploymentSample.java ; + */ + public DeleteEmploymentResp delete(DeleteEmploymentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/employments/:employment_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteEmploymentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteEmploymentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employments/:employment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新雇佣信息,更新雇佣信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employment/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchEmploymentSample.java ; + */ + public PatchEmploymentResp patch(PatchEmploymentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v1/employments/:employment_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchEmploymentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchEmploymentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employments/:employment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新雇佣信息,更新雇佣信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employment/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchEmploymentSample.java ; + */ + public PatchEmploymentResp patch(PatchEmploymentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v1/employments/:employment_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchEmploymentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchEmploymentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/employments/:employment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/File.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/File.java new file mode 100644 index 000000000..2aa72c5a9 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/File.java @@ -0,0 +1,127 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.GetFileReq; +import com.lark.oapi.service.corehr.v1.model.GetFileResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.ByteArrayOutputStream; +import java.nio.charset.StandardCharsets; + +public class File { + private static final Logger log = LoggerFactory.getLogger(File.class); + private final Config config; + + public File(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=corehr&resource=file&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetFileSample.java ; + */ + public GetFileResp get(GetFileReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/files/:id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + if (httpResponse.getStatusCode() == 200) { + GetFileResp resp = new GetFileResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + GetFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/files/:id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=corehr&resource=file&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetFileSample.java ; + */ + public GetFileResp get(GetFileReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/files/:id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 下载请求,返回流 + if (httpResponse.getStatusCode() == 200) { + GetFileResp resp = new GetFileResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + GetFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/files/:id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Job.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Job.java new file mode 100644 index 000000000..44abb7fd7 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Job.java @@ -0,0 +1,368 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Job { + private static final Logger log = LoggerFactory.getLogger(Job.class); + private final Config config; + + public Job(Config config) { + this.config = config; + } + + + /** + * 创建职务,创建职务 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobSample.java ; + */ + public CreateJobResp create(CreateJobReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/jobs" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/jobs" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建职务,创建职务 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobSample.java ; + */ + public CreateJobResp create(CreateJobReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/jobs" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/jobs" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除职务,删除职务 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobSample.java ; + */ + public DeleteJobResp delete(DeleteJobReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/jobs/:job_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/jobs/:job_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除职务,删除职务 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobSample.java ; + */ + public DeleteJobResp delete(DeleteJobReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/jobs/:job_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/jobs/:job_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个职务,根据 ID 查询单个职务 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobSample.java ; + */ + public GetJobResp get(GetJobReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/jobs/:job_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/jobs/:job_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个职务,根据 ID 查询单个职务 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobSample.java ; + */ + public GetJobResp get(GetJobReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/jobs/:job_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/jobs/:job_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询职务,批量查询职务 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobSample.java ; + */ + public ListJobResp list(ListJobReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/jobs" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/jobs" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询职务,批量查询职务 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobSample.java ; + */ + public ListJobResp list(ListJobReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/jobs" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/jobs" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新职务,更新职务 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobSample.java ; + */ + public PatchJobResp patch(PatchJobReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v1/jobs/:job_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchJobResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/jobs/:job_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新职务,更新职务 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobSample.java ; + */ + public PatchJobResp patch(PatchJobReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v1/jobs/:job_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchJobResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/jobs/:job_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/JobChange.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/JobChange.java new file mode 100644 index 000000000..9aa367aba --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/JobChange.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.CreateJobChangeReq; +import com.lark.oapi.service.corehr.v1.model.CreateJobChangeResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class JobChange { + private static final Logger log = LoggerFactory.getLogger(JobChange.class); + private final Config config; + + public JobChange(Config config) { + this.config = config; + } + + + /** + * 发起员工异动,创建员工异动信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_change/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobChangeSample.java ; + */ + public CreateJobChangeResp create(CreateJobChangeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/job_changes" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateJobChangeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobChangeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_changes" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 发起员工异动,创建员工异动信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_change/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobChangeSample.java ; + */ + public CreateJobChangeResp create(CreateJobChangeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/job_changes" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateJobChangeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobChangeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_changes" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/JobData.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/JobData.java new file mode 100644 index 000000000..35d08261b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/JobData.java @@ -0,0 +1,368 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class JobData { + private static final Logger log = LoggerFactory.getLogger(JobData.class); + private final Config config; + + public JobData(Config config) { + this.config = config; + } + + + /** + * 创建任职信息,在系统中第一次创建员工任职数据,通常在员工入职或者做数据批量导入的时候使用,【任职原因】只支持填写“入职” + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobDataSample.java ; + */ + public CreateJobDataResp create(CreateJobDataReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/job_datas" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateJobDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobDataResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_datas" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建任职信息,在系统中第一次创建员工任职数据,通常在员工入职或者做数据批量导入的时候使用,【任职原因】只支持填写“入职” + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobDataSample.java ; + */ + public CreateJobDataResp create(CreateJobDataReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/job_datas" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateJobDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobDataResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_datas" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除任职信息,删除人员的任职信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobDataSample.java ; + */ + public DeleteJobDataResp delete(DeleteJobDataReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/job_datas/:job_data_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteJobDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobDataResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_datas/:job_data_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除任职信息,删除人员的任职信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobDataSample.java ; + */ + public DeleteJobDataResp delete(DeleteJobDataReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/job_datas/:job_data_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteJobDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobDataResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_datas/:job_data_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个任职信息,根据 ID 查询单任职信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobDataSample.java ; + */ + public GetJobDataResp get(GetJobDataReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/job_datas/:job_data_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetJobDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobDataResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_datas/:job_data_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个任职信息,根据 ID 查询单任职信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobDataSample.java ; + */ + public GetJobDataResp get(GetJobDataReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/job_datas/:job_data_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetJobDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobDataResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_datas/:job_data_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询任职信息,批量查询人员的任职信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobDataSample.java ; + */ + public ListJobDataResp list(ListJobDataReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/job_datas" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListJobDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobDataResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_datas" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询任职信息,批量查询人员的任职信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobDataSample.java ; + */ + public ListJobDataResp list(ListJobDataReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/job_datas" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListJobDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobDataResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_datas" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新任职信息,更新任职信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobDataSample.java ; + */ + public PatchJobDataResp patch(PatchJobDataReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v1/job_datas/:job_data_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchJobDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchJobDataResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_datas/:job_data_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新任职信息,更新任职信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobDataSample.java ; + */ + public PatchJobDataResp patch(PatchJobDataReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v1/job_datas/:job_data_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchJobDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchJobDataResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_datas/:job_data_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/JobFamily.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/JobFamily.java new file mode 100644 index 000000000..3f9a11748 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/JobFamily.java @@ -0,0 +1,368 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class JobFamily { + private static final Logger log = LoggerFactory.getLogger(JobFamily.class); + private final Config config; + + public JobFamily(Config config) { + this.config = config; + } + + + /** + * 创建职务序列,创建职务序列 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobFamilySample.java ; + */ + public CreateJobFamilyResp create(CreateJobFamilyReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/job_families" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobFamilyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_families" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建职务序列,创建职务序列 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobFamilySample.java ; + */ + public CreateJobFamilyResp create(CreateJobFamilyReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/job_families" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobFamilyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_families" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除职务序列,删除职务序列 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobFamilySample.java ; + */ + public DeleteJobFamilyResp delete(DeleteJobFamilyReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/job_families/:job_family_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobFamilyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_families/:job_family_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除职务序列,删除职务序列 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobFamilySample.java ; + */ + public DeleteJobFamilyResp delete(DeleteJobFamilyReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/job_families/:job_family_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobFamilyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_families/:job_family_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个职务序列,根据 ID 查询单个职务序列 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobFamilySample.java ; + */ + public GetJobFamilyResp get(GetJobFamilyReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/job_families/:job_family_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobFamilyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_families/:job_family_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个职务序列,根据 ID 查询单个职务序列 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobFamilySample.java ; + */ + public GetJobFamilyResp get(GetJobFamilyReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/job_families/:job_family_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobFamilyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_families/:job_family_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询职务序列,批量查询职务序列 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobFamilySample.java ; + */ + public ListJobFamilyResp list(ListJobFamilyReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/job_families" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobFamilyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_families" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询职务序列,批量查询职务序列 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobFamilySample.java ; + */ + public ListJobFamilyResp list(ListJobFamilyReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/job_families" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobFamilyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_families" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新职务序列,更新职务序列 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobFamilySample.java ; + */ + public PatchJobFamilyResp patch(PatchJobFamilyReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v1/job_families/:job_family_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchJobFamilyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_families/:job_family_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新职务序列,更新职务序列 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobFamilySample.java ; + */ + public PatchJobFamilyResp patch(PatchJobFamilyReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v1/job_families/:job_family_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchJobFamilyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_families/:job_family_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/JobLevel.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/JobLevel.java new file mode 100644 index 000000000..38f4fe2dd --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/JobLevel.java @@ -0,0 +1,368 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class JobLevel { + private static final Logger log = LoggerFactory.getLogger(JobLevel.class); + private final Config config; + + public JobLevel(Config config) { + this.config = config; + } + + + /** + * 创建职务级别,创建职务级别 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobLevelSample.java ; + */ + public CreateJobLevelResp create(CreateJobLevelReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/job_levels" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_levels" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建职务级别,创建职务级别 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobLevelSample.java ; + */ + public CreateJobLevelResp create(CreateJobLevelReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/job_levels" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_levels" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除职务级别,删除职务级别 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobLevelSample.java ; + */ + public DeleteJobLevelResp delete(DeleteJobLevelReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/job_levels/:job_level_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_levels/:job_level_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除职务级别,删除职务级别 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobLevelSample.java ; + */ + public DeleteJobLevelResp delete(DeleteJobLevelReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/job_levels/:job_level_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_levels/:job_level_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个职务级别,根据 ID 查询单个职务级别 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobLevelSample.java ; + */ + public GetJobLevelResp get(GetJobLevelReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/job_levels/:job_level_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_levels/:job_level_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个职务级别,根据 ID 查询单个职务级别 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobLevelSample.java ; + */ + public GetJobLevelResp get(GetJobLevelReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/job_levels/:job_level_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_levels/:job_level_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询职务级别,批量查询职务级别 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobLevelSample.java ; + */ + public ListJobLevelResp list(ListJobLevelReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/job_levels" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_levels" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询职务级别,批量查询职务级别 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobLevelSample.java ; + */ + public ListJobLevelResp list(ListJobLevelReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/job_levels" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_levels" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新职务级别,更新职务级别 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobLevelSample.java ; + */ + public PatchJobLevelResp patch(PatchJobLevelReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v1/job_levels/:job_level_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchJobLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_levels/:job_level_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新职务级别,更新职务级别 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobLevelSample.java ; + */ + public PatchJobLevelResp patch(PatchJobLevelReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v1/job_levels/:job_level_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchJobLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/job_levels/:job_level_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Leave.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Leave.java new file mode 100644 index 000000000..220e9f0d2 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Leave.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Leave { + private static final Logger log = LoggerFactory.getLogger(Leave.class); + private final Config config; + + public Leave(Config config) { + this.config = config; + } + + + /** + * 批量查询员工假期余额,批量获取员工各个假期的余额数据 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave/leave_balances ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/LeaveBalancesLeaveSample.java ; + */ + public LeaveBalancesLeaveResp leaveBalances(LeaveBalancesLeaveReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/leaves/leave_balances" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + LeaveBalancesLeaveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, LeaveBalancesLeaveResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/leaves/leave_balances" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询员工假期余额,批量获取员工各个假期的余额数据 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave/leave_balances ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/LeaveBalancesLeaveSample.java ; + */ + public LeaveBalancesLeaveResp leaveBalances(LeaveBalancesLeaveReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/leaves/leave_balances" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + LeaveBalancesLeaveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, LeaveBalancesLeaveResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/leaves/leave_balances" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询员工请假记录,批量获取员工的请假记录数据 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave/leave_request_history ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/LeaveRequestHistoryLeaveSample.java ; + */ + public LeaveRequestHistoryLeaveResp leaveRequestHistory(LeaveRequestHistoryLeaveReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/leaves/leave_request_history" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + LeaveRequestHistoryLeaveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, LeaveRequestHistoryLeaveResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/leaves/leave_request_history" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询员工请假记录,批量获取员工的请假记录数据 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave/leave_request_history ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/LeaveRequestHistoryLeaveSample.java ; + */ + public LeaveRequestHistoryLeaveResp leaveRequestHistory(LeaveRequestHistoryLeaveReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/leaves/leave_request_history" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + LeaveRequestHistoryLeaveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, LeaveRequestHistoryLeaveResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/leaves/leave_request_history" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取假期类型列表,获取休假设置后台配置的假期类型列表(比如年假、事假、婚假等) + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave/leave_types ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/LeaveTypesLeaveSample.java ; + */ + public LeaveTypesLeaveResp leaveTypes(LeaveTypesLeaveReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/leaves/leave_types" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + LeaveTypesLeaveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, LeaveTypesLeaveResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/leaves/leave_types" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取假期类型列表,获取休假设置后台配置的假期类型列表(比如年假、事假、婚假等) + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave/leave_types ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/LeaveTypesLeaveSample.java ; + */ + public LeaveTypesLeaveResp leaveTypes(LeaveTypesLeaveReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/leaves/leave_types" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + LeaveTypesLeaveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, LeaveTypesLeaveResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/leaves/leave_types" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/LeaveGrantingRecord.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/LeaveGrantingRecord.java new file mode 100644 index 000000000..ea48b971d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/LeaveGrantingRecord.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.CreateLeaveGrantingRecordReq; +import com.lark.oapi.service.corehr.v1.model.CreateLeaveGrantingRecordResp; +import com.lark.oapi.service.corehr.v1.model.DeleteLeaveGrantingRecordReq; +import com.lark.oapi.service.corehr.v1.model.DeleteLeaveGrantingRecordResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class LeaveGrantingRecord { + private static final Logger log = LoggerFactory.getLogger(LeaveGrantingRecord.class); + private final Config config; + + public LeaveGrantingRecord(Config config) { + this.config = config; + } + + + /** + * 创建假期授予记录,向飞书人事休假系统写入假期授予记录 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave_granting_record/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateLeaveGrantingRecordSample.java ; + */ + public CreateLeaveGrantingRecordResp create(CreateLeaveGrantingRecordReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/leave_granting_records" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateLeaveGrantingRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateLeaveGrantingRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/leave_granting_records" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建假期授予记录,向飞书人事休假系统写入假期授予记录 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave_granting_record/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateLeaveGrantingRecordSample.java ; + */ + public CreateLeaveGrantingRecordResp create(CreateLeaveGrantingRecordReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/leave_granting_records" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateLeaveGrantingRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateLeaveGrantingRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/leave_granting_records" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除假期授予记录,删除飞书人事休假系统中的假期授予记录(仅支持删除授予来源是「手动授予」或「外部系统授予」的记录) + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave_granting_record/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteLeaveGrantingRecordSample.java ; + */ + public DeleteLeaveGrantingRecordResp delete(DeleteLeaveGrantingRecordReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/leave_granting_records/:leave_granting_record_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteLeaveGrantingRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteLeaveGrantingRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/leave_granting_records/:leave_granting_record_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除假期授予记录,删除飞书人事休假系统中的假期授予记录(仅支持删除授予来源是「手动授予」或「外部系统授予」的记录) + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave_granting_record/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteLeaveGrantingRecordSample.java ; + */ + public DeleteLeaveGrantingRecordResp delete(DeleteLeaveGrantingRecordReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/leave_granting_records/:leave_granting_record_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteLeaveGrantingRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteLeaveGrantingRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/leave_granting_records/:leave_granting_record_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Location.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Location.java new file mode 100644 index 000000000..35eab80b8 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Location.java @@ -0,0 +1,302 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Location { + private static final Logger log = LoggerFactory.getLogger(Location.class); + private final Config config; + + public Location(Config config) { + this.config = config; + } + + + /** + * 创建地点,创建地点 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateLocationSample.java ; + */ + public CreateLocationResp create(CreateLocationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/locations" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateLocationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateLocationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/locations" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建地点,创建地点 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateLocationSample.java ; + */ + public CreateLocationResp create(CreateLocationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/locations" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateLocationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateLocationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/locations" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除地点,删除地点 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteLocationSample.java ; + */ + public DeleteLocationResp delete(DeleteLocationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/locations/:location_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteLocationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteLocationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/locations/:location_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除地点,删除地点 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteLocationSample.java ; + */ + public DeleteLocationResp delete(DeleteLocationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/locations/:location_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteLocationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteLocationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/locations/:location_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个地点,根据 ID 查询单个地点 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetLocationSample.java ; + */ + public GetLocationResp get(GetLocationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/locations/:location_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetLocationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetLocationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/locations/:location_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个地点,根据 ID 查询单个地点 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetLocationSample.java ; + */ + public GetLocationResp get(GetLocationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/locations/:location_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetLocationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetLocationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/locations/:location_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询地点,批量查询地点 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListLocationSample.java ; + */ + public ListLocationResp list(ListLocationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/locations" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListLocationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListLocationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/locations" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询地点,批量查询地点 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListLocationSample.java ; + */ + public ListLocationResp list(ListLocationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/locations" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListLocationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListLocationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/locations" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/NationalIdType.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/NationalIdType.java new file mode 100644 index 000000000..b638dd333 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/NationalIdType.java @@ -0,0 +1,368 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class NationalIdType { + private static final Logger log = LoggerFactory.getLogger(NationalIdType.class); + private final Config config; + + public NationalIdType(Config config) { + this.config = config; + } + + + /** + * 创建国家证件类型,创建国家证件类型 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateNationalIdTypeSample.java ; + */ + public CreateNationalIdTypeResp create(CreateNationalIdTypeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/national_id_types" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateNationalIdTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateNationalIdTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/national_id_types" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建国家证件类型,创建国家证件类型 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateNationalIdTypeSample.java ; + */ + public CreateNationalIdTypeResp create(CreateNationalIdTypeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/national_id_types" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateNationalIdTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateNationalIdTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/national_id_types" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除国家证件类型,删除国家证件类型 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteNationalIdTypeSample.java ; + */ + public DeleteNationalIdTypeResp delete(DeleteNationalIdTypeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/national_id_types/:national_id_type_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteNationalIdTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteNationalIdTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/national_id_types/:national_id_type_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除国家证件类型,删除国家证件类型 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteNationalIdTypeSample.java ; + */ + public DeleteNationalIdTypeResp delete(DeleteNationalIdTypeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/national_id_types/:national_id_type_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteNationalIdTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteNationalIdTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/national_id_types/:national_id_type_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个国家证件类型,根据 ID 查询单个国家证件类型 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetNationalIdTypeSample.java ; + */ + public GetNationalIdTypeResp get(GetNationalIdTypeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/national_id_types/:national_id_type_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetNationalIdTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetNationalIdTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/national_id_types/:national_id_type_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个国家证件类型,根据 ID 查询单个国家证件类型 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetNationalIdTypeSample.java ; + */ + public GetNationalIdTypeResp get(GetNationalIdTypeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/national_id_types/:national_id_type_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetNationalIdTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetNationalIdTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/national_id_types/:national_id_type_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询国家证件类型,批量查询国家证件类型 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListNationalIdTypeSample.java ; + */ + public ListNationalIdTypeResp list(ListNationalIdTypeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/national_id_types" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListNationalIdTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListNationalIdTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/national_id_types" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询国家证件类型,批量查询国家证件类型 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListNationalIdTypeSample.java ; + */ + public ListNationalIdTypeResp list(ListNationalIdTypeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/national_id_types" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListNationalIdTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListNationalIdTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/national_id_types" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新国家证件类型,更新国家证件类型 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchNationalIdTypeSample.java ; + */ + public PatchNationalIdTypeResp patch(PatchNationalIdTypeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v1/national_id_types/:national_id_type_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchNationalIdTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchNationalIdTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/national_id_types/:national_id_type_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新国家证件类型,更新国家证件类型 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchNationalIdTypeSample.java ; + */ + public PatchNationalIdTypeResp patch(PatchNationalIdTypeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v1/national_id_types/:national_id_type_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchNationalIdTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchNationalIdTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/national_id_types/:national_id_type_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Offboarding.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Offboarding.java new file mode 100644 index 000000000..fd54fce3c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Offboarding.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Offboarding { + private static final Logger log = LoggerFactory.getLogger(Offboarding.class); + private final Config config; + + public Offboarding(Config config) { + this.config = config; + } + + + /** + * 查询员工离职原因列表,查询「飞书人事」-「离职设置」中的离职原因 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/offboarding/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryOffboardingSample.java ; + */ + public QueryOffboardingResp query(QueryOffboardingReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/offboardings/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryOffboardingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryOffboardingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/offboardings/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询员工离职原因列表,查询「飞书人事」-「离职设置」中的离职原因 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/offboarding/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryOffboardingSample.java ; + */ + public QueryOffboardingResp query(QueryOffboardingReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/offboardings/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryOffboardingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryOffboardingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/offboardings/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,根据 雇佣 ID 查询员工离职信息 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=offboarding&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/SearchOffboardingSample.java ; + */ + public SearchOffboardingResp search(SearchOffboardingReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/offboardings/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchOffboardingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchOffboardingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/offboardings/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,根据 雇佣 ID 查询员工离职信息 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=offboarding&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/SearchOffboardingSample.java ; + */ + public SearchOffboardingResp search(SearchOffboardingReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/offboardings/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchOffboardingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchOffboardingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/offboardings/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 操作员工离职,操作员工直接离职 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/offboarding/submit ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/SubmitOffboardingSample.java ; + */ + public SubmitOffboardingResp submit(SubmitOffboardingReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/offboardings/submit" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SubmitOffboardingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubmitOffboardingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/offboardings/submit" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 操作员工离职,操作员工直接离职 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/offboarding/submit ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/SubmitOffboardingSample.java ; + */ + public SubmitOffboardingResp submit(SubmitOffboardingReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/offboardings/submit" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SubmitOffboardingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubmitOffboardingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/offboardings/submit" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/OrgRoleAuthorization.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/OrgRoleAuthorization.java new file mode 100644 index 000000000..2494d8929 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/OrgRoleAuthorization.java @@ -0,0 +1,29 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class OrgRoleAuthorization { + private static final Logger log = LoggerFactory.getLogger(OrgRoleAuthorization.class); + private final Config config; + + public OrgRoleAuthorization(Config config) { + this.config = config; + } + + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Person.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Person.java new file mode 100644 index 000000000..f5057be0f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Person.java @@ -0,0 +1,238 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Person { + private static final Logger log = LoggerFactory.getLogger(Person.class); + private final Config config; + + public Person(Config config) { + this.config = config; + } + + + /** + * 删除个人信息,删除人员的个人信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/person/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeletePersonSample.java ; + */ + public DeletePersonResp delete(DeletePersonReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/persons/:person_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeletePersonResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePersonResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/persons/:person_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除个人信息,删除人员的个人信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/person/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeletePersonSample.java ; + */ + public DeletePersonResp delete(DeletePersonReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/persons/:person_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeletePersonResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePersonResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/persons/:person_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个个人信息,根据 ID 查询单个人员的个人信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/person/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetPersonSample.java ; + */ + public GetPersonResp get(GetPersonReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/persons/:person_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetPersonResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetPersonResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/persons/:person_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个个人信息,根据 ID 查询单个人员的个人信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/person/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetPersonSample.java ; + */ + public GetPersonResp get(GetPersonReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/persons/:person_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetPersonResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetPersonResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/persons/:person_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 上传文件,上传文件 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/person/upload ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/UploadPersonSample.java ; + */ + public UploadPersonResp upload(UploadPersonReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/persons/upload" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UploadPersonResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadPersonResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/persons/upload" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 上传文件,上传文件 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/person/upload ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/UploadPersonSample.java ; + */ + public UploadPersonResp upload(UploadPersonReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/persons/upload" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UploadPersonResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadPersonResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/persons/upload" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/PreHire.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/PreHire.java new file mode 100644 index 000000000..01ecdfd05 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/PreHire.java @@ -0,0 +1,302 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class PreHire { + private static final Logger log = LoggerFactory.getLogger(PreHire.class); + private final Config config; + + public PreHire(Config config) { + this.config = config; + } + + + /** + * 删除待入职人员,删除待入职人员 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/pre_hire/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeletePreHireSample.java ; + */ + public DeletePreHireResp delete(DeletePreHireReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/pre_hires/:pre_hire_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeletePreHireResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePreHireResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/pre_hires/:pre_hire_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除待入职人员,删除待入职人员 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/pre_hire/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeletePreHireSample.java ; + */ + public DeletePreHireResp delete(DeletePreHireReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/pre_hires/:pre_hire_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeletePreHireResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePreHireResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/pre_hires/:pre_hire_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个待入职人员,根据 ID 查询单个待入职人员 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/pre_hire/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetPreHireSample.java ; + */ + public GetPreHireResp get(GetPreHireReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/pre_hires/:pre_hire_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetPreHireResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetPreHireResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/pre_hires/:pre_hire_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个待入职人员,根据 ID 查询单个待入职人员 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/pre_hire/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetPreHireSample.java ; + */ + public GetPreHireResp get(GetPreHireReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/pre_hires/:pre_hire_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetPreHireResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetPreHireResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/pre_hires/:pre_hire_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询待入职人员,批量查询待入职人员 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/pre_hire/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListPreHireSample.java ; + */ + public ListPreHireResp list(ListPreHireReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/pre_hires" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListPreHireResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPreHireResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/pre_hires" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询待入职人员,批量查询待入职人员 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/pre_hire/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListPreHireSample.java ; + */ + public ListPreHireResp list(ListPreHireReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/pre_hires" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListPreHireResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPreHireResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/pre_hires" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新待入职数据,更新待入职数据 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/pre_hire/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchPreHireSample.java ; + */ + public PatchPreHireResp patch(PatchPreHireReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v1/pre_hires/:pre_hire_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchPreHireResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchPreHireResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/pre_hires/:pre_hire_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新待入职数据,更新待入职数据 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/pre_hire/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchPreHireSample.java ; + */ + public PatchPreHireResp patch(PatchPreHireReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v1/pre_hires/:pre_hire_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchPreHireResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchPreHireResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/pre_hires/:pre_hire_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/ProcessFormVariableData.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/ProcessFormVariableData.java new file mode 100644 index 000000000..21488f6c9 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/ProcessFormVariableData.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.GetProcessFormVariableDataReq; +import com.lark.oapi.service.corehr.v1.model.GetProcessFormVariableDataResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ProcessFormVariableData { + private static final Logger log = LoggerFactory.getLogger(ProcessFormVariableData.class); + private final Config config; + + public ProcessFormVariableData(Config config) { + this.config = config; + } + + + /** + * 获取流程表单数据,获取流程表单数据 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/process-form_variable_data/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetProcessFormVariableDataSample.java ; + */ + public GetProcessFormVariableDataResp get(GetProcessFormVariableDataReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/processes/:process_id/form_variable_data" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetProcessFormVariableDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetProcessFormVariableDataResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/processes/:process_id/form_variable_data" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取流程表单数据,获取流程表单数据 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/process-form_variable_data/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetProcessFormVariableDataSample.java ; + */ + public GetProcessFormVariableDataResp get(GetProcessFormVariableDataReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/processes/:process_id/form_variable_data" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetProcessFormVariableDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetProcessFormVariableDataResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/processes/:process_id/form_variable_data" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/SecurityGroup.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/SecurityGroup.java new file mode 100644 index 000000000..a1d010192 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/SecurityGroup.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.ListSecurityGroupReq; +import com.lark.oapi.service.corehr.v1.model.ListSecurityGroupResp; +import com.lark.oapi.service.corehr.v1.model.QuerySecurityGroupReq; +import com.lark.oapi.service.corehr.v1.model.QuerySecurityGroupResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class SecurityGroup { + private static final Logger log = LoggerFactory.getLogger(SecurityGroup.class); + private final Config config; + + public SecurityGroup(Config config) { + this.config = config; + } + + + /** + * 批量获取角色列表,批量查询「飞书人事」-「权限设置」-「角色设置」中的角色列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/security_group/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListSecurityGroupSample.java ; + */ + public ListSecurityGroupResp list(ListSecurityGroupReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/security_groups" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListSecurityGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListSecurityGroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/security_groups" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量获取角色列表,批量查询「飞书人事」-「权限设置」-「角色设置」中的角色列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/security_group/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListSecurityGroupSample.java ; + */ + public ListSecurityGroupResp list(ListSecurityGroupReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/security_groups" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListSecurityGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListSecurityGroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/security_groups" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * HRBP/属地 BP 查询,通过部门或工作地点,查询对应的 HRBP/属地 BP + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/security_group/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QuerySecurityGroupSample.java ; + */ + public QuerySecurityGroupResp query(QuerySecurityGroupReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/security_groups/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QuerySecurityGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QuerySecurityGroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/security_groups/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * HRBP/属地 BP 查询,通过部门或工作地点,查询对应的 HRBP/属地 BP + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/security_group/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QuerySecurityGroupSample.java ; + */ + public QuerySecurityGroupResp query(QuerySecurityGroupReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/security_groups/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QuerySecurityGroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QuerySecurityGroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/security_groups/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Subdivision.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Subdivision.java new file mode 100644 index 000000000..faf8d796e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Subdivision.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.GetSubdivisionReq; +import com.lark.oapi.service.corehr.v1.model.GetSubdivisionResp; +import com.lark.oapi.service.corehr.v1.model.ListSubdivisionReq; +import com.lark.oapi.service.corehr.v1.model.ListSubdivisionResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Subdivision { + private static final Logger log = LoggerFactory.getLogger(Subdivision.class); + private final Config config; + + public Subdivision(Config config) { + this.config = config; + } + + + /** + * 查询单条省份/行政区信息,查询单条省份/行政区信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/subdivision/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetSubdivisionSample.java ; + */ + public GetSubdivisionResp get(GetSubdivisionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/subdivisions/:subdivision_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetSubdivisionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSubdivisionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/subdivisions/:subdivision_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单条省份/行政区信息,查询单条省份/行政区信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/subdivision/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetSubdivisionSample.java ; + */ + public GetSubdivisionResp get(GetSubdivisionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/subdivisions/:subdivision_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetSubdivisionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSubdivisionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/subdivisions/:subdivision_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询省份/行政区信息,批量查询省份/行政区信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/subdivision/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListSubdivisionSample.java ; + */ + public ListSubdivisionResp list(ListSubdivisionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/subdivisions" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListSubdivisionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListSubdivisionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/subdivisions" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询省份/行政区信息,批量查询省份/行政区信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/subdivision/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListSubdivisionSample.java ; + */ + public ListSubdivisionResp list(ListSubdivisionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/subdivisions" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListSubdivisionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListSubdivisionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/subdivisions" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Subregion.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Subregion.java new file mode 100644 index 000000000..646081b31 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/Subregion.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.GetSubregionReq; +import com.lark.oapi.service.corehr.v1.model.GetSubregionResp; +import com.lark.oapi.service.corehr.v1.model.ListSubregionReq; +import com.lark.oapi.service.corehr.v1.model.ListSubregionResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Subregion { + private static final Logger log = LoggerFactory.getLogger(Subregion.class); + private final Config config; + + public Subregion(Config config) { + this.config = config; + } + + + /** + * 查询单条城市/区域信息,查询单条城市/区域信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/subregion/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetSubregionSample.java ; + */ + public GetSubregionResp get(GetSubregionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/subregions/:subregion_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetSubregionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSubregionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/subregions/:subregion_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单条城市/区域信息,查询单条城市/区域信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/subregion/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetSubregionSample.java ; + */ + public GetSubregionResp get(GetSubregionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/subregions/:subregion_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetSubregionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSubregionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/subregions/:subregion_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询城市/区域信息,批量查询城市/区域信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/subregion/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListSubregionSample.java ; + */ + public ListSubregionResp list(ListSubregionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/subregions" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListSubregionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListSubregionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/subregions" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询城市/区域信息,批量查询城市/区域信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/subregion/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListSubregionSample.java ; + */ + public ListSubregionResp list(ListSubregionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/subregions" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListSubregionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListSubregionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/subregions" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/TransferReason.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/TransferReason.java new file mode 100644 index 000000000..0c83daa59 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/TransferReason.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.QueryTransferReasonReq; +import com.lark.oapi.service.corehr.v1.model.QueryTransferReasonResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class TransferReason { + private static final Logger log = LoggerFactory.getLogger(TransferReason.class); + private final Config config; + + public TransferReason(Config config) { + this.config = config; + } + + + /** + * 获取异动原因列表,获取异动原因列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/transfer_reason/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryTransferReasonSample.java ; + */ + public QueryTransferReasonResp query(QueryTransferReasonReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/transfer_reasons/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryTransferReasonResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryTransferReasonResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/transfer_reasons/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取异动原因列表,获取异动原因列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/transfer_reason/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryTransferReasonSample.java ; + */ + public QueryTransferReasonResp query(QueryTransferReasonReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/transfer_reasons/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryTransferReasonResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryTransferReasonResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/transfer_reasons/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/TransferType.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/TransferType.java new file mode 100644 index 000000000..f48d0c6bb --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/TransferType.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.QueryTransferTypeReq; +import com.lark.oapi.service.corehr.v1.model.QueryTransferTypeResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class TransferType { + private static final Logger log = LoggerFactory.getLogger(TransferType.class); + private final Config config; + + public TransferType(Config config) { + this.config = config; + } + + + /** + * 获取异动类型列表,获取异动类型列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/transfer_type/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryTransferTypeSample.java ; + */ + public QueryTransferTypeResp query(QueryTransferTypeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/transfer_types/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryTransferTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryTransferTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/transfer_types/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取异动类型列表,获取异动类型列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/transfer_type/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryTransferTypeSample.java ; + */ + public QueryTransferTypeResp query(QueryTransferTypeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/transfer_types/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryTransferTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryTransferTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/transfer_types/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/WorkingHoursType.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/WorkingHoursType.java new file mode 100644 index 000000000..44ee75da1 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v1/resource/WorkingHoursType.java @@ -0,0 +1,368 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class WorkingHoursType { + private static final Logger log = LoggerFactory.getLogger(WorkingHoursType.class); + private final Config config; + + public WorkingHoursType(Config config) { + this.config = config; + } + + + /** + * 创建工时制度,创建工时制度 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateWorkingHoursTypeSample.java ; + */ + public CreateWorkingHoursTypeResp create(CreateWorkingHoursTypeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/working_hours_types" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateWorkingHoursTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateWorkingHoursTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/working_hours_types" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建工时制度,创建工时制度 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateWorkingHoursTypeSample.java ; + */ + public CreateWorkingHoursTypeResp create(CreateWorkingHoursTypeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v1/working_hours_types" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateWorkingHoursTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateWorkingHoursTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/working_hours_types" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除工时制度,删除工时制度 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteWorkingHoursTypeSample.java ; + */ + public DeleteWorkingHoursTypeResp delete(DeleteWorkingHoursTypeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/working_hours_types/:working_hours_type_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteWorkingHoursTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteWorkingHoursTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/working_hours_types/:working_hours_type_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除工时制度,删除工时制度 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteWorkingHoursTypeSample.java ; + */ + public DeleteWorkingHoursTypeResp delete(DeleteWorkingHoursTypeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v1/working_hours_types/:working_hours_type_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteWorkingHoursTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteWorkingHoursTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/working_hours_types/:working_hours_type_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个工时制度,根据 ID 查询单个工时制度 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetWorkingHoursTypeSample.java ; + */ + public GetWorkingHoursTypeResp get(GetWorkingHoursTypeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/working_hours_types/:working_hours_type_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetWorkingHoursTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetWorkingHoursTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/working_hours_types/:working_hours_type_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询单个工时制度,根据 ID 查询单个工时制度 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetWorkingHoursTypeSample.java ; + */ + public GetWorkingHoursTypeResp get(GetWorkingHoursTypeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/working_hours_types/:working_hours_type_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetWorkingHoursTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetWorkingHoursTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/working_hours_types/:working_hours_type_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询工时制度,批量查询工时制度 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListWorkingHoursTypeSample.java ; + */ + public ListWorkingHoursTypeResp list(ListWorkingHoursTypeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/working_hours_types" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListWorkingHoursTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListWorkingHoursTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/working_hours_types" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询工时制度,批量查询工时制度 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListWorkingHoursTypeSample.java ; + */ + public ListWorkingHoursTypeResp list(ListWorkingHoursTypeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v1/working_hours_types" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListWorkingHoursTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListWorkingHoursTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/working_hours_types" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新工时制度,更新工时制度 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchWorkingHoursTypeSample.java ; + */ + public PatchWorkingHoursTypeResp patch(PatchWorkingHoursTypeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v1/working_hours_types/:working_hours_type_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchWorkingHoursTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchWorkingHoursTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/working_hours_types/:working_hours_type_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新工时制度,更新工时制度 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchWorkingHoursTypeSample.java ; + */ + public PatchWorkingHoursTypeResp patch(PatchWorkingHoursTypeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v1/working_hours_types/:working_hours_type_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchWorkingHoursTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchWorkingHoursTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v1/working_hours_types/:working_hours_type_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/V2.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/V2.java new file mode 100644 index 000000000..7b37ac7ac --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/V2.java @@ -0,0 +1,138 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.corehr.v2.resource.*; +import com.lark.oapi.service.corehr.v2.resource.Process; + +public class V2 { + private final Bp bp; // bp + private final Company company; // company + private final Contract contract; // contract + private final Department department; // department + private final Employee employee; // employee + private final EmployeesBp employeesBp; // employees.bp + private final EmployeesJobData employeesJobData; // employees.job_data + private final Job job; // job + private final JobChange jobChange; // job_change + private final JobFamily jobFamily; // job_family + private final JobLevel jobLevel; // job_level + private final Location location; // location + private final Person person; // person + private final PreHire preHire; // 待入职 + private final Probation probation; // probation + private final ProbationAssessment probationAssessment; // probation.assessment + private final Process process; // process + private final ProcessApprover processApprover; // process.approver + private final ProcessCc processCc; // process.cc + + public V2(Config config) { + this.bp = new Bp(config); + this.company = new Company(config); + this.contract = new Contract(config); + this.department = new Department(config); + this.employee = new Employee(config); + this.employeesBp = new EmployeesBp(config); + this.employeesJobData = new EmployeesJobData(config); + this.job = new Job(config); + this.jobChange = new JobChange(config); + this.jobFamily = new JobFamily(config); + this.jobLevel = new JobLevel(config); + this.location = new Location(config); + this.person = new Person(config); + this.preHire = new PreHire(config); + this.probation = new Probation(config); + this.probationAssessment = new ProbationAssessment(config); + this.process = new Process(config); + this.processApprover = new ProcessApprover(config); + this.processCc = new ProcessCc(config); + } + + public Bp bp() { + return bp; + } + + public Company company() { + return company; + } + + public Contract contract() { + return contract; + } + + public Department department() { + return department; + } + + public Employee employee() { + return employee; + } + + public EmployeesBp employeesBp() { + return employeesBp; + } + + public EmployeesJobData employeesJobData() { + return employeesJobData; + } + + public Job job() { + return job; + } + + public JobChange jobChange() { + return jobChange; + } + + public JobFamily jobFamily() { + return jobFamily; + } + + public JobLevel jobLevel() { + return jobLevel; + } + + public Location location() { + return location; + } + + public Person person() { + return person; + } + + public PreHire preHire() { + return preHire; + } + + public Probation probation() { + return probation; + } + + public ProbationAssessment probationAssessment() { + return probationAssessment; + } + + public Process process() { + return process; + } + + public ProcessApprover processApprover() { + return processApprover; + } + + public ProcessCc processCc() { + return processCc; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ApprovalGroupApprovalGroupStatusEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ApprovalGroupApprovalGroupStatusEnum.java new file mode 100644 index 000000000..3c6bef31c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ApprovalGroupApprovalGroupStatusEnum.java @@ -0,0 +1,36 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 组织架构调整流程状态 + */ +public enum ApprovalGroupApprovalGroupStatusEnum { + NEW("0"), // 待发起 + APPROVING("1"), // 审批中 + APPROVED("2"), // 审批通过 + DONE("3"), // 已完成 + REJECTED("4"), // 已拒绝 + CANCELED("5"), // 已撤销 + ; + private String value; + + ApprovalGroupApprovalGroupStatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ApprovalGroupDraftStatusEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ApprovalGroupDraftStatusEnum.java new file mode 100644 index 000000000..b7ebd5059 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ApprovalGroupDraftStatusEnum.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 组织架构调整任务状态 + */ +public enum ApprovalGroupDraftStatusEnum { + EDIT("0"), // 编辑中 + APPROVE("1"), // 审批中 + FINISH("2"), // 已完成 + WITHDREW("3"), // 已撤销 + ; + private String value; + + ApprovalGroupDraftStatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/AssessmentForCreateAssessmentResultEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/AssessmentForCreateAssessmentResultEnum.java new file mode 100644 index 000000000..5e10267af --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/AssessmentForCreateAssessmentResultEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 试用期考核结果 + */ +public enum AssessmentForCreateAssessmentResultEnum { + APPROVED("approved"), // 通过 + REJECTED("rejected"), // 不通过 + ; + private String value; + + AssessmentForCreateAssessmentResultEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/AssessmentForCreateAssessmentStatusEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/AssessmentForCreateAssessmentStatusEnum.java new file mode 100644 index 000000000..922f5f916 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/AssessmentForCreateAssessmentStatusEnum.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 考核状态 + */ +public enum AssessmentForCreateAssessmentStatusEnum { + NOT_STARTED("not_started"), // 未开始 + IN_PROCESS("in_process"), // 进行中 + COMPLETED("completed"), // 已完成 + NO_NEED("no_need"), // 无需考核 + ; + private String value; + + AssessmentForCreateAssessmentStatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BankBasicDataObjStatusEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BankBasicDataObjStatusEnum.java new file mode 100644 index 000000000..80ce50361 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BankBasicDataObjStatusEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 状态 + */ +public enum BankBasicDataObjStatusEnum { + EFFECTIVE(1), // 生效 + EXPIRATION(0), // 失效 + ; + private Integer value; + + BankBasicDataObjStatusEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BankBranchBasicDataObjStatusEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BankBranchBasicDataObjStatusEnum.java new file mode 100644 index 000000000..d48bb8a62 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BankBranchBasicDataObjStatusEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 状态 + */ +public enum BankBranchBasicDataObjStatusEnum { + EFFECTIVE(1), // 生效 + EXPIRATION(0), // 失效 + ; + private Integer value; + + BankBranchBasicDataObjStatusEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BatchGetEmployeeDepartmentIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BatchGetEmployeeDepartmentIdTypeEnum.java new file mode 100644 index 000000000..0d3d7cbfe --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BatchGetEmployeeDepartmentIdTypeEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 此次调用中使用的部门 ID 类型 + */ +public enum BatchGetEmployeeDepartmentIdTypeEnum { + OPEN_DEPARTMENT_ID("open_department_id"), // 以 open_department_id 来标识部门 + DEPARTMENT_ID("department_id"), // 以 department_id 来标识部门 + PEOPLE_COREHR_DEPARTMENT_ID("people_corehr_department_id"), // 以 people_corehr_department_id 来标识部门 + ; + private String value; + + BatchGetEmployeeDepartmentIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BatchGetEmployeeUserIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BatchGetEmployeeUserIdTypeEnum.java new file mode 100644 index 000000000..b4f8bd8e0 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BatchGetEmployeeUserIdTypeEnum.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 用户 ID 类型 + */ +public enum BatchGetEmployeeUserIdTypeEnum { + USER_ID("user_id"), // 以 user_id 来识别用户 + UNION_ID("union_id"), // 以 union_id 来识别用户 + OPEN_ID("open_id"), // 以 open_id 来识别用户 + PEOPLE_COREHR_ID("people_corehr_id"), // 以飞书人事的 ID 来识别用户 + ; + private String value; + + BatchGetEmployeeUserIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BatchGetEmployeesBpUserIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BatchGetEmployeesBpUserIdTypeEnum.java new file mode 100644 index 000000000..58690b105 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BatchGetEmployeesBpUserIdTypeEnum.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 用户 ID 类型 + */ +public enum BatchGetEmployeesBpUserIdTypeEnum { + USER_ID("user_id"), // 以 user_id 来识别用户 + UNION_ID("union_id"), // 以 union_id 来识别用户 + OPEN_ID("open_id"), // 以 open_id 来识别用户 + PEOPLE_COREHR_ID("people_corehr_id"), // 以飞书人事的 ID 来识别用户 + ; + private String value; + + BatchGetEmployeesBpUserIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BatchGetEmployeesJobDataDepartmentIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BatchGetEmployeesJobDataDepartmentIdTypeEnum.java new file mode 100644 index 000000000..59a44a67d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BatchGetEmployeesJobDataDepartmentIdTypeEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 此次调用中使用的部门 ID 类型 + */ +public enum BatchGetEmployeesJobDataDepartmentIdTypeEnum { + OPEN_DEPARTMENT_ID("open_department_id"), // 以 open_department_id 来标识部门 + DEPARTMENT_ID("department_id"), // 以 department_id 来标识部门 + PEOPLE_COREHR_DEPARTMENT_ID("people_corehr_department_id"), // 以 people_corehr_department_id 来标识部门 + ; + private String value; + + BatchGetEmployeesJobDataDepartmentIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BatchGetEmployeesJobDataUserIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BatchGetEmployeesJobDataUserIdTypeEnum.java new file mode 100644 index 000000000..d4033d25b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/BatchGetEmployeesJobDataUserIdTypeEnum.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 用户 ID 类型 + */ +public enum BatchGetEmployeesJobDataUserIdTypeEnum { + USER_ID("user_id"), // 以 user_id 来识别用户 + UNION_ID("union_id"), // 以 union_id 来识别用户 + OPEN_ID("open_id"), // 以 open_id 来识别用户 + PEOPLE_COREHR_ID("people_corehr_id"), // 以飞书人事的 ID 来识别用户 + ; + private String value; + + BatchGetEmployeesJobDataUserIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/CityBasicDataObjStatusEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/CityBasicDataObjStatusEnum.java new file mode 100644 index 000000000..7e8ec1cfb --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/CityBasicDataObjStatusEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 状态 + */ +public enum CityBasicDataObjStatusEnum { + EFFECTIVE(1), // 生效 + EXPIRATION(0), // 失效 + ; + private Integer value; + + CityBasicDataObjStatusEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/CountryRegionBasicDataObjStatusEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/CountryRegionBasicDataObjStatusEnum.java new file mode 100644 index 000000000..c1ac2a32a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/CountryRegionBasicDataObjStatusEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 状态 + */ +public enum CountryRegionBasicDataObjStatusEnum { + EFFECTIVE(1), // 生效 + EXPIRATION(0), // 失效 + ; + private Integer value; + + CountryRegionBasicDataObjStatusEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/CountryRegionSubdivisionBasicDataObjStatusEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/CountryRegionSubdivisionBasicDataObjStatusEnum.java new file mode 100644 index 000000000..d91248e0b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/CountryRegionSubdivisionBasicDataObjStatusEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 状态 + */ +public enum CountryRegionSubdivisionBasicDataObjStatusEnum { + EFFECTIVE(1), // 生效 + EXPIRATION(0), // 失效 + ; + private Integer value; + + CountryRegionSubdivisionBasicDataObjStatusEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/CreateProbationAssessmentUserIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/CreateProbationAssessmentUserIdTypeEnum.java new file mode 100644 index 000000000..1ef309bad --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/CreateProbationAssessmentUserIdTypeEnum.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 用户 ID 类型 + */ +public enum CreateProbationAssessmentUserIdTypeEnum { + USER_ID("user_id"), // 以 user_id 来识别用户 + UNION_ID("union_id"), // 以 union_id 来识别用户 + OPEN_ID("open_id"), // 以 open_id 来识别用户 + PEOPLE_COREHR_ID("people_corehr_id"), // 以飞书人事的 ID 来识别用户 + ; + private String value; + + CreateProbationAssessmentUserIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/CurrencyBasicDataObjStatusEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/CurrencyBasicDataObjStatusEnum.java new file mode 100644 index 000000000..7cd9ca022 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/CurrencyBasicDataObjStatusEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 状态 + */ +public enum CurrencyBasicDataObjStatusEnum { + EFFECTIVE(1), // 生效 + EXPIRATION(0), // 失效 + ; + private Integer value; + + CurrencyBasicDataObjStatusEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/DepartmentChangeDepartmentChangeTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/DepartmentChangeDepartmentChangeTypeEnum.java new file mode 100644 index 000000000..376b2ed9a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/DepartmentChangeDepartmentChangeTypeEnum.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 调整类型 + */ +public enum DepartmentChangeDepartmentChangeTypeEnum { + UNKNOWN("Unknown"), // 未知 + CREATE("Create"), // 新建 + MODIFY("Modify"), // 编辑 + INACTIVE("Inactive"), // 停用 + ; + private String value; + + DepartmentChangeDepartmentChangeTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/DistrictBasicDataObjStatusEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/DistrictBasicDataObjStatusEnum.java new file mode 100644 index 000000000..1a0fe30ca --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/DistrictBasicDataObjStatusEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 状态 + */ +public enum DistrictBasicDataObjStatusEnum { + EFFECTIVE(1), // 生效 + EXPIRATION(0), // 失效 + ; + private Integer value; + + DistrictBasicDataObjStatusEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/GetByDepartmentBpDepartmentIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/GetByDepartmentBpDepartmentIdTypeEnum.java new file mode 100644 index 000000000..4b5bc751b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/GetByDepartmentBpDepartmentIdTypeEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 此次调用中使用的部门 ID 类型 + */ +public enum GetByDepartmentBpDepartmentIdTypeEnum { + OPEN_DEPARTMENT_ID("open_department_id"), // 以 open_department_id 来标识部门 + DEPARTMENT_ID("department_id"), // 以 department_id 来标识部门 + PEOPLE_COREHR_DEPARTMENT_ID("people_corehr_department_id"), // 以 people_corehr_department_id 来标识部门 + ; + private String value; + + GetByDepartmentBpDepartmentIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/GetByDepartmentBpUserIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/GetByDepartmentBpUserIdTypeEnum.java new file mode 100644 index 000000000..52113dee3 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/GetByDepartmentBpUserIdTypeEnum.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 用户 ID 类型 + */ +public enum GetByDepartmentBpUserIdTypeEnum { + USER_ID("user_id"), // 以 user_id 来识别用户 + UNION_ID("union_id"), // 以 union_id 来识别用户 + OPEN_ID("open_id"), // 以 open_id 来识别用户 + PEOPLE_COREHR_ID("people_corehr_id"), // 以飞书人事的 ID 来识别用户 + ; + private String value; + + GetByDepartmentBpUserIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/GetProcessUserIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/GetProcessUserIdTypeEnum.java new file mode 100644 index 000000000..1f28eed1c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/GetProcessUserIdTypeEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 用户 ID 类型 + */ +public enum GetProcessUserIdTypeEnum { + USER_ID("user_id"), // 以 user_id 来识别用户 + UNION_ID("union_id"), // 以 union_id 来识别用户 + OPEN_ID("open_id"), // 以 open_id 来识别用户 + ; + private String value; + + GetProcessUserIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/JobChangeJobChangeStatusEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/JobChangeJobChangeStatusEnum.java new file mode 100644 index 000000000..e3fea3b6d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/JobChangeJobChangeStatusEnum.java @@ -0,0 +1,36 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 异动状态 + */ +public enum JobChangeJobChangeStatusEnum { + APPROVING("Approving"), // 审批中 + APPROVED("Approved"), // 审批通过 + TRANSFORMED("Transformed"), // 已异动 + REJECTED("Rejected"), // 已拒绝 + CANCELLED("Cancelled"), // 已撤销 + NONEEDAPPROVAL("NoNeedApproval"), // 无需审批 + ; + private String value; + + JobChangeJobChangeStatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ListBpDepartmentIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ListBpDepartmentIdTypeEnum.java new file mode 100644 index 000000000..f75a50a6f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ListBpDepartmentIdTypeEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 此次调用中使用的部门 ID 类型 + */ +public enum ListBpDepartmentIdTypeEnum { + OPEN_DEPARTMENT_ID("open_department_id"), // 以 open_department_id 来标识部门 + DEPARTMENT_ID("department_id"), // 以 department_id 来标识部门 + PEOPLE_COREHR_DEPARTMENT_ID("people_corehr_department_id"), // 以 people_corehr_department_id 来标识部门 + ; + private String value; + + ListBpDepartmentIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ListBpUserIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ListBpUserIdTypeEnum.java new file mode 100644 index 000000000..e6f52862f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ListBpUserIdTypeEnum.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 用户 ID 类型 + */ +public enum ListBpUserIdTypeEnum { + USER_ID("user_id"), // 以 user_id 来识别用户 + UNION_ID("union_id"), // 以 union_id 来识别用户 + OPEN_ID("open_id"), // 以 open_id 来识别用户 + PEOPLE_COREHR_ID("people_corehr_id"), // 以飞书人事的 ID 来识别用户 + ; + private String value; + + ListBpUserIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/NationalityBasicDataObjStatusEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/NationalityBasicDataObjStatusEnum.java new file mode 100644 index 000000000..6d65ba6b5 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/NationalityBasicDataObjStatusEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 状态 + */ +public enum NationalityBasicDataObjStatusEnum { + EFFECTIVE(1), // 生效 + EXPIRATION(0), // 失效 + ; + private Integer value; + + NationalityBasicDataObjStatusEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/OnboardingTaskTaskStatusEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/OnboardingTaskTaskStatusEnum.java new file mode 100644 index 000000000..67c0feb03 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/OnboardingTaskTaskStatusEnum.java @@ -0,0 +1,41 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 任务名称 + */ +public enum OnboardingTaskTaskStatusEnum { + INITIATING("initiating"), // 发起中 + TERMINATED("terminated"), // 已终止 + EXCEPTION("exception"), // 异常 + INPROGRESS("in_progress"), // 进行中 + NOTSTARTED("not_started"), // 未开始 + SKIPPED("skipped"), // 已跳过 + UNINITIALIZED("uninitialized"), // 未初始化 + FAILED("failed"), // 已失败 + INREVIEW("in_review"), // 审核中 + REJECTED("rejected"), // 已退回 + COMPLETED("completed"), // 已完成 + ; + private String value; + + OnboardingTaskTaskStatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ParentsDepartmentDepartmentIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ParentsDepartmentDepartmentIdTypeEnum.java new file mode 100644 index 000000000..b0baaa9f9 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ParentsDepartmentDepartmentIdTypeEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 此次调用中使用的部门 ID 类型 + */ +public enum ParentsDepartmentDepartmentIdTypeEnum { + OPEN_DEPARTMENT_ID("open_department_id"), // 以 open_department_id 来标识部门 + DEPARTMENT_ID("department_id"), // 以 department_id 来标识部门 + PEOPLE_COREHR_DEPARTMENT_ID("people_corehr_department_id"), // 以 people_corehr_department_id 来标识部门 + ; + private String value; + + ParentsDepartmentDepartmentIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/PatchProbationAssessmentAssessmentResultEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/PatchProbationAssessmentAssessmentResultEnum.java new file mode 100644 index 000000000..4cc184287 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/PatchProbationAssessmentAssessmentResultEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 试用期考核结果 + */ +public enum PatchProbationAssessmentAssessmentResultEnum { + APPROVED("approved"), // 通过 + REJECTED("rejected"), // 不通过 + ; + private String value; + + PatchProbationAssessmentAssessmentResultEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/PatchProbationAssessmentAssessmentStatusEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/PatchProbationAssessmentAssessmentStatusEnum.java new file mode 100644 index 000000000..d09840234 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/PatchProbationAssessmentAssessmentStatusEnum.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 考核状态 + */ +public enum PatchProbationAssessmentAssessmentStatusEnum { + NOT_STARTED("not_started"), // 未开始 + IN_PROCESS("in_process"), // 进行中 + COMPLETED("completed"), // 已完成 + NO_NEED("no_need"), // 无需考核 + ; + private String value; + + PatchProbationAssessmentAssessmentStatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/PreHireEmploymentInfoRehireEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/PreHireEmploymentInfoRehireEnum.java new file mode 100644 index 000000000..a5a8e8c7c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/PreHireEmploymentInfoRehireEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 是否离职重聘 + */ +public enum PreHireEmploymentInfoRehireEnum { + TOBECONFIRMED("to_be_confirmed"), // 待确认,系统会判断该员工是否存在历史雇佣记录,如果存在且需要二次确认时会调用失败,并返回历史雇佣记录 + NO("no"), // 否,系统直接标为非离职重聘人员,不再做重复判断 + YES("yes"), // 是,要求历史雇佣信息 ID 必填 + ; + private String value; + + PreHireEmploymentInfoRehireEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ProcessDoneItemApproverStatusEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ProcessDoneItemApproverStatusEnum.java new file mode 100644 index 000000000..118d953d3 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ProcessDoneItemApproverStatusEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 单据状态 + */ +public enum ProcessDoneItemApproverStatusEnum { + APPROVED(3), // 已完成 + REJECT(2), // 拒绝 + CANCEL(4), // 取消 + ; + private Integer value; + + ProcessDoneItemApproverStatusEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ProcessDoneItemApproverTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ProcessDoneItemApproverTypeEnum.java new file mode 100644 index 000000000..d5b6636e1 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ProcessDoneItemApproverTypeEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 单据类型 + */ +public enum ProcessDoneItemApproverTypeEnum { + APPROVER(1), // 审批单 + FORM(5), // 表单 + ; + private Integer value; + + ProcessDoneItemApproverTypeEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ProcessTodoItemApproverTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ProcessTodoItemApproverTypeEnum.java new file mode 100644 index 000000000..169e0ba72 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/ProcessTodoItemApproverTypeEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 单据类型 + */ +public enum ProcessTodoItemApproverTypeEnum { + APPROVER(1), // 审批单 + FORM(5), // 表单 + ; + private Integer value; + + ProcessTodoItemApproverTypeEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/QueryEmployeesJobDataDepartmentIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/QueryEmployeesJobDataDepartmentIdTypeEnum.java new file mode 100644 index 000000000..976eed9c2 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/QueryEmployeesJobDataDepartmentIdTypeEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 此次调用中使用的部门 ID 类型 + */ +public enum QueryEmployeesJobDataDepartmentIdTypeEnum { + OPEN_DEPARTMENT_ID("open_department_id"), // 以 open_department_id 来标识部门 + DEPARTMENT_ID("department_id"), // 以 department_id 来标识部门 + PEOPLE_COREHR_DEPARTMENT_ID("people_corehr_department_id"), // 以 people_corehr_department_id 来标识部门 + ; + private String value; + + QueryEmployeesJobDataDepartmentIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/QueryEmployeesJobDataUserIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/QueryEmployeesJobDataUserIdTypeEnum.java new file mode 100644 index 000000000..184b1c8fb --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/QueryEmployeesJobDataUserIdTypeEnum.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 用户 ID 类型 + */ +public enum QueryEmployeesJobDataUserIdTypeEnum { + USER_ID("user_id"), // 以 user_id 来识别用户 + UNION_ID("union_id"), // 以 union_id 来识别用户 + OPEN_ID("open_id"), // 以 open_id 来识别用户 + PEOPLE_COREHR_ID("people_corehr_id"), // 以飞书人事的 ID 来识别用户 + ; + private String value; + + QueryEmployeesJobDataUserIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchContractUserIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchContractUserIdTypeEnum.java new file mode 100644 index 000000000..b33ce4b9e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchContractUserIdTypeEnum.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 用户 ID 类型 + */ +public enum SearchContractUserIdTypeEnum { + USER_ID("user_id"), // 以 user_id 来识别用户 + UNION_ID("union_id"), // 以 union_id 来识别用户 + OPEN_ID("open_id"), // 以 open_id 来识别用户 + PEOPLE_COREHR_ID("people_corehr_id"), // 以飞书人事的 ID 来识别用户 + ; + private String value; + + SearchContractUserIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchDepartmentDepartmentIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchDepartmentDepartmentIdTypeEnum.java new file mode 100644 index 000000000..af2b3f834 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchDepartmentDepartmentIdTypeEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 此次调用中使用的部门 ID 类型 + */ +public enum SearchDepartmentDepartmentIdTypeEnum { + OPEN_DEPARTMENT_ID("open_department_id"), // 以 open_department_id 来标识部门 + DEPARTMENT_ID("department_id"), // 以 department_id 来标识部门 + PEOPLE_COREHR_DEPARTMENT_ID("people_corehr_department_id"), // 以 people_corehr_department_id 来标识部门 + ; + private String value; + + SearchDepartmentDepartmentIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchDepartmentUserIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchDepartmentUserIdTypeEnum.java new file mode 100644 index 000000000..d4a878e88 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchDepartmentUserIdTypeEnum.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 用户 ID 类型 + */ +public enum SearchDepartmentUserIdTypeEnum { + USER_ID("user_id"), // 以 user_id 来识别用户 + UNION_ID("union_id"), // 以 union_id 来识别用户 + OPEN_ID("open_id"), // 以 open_id 来识别用户 + PEOPLE_COREHR_ID("people_corehr_id"), // 以飞书人事的 ID 来识别用户 + ; + private String value; + + SearchDepartmentUserIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchEmployeeDepartmentIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchEmployeeDepartmentIdTypeEnum.java new file mode 100644 index 000000000..28e7a1519 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchEmployeeDepartmentIdTypeEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 此次调用中使用的部门 ID 类型 + */ +public enum SearchEmployeeDepartmentIdTypeEnum { + OPEN_DEPARTMENT_ID("open_department_id"), // 以 open_department_id 来标识部门 + DEPARTMENT_ID("department_id"), // 以 department_id 来标识部门 + PEOPLE_COREHR_DEPARTMENT_ID("people_corehr_department_id"), // 以 people_corehr_department_id 来标识部门 + ; + private String value; + + SearchEmployeeDepartmentIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchEmployeeEmploymentStatusEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchEmployeeEmploymentStatusEnum.java new file mode 100644 index 000000000..21111cdbe --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchEmployeeEmploymentStatusEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 雇佣状态 + */ +public enum SearchEmployeeEmploymentStatusEnum { + HIRED("hired"), // 在职 + TERMINATED("terminated"), // 离职 + ; + private String value; + + SearchEmployeeEmploymentStatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchEmployeeUserIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchEmployeeUserIdTypeEnum.java new file mode 100644 index 000000000..ddf0c5a82 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchEmployeeUserIdTypeEnum.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 用户 ID 类型 + */ +public enum SearchEmployeeUserIdTypeEnum { + USER_ID("user_id"), // 以 user_id 来识别用户 + UNION_ID("union_id"), // 以 union_id 来识别用户 + OPEN_ID("open_id"), // 以 open_id 来识别用户 + PEOPLE_COREHR_ID("people_corehr_id"), // 以飞书人事的 ID 来识别用户 + ; + private String value; + + SearchEmployeeUserIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchJobChangeDepartmentIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchJobChangeDepartmentIdTypeEnum.java new file mode 100644 index 000000000..c1f2d5ec6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchJobChangeDepartmentIdTypeEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 此次调用中使用的部门 ID 类型 + */ +public enum SearchJobChangeDepartmentIdTypeEnum { + OPEN_DEPARTMENT_ID("open_department_id"), // 以 open_department_id 来标识部门 + DEPARTMENT_ID("department_id"), // 以 department_id 来标识部门 + PEOPLE_COREHR_DEPARTMENT_ID("people_corehr_department_id"), // 以 people_corehr_department_id 来标识部门 + ; + private String value; + + SearchJobChangeDepartmentIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchJobChangeUserIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchJobChangeUserIdTypeEnum.java new file mode 100644 index 000000000..dd3be3255 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchJobChangeUserIdTypeEnum.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 用户 ID 类型 + */ +public enum SearchJobChangeUserIdTypeEnum { + USER_ID("user_id"), // 以 user_id 来识别用户 + UNION_ID("union_id"), // 以 union_id 来识别用户 + OPEN_ID("open_id"), // 以 open_id 来识别用户 + PEOPLE_COREHR_ID("people_corehr_id"), // 以飞书人事的 ID 来识别用户 + ; + private String value; + + SearchJobChangeUserIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchProbationDepartmentIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchProbationDepartmentIdTypeEnum.java new file mode 100644 index 000000000..9007c00a3 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchProbationDepartmentIdTypeEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 此次调用中使用的部门 ID 类型 + */ +public enum SearchProbationDepartmentIdTypeEnum { + OPEN_DEPARTMENT_ID("open_department_id"), // 以 open_department_id 来标识部门 + DEPARTMENT_ID("department_id"), // 以 department_id 来标识部门 + PEOPLE_COREHR_DEPARTMENT_ID("people_corehr_department_id"), // 以 people_corehr_department_id 来标识部门 + ; + private String value; + + SearchProbationDepartmentIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchProbationFinalAssessmentResultEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchProbationFinalAssessmentResultEnum.java new file mode 100644 index 000000000..cd1e039c9 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchProbationFinalAssessmentResultEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 试用期最终考核结果 + */ +public enum SearchProbationFinalAssessmentResultEnum { + APPROVED("approved"), // 通过 + REJECTED("rejected"), // 不通过 + ; + private String value; + + SearchProbationFinalAssessmentResultEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchProbationProbationStatusEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchProbationProbationStatusEnum.java new file mode 100644 index 000000000..015682f28 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchProbationProbationStatusEnum.java @@ -0,0 +1,36 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 试用期状态 + */ +public enum SearchProbationProbationStatusEnum { + PENDING("pending"), // 审批中 + REJECTED("rejected"), // 已拒绝 + WAITING("waiting"), // 待发起转正 + APPROVED("approved"), // 审批通过 + CONVERTED("converted"), // 已转正 + OFFBOARDED("offboarded"), // 已离职 + ; + private String value; + + SearchProbationProbationStatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchProbationUserIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchProbationUserIdTypeEnum.java new file mode 100644 index 000000000..1579c9b3b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/enums/SearchProbationUserIdTypeEnum.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.enums; + +/** + * 用户 ID 类型 + */ +public enum SearchProbationUserIdTypeEnum { + USER_ID("user_id"), // 以 user_id 来识别用户 + UNION_ID("union_id"), // 以 union_id 来识别用户 + OPEN_ID("open_id"), // 以 open_id 来识别用户 + PEOPLE_COREHR_ID("people_corehr_id"), // 以飞书人事的 ID 来识别用户 + ; + private String value; + + SearchProbationUserIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/AbnormalReason.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/AbnormalReason.java new file mode 100644 index 000000000..13bed7c38 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/AbnormalReason.java @@ -0,0 +1,148 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class AbnormalReason { + /** + * 异常原因ID + *

示例值:6893014062142064135 + */ + @SerializedName("id") + private String id; + /** + * 异常原因类型,1-系统异常,2-用户自定义异常; + *

示例值:1 + */ + @SerializedName("type") + private Integer type; + /** + * 异常原因列表 + *

示例值: + */ + @SerializedName("i18n_elements") + private AbnormalReasonI18nElement[] i18nElements; + + // builder 开始 + public AbnormalReason() { + } + + public AbnormalReason(Builder builder) { + /** + * 异常原因ID + *

示例值:6893014062142064135 + */ + this.id = builder.id; + /** + * 异常原因类型,1-系统异常,2-用户自定义异常; + *

示例值:1 + */ + this.type = builder.type; + /** + * 异常原因列表 + *

示例值: + */ + this.i18nElements = builder.i18nElements; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public Integer getType() { + return this.type; + } + + public void setType(Integer type) { + this.type = type; + } + + public AbnormalReasonI18nElement[] getI18nElements() { + return this.i18nElements; + } + + public void setI18nElements(AbnormalReasonI18nElement[] i18nElements) { + this.i18nElements = i18nElements; + } + + public static class Builder { + /** + * 异常原因ID + *

示例值:6893014062142064135 + */ + private String id; + /** + * 异常原因类型,1-系统异常,2-用户自定义异常; + *

示例值:1 + */ + private Integer type; + /** + * 异常原因列表 + *

示例值: + */ + private AbnormalReasonI18nElement[] i18nElements; + + /** + * 异常原因ID + *

示例值:6893014062142064135 + * + * @param id + * @return + */ + public Builder id(String id) { + this.id = id; + return this; + } + + + /** + * 异常原因类型,1-系统异常,2-用户自定义异常; + *

示例值:1 + * + * @param type + * @return + */ + public Builder type(Integer type) { + this.type = type; + return this; + } + + + /** + * 异常原因列表 + *

示例值: + * + * @param i18nElements + * @return + */ + public Builder i18nElements(AbnormalReasonI18nElement[] i18nElements) { + this.i18nElements = i18nElements; + return this; + } + + + public AbnormalReason build() { + return new AbnormalReason(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/AbnormalReasonElement.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/AbnormalReasonElement.java new file mode 100644 index 000000000..ef039d175 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/AbnormalReasonElement.java @@ -0,0 +1,148 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class AbnormalReasonElement { + /** + * 组件类型 + *

示例值:a,text + */ + @SerializedName("tag") + private String tag; + /** + * 文本 + *

示例值:这个是一个文本字段 + */ + @SerializedName("text") + private String text; + /** + * 超链接 + *

示例值:https://open.feishu.cn/ + */ + @SerializedName("href") + private String href; + + // builder 开始 + public AbnormalReasonElement() { + } + + public AbnormalReasonElement(Builder builder) { + /** + * 组件类型 + *

示例值:a,text + */ + this.tag = builder.tag; + /** + * 文本 + *

示例值:这个是一个文本字段 + */ + this.text = builder.text; + /** + * 超链接 + *

示例值:https://open.feishu.cn/ + */ + this.href = builder.href; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getTag() { + return this.tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + public String getText() { + return this.text; + } + + public void setText(String text) { + this.text = text; + } + + public String getHref() { + return this.href; + } + + public void setHref(String href) { + this.href = href; + } + + public static class Builder { + /** + * 组件类型 + *

示例值:a,text + */ + private String tag; + /** + * 文本 + *

示例值:这个是一个文本字段 + */ + private String text; + /** + * 超链接 + *

示例值:https://open.feishu.cn/ + */ + private String href; + + /** + * 组件类型 + *

示例值:a,text + * + * @param tag + * @return + */ + public Builder tag(String tag) { + this.tag = tag; + return this; + } + + + /** + * 文本 + *

示例值:这个是一个文本字段 + * + * @param text + * @return + */ + public Builder text(String text) { + this.text = text; + return this; + } + + + /** + * 超链接 + *

示例值:https://open.feishu.cn/ + * + * @param href + * @return + */ + public Builder href(String href) { + this.href = href; + return this; + } + + + public AbnormalReasonElement build() { + return new AbnormalReasonElement(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/AbnormalReasonI18nElement.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/AbnormalReasonI18nElement.java new file mode 100644 index 000000000..b8b1c9357 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/AbnormalReasonI18nElement.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class AbnormalReasonI18nElement { + /** + * 语言 + *

示例值:zh-CN,en-US + */ + @SerializedName("lang") + private String lang; + /** + * 异常原因列表 + *

示例值: + */ + @SerializedName("elements") + private AbnormalReasonElement[] elements; + + // builder 开始 + public AbnormalReasonI18nElement() { + } + + public AbnormalReasonI18nElement(Builder builder) { + /** + * 语言 + *

示例值:zh-CN,en-US + */ + this.lang = builder.lang; + /** + * 异常原因列表 + *

示例值: + */ + this.elements = builder.elements; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getLang() { + return this.lang; + } + + public void setLang(String lang) { + this.lang = lang; + } + + public AbnormalReasonElement[] getElements() { + return this.elements; + } + + public void setElements(AbnormalReasonElement[] elements) { + this.elements = elements; + } + + public static class Builder { + /** + * 语言 + *

示例值:zh-CN,en-US + */ + private String lang; + /** + * 异常原因列表 + *

示例值: + */ + private AbnormalReasonElement[] elements; + + /** + * 语言 + *

示例值:zh-CN,en-US + * + * @param lang + * @return + */ + public Builder lang(String lang) { + this.lang = lang; + return this; + } + + + /** + * 异常原因列表 + *

示例值: + * + * @param elements + * @return + */ + public Builder elements(AbnormalReasonElement[] elements) { + this.elements = elements; + return this; + } + + + public AbnormalReasonI18nElement build() { + return new AbnormalReasonI18nElement(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Address.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Address.java new file mode 100644 index 000000000..50be4d603 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Address.java @@ -0,0 +1,740 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Address { + /** + * 完整地址(本地文字) + *

示例值:中国北京北京 + */ + @SerializedName("full_address_local_script") + private String fullAddressLocalScript; + /** + * 完整地址(西方文字) + *

示例值:Beijing, Beijing, China, + */ + @SerializedName("full_address_western_script") + private String fullAddressWesternScript; + /** + * 地址 ID + *

示例值:6989822217869624863 + */ + @SerializedName("address_id") + private String addressId; + /** + * 国家 / 地区 + *

示例值:6862995757234914824 + */ + @SerializedName("country_region_id") + private String countryRegionId; + /** + * 主要行政区 + *

示例值:6863326815667095047 + */ + @SerializedName("region_id") + private String regionId; + /** + * 地址行 1(非拉丁语系的本地文字) + *

示例值:丹佛测试地址-纽埃时区 + */ + @SerializedName("local_address_line1") + private String localAddressLine1; + /** + * 地址行 2(非拉丁语系的本地文字) + *

示例值:PoewH + */ + @SerializedName("local_address_line2") + private String localAddressLine2; + /** + * 地址行 3(非拉丁语系的本地文字) + *

示例值:PoewH + */ + @SerializedName("local_address_line3") + private String localAddressLine3; + /** + * 地址行 4(非拉丁语系的本地文字) + *

示例值:jmwJc + */ + @SerializedName("local_address_line4") + private String localAddressLine4; + /** + * 地址行 5(非拉丁语系的本地文字) + *

示例值:jmwJc + */ + @SerializedName("local_address_line5") + private String localAddressLine5; + /** + * 地址行 6(非拉丁语系的本地文字) + *

示例值:jmwJc + */ + @SerializedName("local_address_line6") + private String localAddressLine6; + /** + * 地址行 7(非拉丁语系的本地文字) + *

示例值:jmwJc + */ + @SerializedName("local_address_line7") + private String localAddressLine7; + /** + * 地址行 8(非拉丁语系的本地文字) + *

示例值:rafSu + */ + @SerializedName("local_address_line8") + private String localAddressLine8; + /** + * 地址行 9(非拉丁语系的本地文字) + *

示例值:McPRG + */ + @SerializedName("local_address_line9") + private String localAddressLine9; + /** + * 邮政编码 + *

示例值:611530 + */ + @SerializedName("postal_code") + private String postalCode; + /** + * 地址类型 + *

示例值: + */ + @SerializedName("address_type_list") + private Enum[] addressTypeList; + /** + * 主要地址 + *

示例值:true + */ + @SerializedName("is_primary") + private Boolean isPrimary; + /** + * 公开地址 + *

示例值:true + */ + @SerializedName("is_public") + private Boolean isPublic; + /** + * 自定义字段 + *

示例值: + */ + @SerializedName("custom_fields") + private CustomFieldData[] customFields; + + // builder 开始 + public Address() { + } + + public Address(Builder builder) { + /** + * 完整地址(本地文字) + *

示例值:中国北京北京 + */ + this.fullAddressLocalScript = builder.fullAddressLocalScript; + /** + * 完整地址(西方文字) + *

示例值:Beijing, Beijing, China, + */ + this.fullAddressWesternScript = builder.fullAddressWesternScript; + /** + * 地址 ID + *

示例值:6989822217869624863 + */ + this.addressId = builder.addressId; + /** + * 国家 / 地区 + *

示例值:6862995757234914824 + */ + this.countryRegionId = builder.countryRegionId; + /** + * 主要行政区 + *

示例值:6863326815667095047 + */ + this.regionId = builder.regionId; + /** + * 地址行 1(非拉丁语系的本地文字) + *

示例值:丹佛测试地址-纽埃时区 + */ + this.localAddressLine1 = builder.localAddressLine1; + /** + * 地址行 2(非拉丁语系的本地文字) + *

示例值:PoewH + */ + this.localAddressLine2 = builder.localAddressLine2; + /** + * 地址行 3(非拉丁语系的本地文字) + *

示例值:PoewH + */ + this.localAddressLine3 = builder.localAddressLine3; + /** + * 地址行 4(非拉丁语系的本地文字) + *

示例值:jmwJc + */ + this.localAddressLine4 = builder.localAddressLine4; + /** + * 地址行 5(非拉丁语系的本地文字) + *

示例值:jmwJc + */ + this.localAddressLine5 = builder.localAddressLine5; + /** + * 地址行 6(非拉丁语系的本地文字) + *

示例值:jmwJc + */ + this.localAddressLine6 = builder.localAddressLine6; + /** + * 地址行 7(非拉丁语系的本地文字) + *

示例值:jmwJc + */ + this.localAddressLine7 = builder.localAddressLine7; + /** + * 地址行 8(非拉丁语系的本地文字) + *

示例值:rafSu + */ + this.localAddressLine8 = builder.localAddressLine8; + /** + * 地址行 9(非拉丁语系的本地文字) + *

示例值:McPRG + */ + this.localAddressLine9 = builder.localAddressLine9; + /** + * 邮政编码 + *

示例值:611530 + */ + this.postalCode = builder.postalCode; + /** + * 地址类型 + *

示例值: + */ + this.addressTypeList = builder.addressTypeList; + /** + * 主要地址 + *

示例值:true + */ + this.isPrimary = builder.isPrimary; + /** + * 公开地址 + *

示例值:true + */ + this.isPublic = builder.isPublic; + /** + * 自定义字段 + *

示例值: + */ + this.customFields = builder.customFields; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getFullAddressLocalScript() { + return this.fullAddressLocalScript; + } + + public void setFullAddressLocalScript(String fullAddressLocalScript) { + this.fullAddressLocalScript = fullAddressLocalScript; + } + + public String getFullAddressWesternScript() { + return this.fullAddressWesternScript; + } + + public void setFullAddressWesternScript(String fullAddressWesternScript) { + this.fullAddressWesternScript = fullAddressWesternScript; + } + + public String getAddressId() { + return this.addressId; + } + + public void setAddressId(String addressId) { + this.addressId = addressId; + } + + public String getCountryRegionId() { + return this.countryRegionId; + } + + public void setCountryRegionId(String countryRegionId) { + this.countryRegionId = countryRegionId; + } + + public String getRegionId() { + return this.regionId; + } + + public void setRegionId(String regionId) { + this.regionId = regionId; + } + + public String getLocalAddressLine1() { + return this.localAddressLine1; + } + + public void setLocalAddressLine1(String localAddressLine1) { + this.localAddressLine1 = localAddressLine1; + } + + public String getLocalAddressLine2() { + return this.localAddressLine2; + } + + public void setLocalAddressLine2(String localAddressLine2) { + this.localAddressLine2 = localAddressLine2; + } + + public String getLocalAddressLine3() { + return this.localAddressLine3; + } + + public void setLocalAddressLine3(String localAddressLine3) { + this.localAddressLine3 = localAddressLine3; + } + + public String getLocalAddressLine4() { + return this.localAddressLine4; + } + + public void setLocalAddressLine4(String localAddressLine4) { + this.localAddressLine4 = localAddressLine4; + } + + public String getLocalAddressLine5() { + return this.localAddressLine5; + } + + public void setLocalAddressLine5(String localAddressLine5) { + this.localAddressLine5 = localAddressLine5; + } + + public String getLocalAddressLine6() { + return this.localAddressLine6; + } + + public void setLocalAddressLine6(String localAddressLine6) { + this.localAddressLine6 = localAddressLine6; + } + + public String getLocalAddressLine7() { + return this.localAddressLine7; + } + + public void setLocalAddressLine7(String localAddressLine7) { + this.localAddressLine7 = localAddressLine7; + } + + public String getLocalAddressLine8() { + return this.localAddressLine8; + } + + public void setLocalAddressLine8(String localAddressLine8) { + this.localAddressLine8 = localAddressLine8; + } + + public String getLocalAddressLine9() { + return this.localAddressLine9; + } + + public void setLocalAddressLine9(String localAddressLine9) { + this.localAddressLine9 = localAddressLine9; + } + + public String getPostalCode() { + return this.postalCode; + } + + public void setPostalCode(String postalCode) { + this.postalCode = postalCode; + } + + public Enum[] getAddressTypeList() { + return this.addressTypeList; + } + + public void setAddressTypeList(Enum[] addressTypeList) { + this.addressTypeList = addressTypeList; + } + + public Boolean getIsPrimary() { + return this.isPrimary; + } + + public void setIsPrimary(Boolean isPrimary) { + this.isPrimary = isPrimary; + } + + public Boolean getIsPublic() { + return this.isPublic; + } + + public void setIsPublic(Boolean isPublic) { + this.isPublic = isPublic; + } + + public CustomFieldData[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(CustomFieldData[] customFields) { + this.customFields = customFields; + } + + public static class Builder { + /** + * 完整地址(本地文字) + *

示例值:中国北京北京 + */ + private String fullAddressLocalScript; + /** + * 完整地址(西方文字) + *

示例值:Beijing, Beijing, China, + */ + private String fullAddressWesternScript; + /** + * 地址 ID + *

示例值:6989822217869624863 + */ + private String addressId; + /** + * 国家 / 地区 + *

示例值:6862995757234914824 + */ + private String countryRegionId; + /** + * 主要行政区 + *

示例值:6863326815667095047 + */ + private String regionId; + /** + * 地址行 1(非拉丁语系的本地文字) + *

示例值:丹佛测试地址-纽埃时区 + */ + private String localAddressLine1; + /** + * 地址行 2(非拉丁语系的本地文字) + *

示例值:PoewH + */ + private String localAddressLine2; + /** + * 地址行 3(非拉丁语系的本地文字) + *

示例值:PoewH + */ + private String localAddressLine3; + /** + * 地址行 4(非拉丁语系的本地文字) + *

示例值:jmwJc + */ + private String localAddressLine4; + /** + * 地址行 5(非拉丁语系的本地文字) + *

示例值:jmwJc + */ + private String localAddressLine5; + /** + * 地址行 6(非拉丁语系的本地文字) + *

示例值:jmwJc + */ + private String localAddressLine6; + /** + * 地址行 7(非拉丁语系的本地文字) + *

示例值:jmwJc + */ + private String localAddressLine7; + /** + * 地址行 8(非拉丁语系的本地文字) + *

示例值:rafSu + */ + private String localAddressLine8; + /** + * 地址行 9(非拉丁语系的本地文字) + *

示例值:McPRG + */ + private String localAddressLine9; + /** + * 邮政编码 + *

示例值:611530 + */ + private String postalCode; + /** + * 地址类型 + *

示例值: + */ + private Enum[] addressTypeList; + /** + * 主要地址 + *

示例值:true + */ + private Boolean isPrimary; + /** + * 公开地址 + *

示例值:true + */ + private Boolean isPublic; + /** + * 自定义字段 + *

示例值: + */ + private CustomFieldData[] customFields; + + /** + * 完整地址(本地文字) + *

示例值:中国北京北京 + * + * @param fullAddressLocalScript + * @return + */ + public Builder fullAddressLocalScript(String fullAddressLocalScript) { + this.fullAddressLocalScript = fullAddressLocalScript; + return this; + } + + + /** + * 完整地址(西方文字) + *

示例值:Beijing, Beijing, China, + * + * @param fullAddressWesternScript + * @return + */ + public Builder fullAddressWesternScript(String fullAddressWesternScript) { + this.fullAddressWesternScript = fullAddressWesternScript; + return this; + } + + + /** + * 地址 ID + *

示例值:6989822217869624863 + * + * @param addressId + * @return + */ + public Builder addressId(String addressId) { + this.addressId = addressId; + return this; + } + + + /** + * 国家 / 地区 + *

示例值:6862995757234914824 + * + * @param countryRegionId + * @return + */ + public Builder countryRegionId(String countryRegionId) { + this.countryRegionId = countryRegionId; + return this; + } + + + /** + * 主要行政区 + *

示例值:6863326815667095047 + * + * @param regionId + * @return + */ + public Builder regionId(String regionId) { + this.regionId = regionId; + return this; + } + + + /** + * 地址行 1(非拉丁语系的本地文字) + *

示例值:丹佛测试地址-纽埃时区 + * + * @param localAddressLine1 + * @return + */ + public Builder localAddressLine1(String localAddressLine1) { + this.localAddressLine1 = localAddressLine1; + return this; + } + + + /** + * 地址行 2(非拉丁语系的本地文字) + *

示例值:PoewH + * + * @param localAddressLine2 + * @return + */ + public Builder localAddressLine2(String localAddressLine2) { + this.localAddressLine2 = localAddressLine2; + return this; + } + + + /** + * 地址行 3(非拉丁语系的本地文字) + *

示例值:PoewH + * + * @param localAddressLine3 + * @return + */ + public Builder localAddressLine3(String localAddressLine3) { + this.localAddressLine3 = localAddressLine3; + return this; + } + + + /** + * 地址行 4(非拉丁语系的本地文字) + *

示例值:jmwJc + * + * @param localAddressLine4 + * @return + */ + public Builder localAddressLine4(String localAddressLine4) { + this.localAddressLine4 = localAddressLine4; + return this; + } + + + /** + * 地址行 5(非拉丁语系的本地文字) + *

示例值:jmwJc + * + * @param localAddressLine5 + * @return + */ + public Builder localAddressLine5(String localAddressLine5) { + this.localAddressLine5 = localAddressLine5; + return this; + } + + + /** + * 地址行 6(非拉丁语系的本地文字) + *

示例值:jmwJc + * + * @param localAddressLine6 + * @return + */ + public Builder localAddressLine6(String localAddressLine6) { + this.localAddressLine6 = localAddressLine6; + return this; + } + + + /** + * 地址行 7(非拉丁语系的本地文字) + *

示例值:jmwJc + * + * @param localAddressLine7 + * @return + */ + public Builder localAddressLine7(String localAddressLine7) { + this.localAddressLine7 = localAddressLine7; + return this; + } + + + /** + * 地址行 8(非拉丁语系的本地文字) + *

示例值:rafSu + * + * @param localAddressLine8 + * @return + */ + public Builder localAddressLine8(String localAddressLine8) { + this.localAddressLine8 = localAddressLine8; + return this; + } + + + /** + * 地址行 9(非拉丁语系的本地文字) + *

示例值:McPRG + * + * @param localAddressLine9 + * @return + */ + public Builder localAddressLine9(String localAddressLine9) { + this.localAddressLine9 = localAddressLine9; + return this; + } + + + /** + * 邮政编码 + *

示例值:611530 + * + * @param postalCode + * @return + */ + public Builder postalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + + /** + * 地址类型 + *

示例值: + * + * @param addressTypeList + * @return + */ + public Builder addressTypeList(Enum[] addressTypeList) { + this.addressTypeList = addressTypeList; + return this; + } + + + /** + * 主要地址 + *

示例值:true + * + * @param isPrimary + * @return + */ + public Builder isPrimary(Boolean isPrimary) { + this.isPrimary = isPrimary; + return this; + } + + + /** + * 公开地址 + *

示例值:true + * + * @param isPublic + * @return + */ + public Builder isPublic(Boolean isPublic) { + this.isPublic = isPublic; + return this; + } + + + /** + * 自定义字段 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(CustomFieldData[] customFields) { + this.customFields = customFields; + return this; + } + + + public Address build() { + return new Address(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ApprovalGroup.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ApprovalGroup.java new file mode 100644 index 000000000..8f5501ec6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ApprovalGroup.java @@ -0,0 +1,468 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class ApprovalGroup { + /** + * 组织架构调整审批组 ID + *

示例值:6991776076699549697 + */ + @SerializedName("approval_group_id") + private String approvalGroupId; + /** + * 组织架构调整流程 ID + *

示例值:6991776076699549697 + */ + @SerializedName("process_id") + private String processId; + /** + * 组织架构调整流程状态 + *

示例值: + */ + @SerializedName("approval_group_status") + private String approvalGroupStatus; + /** + * 调整主题 + *

示例值:测试组织架构调整 + */ + @SerializedName("topic") + private String topic; + /** + * 调整原因 + *

示例值:测试 + */ + @SerializedName("adjust_reason") + private String adjustReason; + /** + * 生效日期 + *

示例值:2022-03-01 + */ + @SerializedName("effective_date") + private String effectiveDate; + /** + * 发起人 + *

示例值:6974641477444060708 + */ + @SerializedName("created_by") + private String createdBy; + /** + * 组织架构调整任务 ID + *

示例值:6991776076699549697 + */ + @SerializedName("draft_id") + private String draftId; + /** + * 组织架构调整任务状态 + *

示例值: + */ + @SerializedName("draft_status") + private String draftStatus; + /** + * 关联的部门调整记录 ID 列表 + *

示例值: + */ + @SerializedName("department_changes") + private String[] departmentChanges; + /** + * 关联的人员调整记录 ID 列表 + *

示例值: + */ + @SerializedName("job_changes") + private String[] jobChanges; + + // builder 开始 + public ApprovalGroup() { + } + + public ApprovalGroup(Builder builder) { + /** + * 组织架构调整审批组 ID + *

示例值:6991776076699549697 + */ + this.approvalGroupId = builder.approvalGroupId; + /** + * 组织架构调整流程 ID + *

示例值:6991776076699549697 + */ + this.processId = builder.processId; + /** + * 组织架构调整流程状态 + *

示例值: + */ + this.approvalGroupStatus = builder.approvalGroupStatus; + /** + * 调整主题 + *

示例值:测试组织架构调整 + */ + this.topic = builder.topic; + /** + * 调整原因 + *

示例值:测试 + */ + this.adjustReason = builder.adjustReason; + /** + * 生效日期 + *

示例值:2022-03-01 + */ + this.effectiveDate = builder.effectiveDate; + /** + * 发起人 + *

示例值:6974641477444060708 + */ + this.createdBy = builder.createdBy; + /** + * 组织架构调整任务 ID + *

示例值:6991776076699549697 + */ + this.draftId = builder.draftId; + /** + * 组织架构调整任务状态 + *

示例值: + */ + this.draftStatus = builder.draftStatus; + /** + * 关联的部门调整记录 ID 列表 + *

示例值: + */ + this.departmentChanges = builder.departmentChanges; + /** + * 关联的人员调整记录 ID 列表 + *

示例值: + */ + this.jobChanges = builder.jobChanges; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getApprovalGroupId() { + return this.approvalGroupId; + } + + public void setApprovalGroupId(String approvalGroupId) { + this.approvalGroupId = approvalGroupId; + } + + public String getProcessId() { + return this.processId; + } + + public void setProcessId(String processId) { + this.processId = processId; + } + + public String getApprovalGroupStatus() { + return this.approvalGroupStatus; + } + + public void setApprovalGroupStatus(String approvalGroupStatus) { + this.approvalGroupStatus = approvalGroupStatus; + } + + public String getTopic() { + return this.topic; + } + + public void setTopic(String topic) { + this.topic = topic; + } + + public String getAdjustReason() { + return this.adjustReason; + } + + public void setAdjustReason(String adjustReason) { + this.adjustReason = adjustReason; + } + + public String getEffectiveDate() { + return this.effectiveDate; + } + + public void setEffectiveDate(String effectiveDate) { + this.effectiveDate = effectiveDate; + } + + public String getCreatedBy() { + return this.createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public String getDraftId() { + return this.draftId; + } + + public void setDraftId(String draftId) { + this.draftId = draftId; + } + + public String getDraftStatus() { + return this.draftStatus; + } + + public void setDraftStatus(String draftStatus) { + this.draftStatus = draftStatus; + } + + public String[] getDepartmentChanges() { + return this.departmentChanges; + } + + public void setDepartmentChanges(String[] departmentChanges) { + this.departmentChanges = departmentChanges; + } + + public String[] getJobChanges() { + return this.jobChanges; + } + + public void setJobChanges(String[] jobChanges) { + this.jobChanges = jobChanges; + } + + public static class Builder { + /** + * 组织架构调整审批组 ID + *

示例值:6991776076699549697 + */ + private String approvalGroupId; + /** + * 组织架构调整流程 ID + *

示例值:6991776076699549697 + */ + private String processId; + /** + * 组织架构调整流程状态 + *

示例值: + */ + private String approvalGroupStatus; + /** + * 调整主题 + *

示例值:测试组织架构调整 + */ + private String topic; + /** + * 调整原因 + *

示例值:测试 + */ + private String adjustReason; + /** + * 生效日期 + *

示例值:2022-03-01 + */ + private String effectiveDate; + /** + * 发起人 + *

示例值:6974641477444060708 + */ + private String createdBy; + /** + * 组织架构调整任务 ID + *

示例值:6991776076699549697 + */ + private String draftId; + /** + * 组织架构调整任务状态 + *

示例值: + */ + private String draftStatus; + /** + * 关联的部门调整记录 ID 列表 + *

示例值: + */ + private String[] departmentChanges; + /** + * 关联的人员调整记录 ID 列表 + *

示例值: + */ + private String[] jobChanges; + + /** + * 组织架构调整审批组 ID + *

示例值:6991776076699549697 + * + * @param approvalGroupId + * @return + */ + public Builder approvalGroupId(String approvalGroupId) { + this.approvalGroupId = approvalGroupId; + return this; + } + + + /** + * 组织架构调整流程 ID + *

示例值:6991776076699549697 + * + * @param processId + * @return + */ + public Builder processId(String processId) { + this.processId = processId; + return this; + } + + + /** + * 组织架构调整流程状态 + *

示例值: + * + * @param approvalGroupStatus + * @return + */ + public Builder approvalGroupStatus(String approvalGroupStatus) { + this.approvalGroupStatus = approvalGroupStatus; + return this; + } + + /** + * 组织架构调整流程状态 + *

示例值: + * + * @param approvalGroupStatus {@link com.lark.oapi.service.corehr.v2.enums.ApprovalGroupApprovalGroupStatusEnum} + * @return + */ + public Builder approvalGroupStatus(com.lark.oapi.service.corehr.v2.enums.ApprovalGroupApprovalGroupStatusEnum approvalGroupStatus) { + this.approvalGroupStatus = approvalGroupStatus.getValue(); + return this; + } + + + /** + * 调整主题 + *

示例值:测试组织架构调整 + * + * @param topic + * @return + */ + public Builder topic(String topic) { + this.topic = topic; + return this; + } + + + /** + * 调整原因 + *

示例值:测试 + * + * @param adjustReason + * @return + */ + public Builder adjustReason(String adjustReason) { + this.adjustReason = adjustReason; + return this; + } + + + /** + * 生效日期 + *

示例值:2022-03-01 + * + * @param effectiveDate + * @return + */ + public Builder effectiveDate(String effectiveDate) { + this.effectiveDate = effectiveDate; + return this; + } + + + /** + * 发起人 + *

示例值:6974641477444060708 + * + * @param createdBy + * @return + */ + public Builder createdBy(String createdBy) { + this.createdBy = createdBy; + return this; + } + + + /** + * 组织架构调整任务 ID + *

示例值:6991776076699549697 + * + * @param draftId + * @return + */ + public Builder draftId(String draftId) { + this.draftId = draftId; + return this; + } + + + /** + * 组织架构调整任务状态 + *

示例值: + * + * @param draftStatus + * @return + */ + public Builder draftStatus(String draftStatus) { + this.draftStatus = draftStatus; + return this; + } + + /** + * 组织架构调整任务状态 + *

示例值: + * + * @param draftStatus {@link com.lark.oapi.service.corehr.v2.enums.ApprovalGroupDraftStatusEnum} + * @return + */ + public Builder draftStatus(com.lark.oapi.service.corehr.v2.enums.ApprovalGroupDraftStatusEnum draftStatus) { + this.draftStatus = draftStatus.getValue(); + return this; + } + + + /** + * 关联的部门调整记录 ID 列表 + *

示例值: + * + * @param departmentChanges + * @return + */ + public Builder departmentChanges(String[] departmentChanges) { + this.departmentChanges = departmentChanges; + return this; + } + + + /** + * 关联的人员调整记录 ID 列表 + *

示例值: + * + * @param jobChanges + * @return + */ + public Builder jobChanges(String[] jobChanges) { + this.jobChanges = jobChanges; + return this; + } + + + public ApprovalGroup build() { + return new ApprovalGroup(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Assessment.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Assessment.java new file mode 100644 index 000000000..f9dc4c569 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Assessment.java @@ -0,0 +1,333 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Assessment { + /** + * 考核结果 ID + *

示例值:6893014061142064135 + */ + @SerializedName("assessment_id") + private String assessmentId; + /** + * 考核状态 + *

示例值: + */ + @SerializedName("assessment_status") + private Enum assessmentStatus; + /** + * 试用期考核结果 + *

示例值: + */ + @SerializedName("assessment_result") + private Enum assessmentResult; + /** + * 考核得分 + *

示例值:99.9 + */ + @SerializedName("assessment_score") + private Double assessmentScore; + /** + * 试用期考核等级 + *

示例值: + */ + @SerializedName("assessment_grade") + private Enum assessmentGrade; + /** + * 考核评语 + *

示例值:超出预期 + */ + @SerializedName("assessment_comment") + private String assessmentComment; + /** + * 考核结果页面超链接 + *

示例值:https://qwe1123433.feishuapp.bytedance.net/ae/ui/apps//122265871113330/recordPages/2/records/17611111112?objectId=17663333322543&recordPageId=171128122312 + */ + @SerializedName("assessment_detail") + private String assessmentDetail; + /** + * 是否为最终考核结果 + *

示例值:false + */ + @SerializedName("is_final_asssessment") + private Boolean isFinalAsssessment; + + // builder 开始 + public Assessment() { + } + + public Assessment(Builder builder) { + /** + * 考核结果 ID + *

示例值:6893014061142064135 + */ + this.assessmentId = builder.assessmentId; + /** + * 考核状态 + *

示例值: + */ + this.assessmentStatus = builder.assessmentStatus; + /** + * 试用期考核结果 + *

示例值: + */ + this.assessmentResult = builder.assessmentResult; + /** + * 考核得分 + *

示例值:99.9 + */ + this.assessmentScore = builder.assessmentScore; + /** + * 试用期考核等级 + *

示例值: + */ + this.assessmentGrade = builder.assessmentGrade; + /** + * 考核评语 + *

示例值:超出预期 + */ + this.assessmentComment = builder.assessmentComment; + /** + * 考核结果页面超链接 + *

示例值:https://qwe1123433.feishuapp.bytedance.net/ae/ui/apps//122265871113330/recordPages/2/records/17611111112?objectId=17663333322543&recordPageId=171128122312 + */ + this.assessmentDetail = builder.assessmentDetail; + /** + * 是否为最终考核结果 + *

示例值:false + */ + this.isFinalAsssessment = builder.isFinalAsssessment; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getAssessmentId() { + return this.assessmentId; + } + + public void setAssessmentId(String assessmentId) { + this.assessmentId = assessmentId; + } + + public Enum getAssessmentStatus() { + return this.assessmentStatus; + } + + public void setAssessmentStatus(Enum assessmentStatus) { + this.assessmentStatus = assessmentStatus; + } + + public Enum getAssessmentResult() { + return this.assessmentResult; + } + + public void setAssessmentResult(Enum assessmentResult) { + this.assessmentResult = assessmentResult; + } + + public Double getAssessmentScore() { + return this.assessmentScore; + } + + public void setAssessmentScore(Double assessmentScore) { + this.assessmentScore = assessmentScore; + } + + public Enum getAssessmentGrade() { + return this.assessmentGrade; + } + + public void setAssessmentGrade(Enum assessmentGrade) { + this.assessmentGrade = assessmentGrade; + } + + public String getAssessmentComment() { + return this.assessmentComment; + } + + public void setAssessmentComment(String assessmentComment) { + this.assessmentComment = assessmentComment; + } + + public String getAssessmentDetail() { + return this.assessmentDetail; + } + + public void setAssessmentDetail(String assessmentDetail) { + this.assessmentDetail = assessmentDetail; + } + + public Boolean getIsFinalAsssessment() { + return this.isFinalAsssessment; + } + + public void setIsFinalAsssessment(Boolean isFinalAsssessment) { + this.isFinalAsssessment = isFinalAsssessment; + } + + public static class Builder { + /** + * 考核结果 ID + *

示例值:6893014061142064135 + */ + private String assessmentId; + /** + * 考核状态 + *

示例值: + */ + private Enum assessmentStatus; + /** + * 试用期考核结果 + *

示例值: + */ + private Enum assessmentResult; + /** + * 考核得分 + *

示例值:99.9 + */ + private Double assessmentScore; + /** + * 试用期考核等级 + *

示例值: + */ + private Enum assessmentGrade; + /** + * 考核评语 + *

示例值:超出预期 + */ + private String assessmentComment; + /** + * 考核结果页面超链接 + *

示例值:https://qwe1123433.feishuapp.bytedance.net/ae/ui/apps//122265871113330/recordPages/2/records/17611111112?objectId=17663333322543&recordPageId=171128122312 + */ + private String assessmentDetail; + /** + * 是否为最终考核结果 + *

示例值:false + */ + private Boolean isFinalAsssessment; + + /** + * 考核结果 ID + *

示例值:6893014061142064135 + * + * @param assessmentId + * @return + */ + public Builder assessmentId(String assessmentId) { + this.assessmentId = assessmentId; + return this; + } + + + /** + * 考核状态 + *

示例值: + * + * @param assessmentStatus + * @return + */ + public Builder assessmentStatus(Enum assessmentStatus) { + this.assessmentStatus = assessmentStatus; + return this; + } + + + /** + * 试用期考核结果 + *

示例值: + * + * @param assessmentResult + * @return + */ + public Builder assessmentResult(Enum assessmentResult) { + this.assessmentResult = assessmentResult; + return this; + } + + + /** + * 考核得分 + *

示例值:99.9 + * + * @param assessmentScore + * @return + */ + public Builder assessmentScore(Double assessmentScore) { + this.assessmentScore = assessmentScore; + return this; + } + + + /** + * 试用期考核等级 + *

示例值: + * + * @param assessmentGrade + * @return + */ + public Builder assessmentGrade(Enum assessmentGrade) { + this.assessmentGrade = assessmentGrade; + return this; + } + + + /** + * 考核评语 + *

示例值:超出预期 + * + * @param assessmentComment + * @return + */ + public Builder assessmentComment(String assessmentComment) { + this.assessmentComment = assessmentComment; + return this; + } + + + /** + * 考核结果页面超链接 + *

示例值:https://qwe1123433.feishuapp.bytedance.net/ae/ui/apps//122265871113330/recordPages/2/records/17611111112?objectId=17663333322543&recordPageId=171128122312 + * + * @param assessmentDetail + * @return + */ + public Builder assessmentDetail(String assessmentDetail) { + this.assessmentDetail = assessmentDetail; + return this; + } + + + /** + * 是否为最终考核结果 + *

示例值:false + * + * @param isFinalAsssessment + * @return + */ + public Builder isFinalAsssessment(Boolean isFinalAsssessment) { + this.isFinalAsssessment = isFinalAsssessment; + return this; + } + + + public Assessment build() { + return new Assessment(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/AssessmentForCreate.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/AssessmentForCreate.java new file mode 100644 index 000000000..1c34f1212 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/AssessmentForCreate.java @@ -0,0 +1,320 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class AssessmentForCreate { + /** + * 考核状态 + *

示例值:completed + */ + @SerializedName("assessment_status") + private String assessmentStatus; + /** + * 试用期考核结果 + *

示例值:approved + */ + @SerializedName("assessment_result") + private String assessmentResult; + /** + * 考核得分 + *

示例值:99.9 + */ + @SerializedName("assessment_score") + private Double assessmentScore; + /** + * 试用期考核等级 + *

示例值:grade_a + */ + @SerializedName("assessment_grade") + private String assessmentGrade; + /** + * 考核评语 + *

示例值:超出预期 + */ + @SerializedName("assessment_comment") + private String assessmentComment; + /** + * 考核结果页面超链接 + *

示例值:暂无示例 + */ + @SerializedName("assessment_detail") + private String assessmentDetail; + /** + * 是否为最终考核结果 + *

示例值:false + */ + @SerializedName("is_final_asssessment") + private Boolean isFinalAsssessment; + + // builder 开始 + public AssessmentForCreate() { + } + + public AssessmentForCreate(Builder builder) { + /** + * 考核状态 + *

示例值:completed + */ + this.assessmentStatus = builder.assessmentStatus; + /** + * 试用期考核结果 + *

示例值:approved + */ + this.assessmentResult = builder.assessmentResult; + /** + * 考核得分 + *

示例值:99.9 + */ + this.assessmentScore = builder.assessmentScore; + /** + * 试用期考核等级 + *

示例值:grade_a + */ + this.assessmentGrade = builder.assessmentGrade; + /** + * 考核评语 + *

示例值:超出预期 + */ + this.assessmentComment = builder.assessmentComment; + /** + * 考核结果页面超链接 + *

示例值:暂无示例 + */ + this.assessmentDetail = builder.assessmentDetail; + /** + * 是否为最终考核结果 + *

示例值:false + */ + this.isFinalAsssessment = builder.isFinalAsssessment; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getAssessmentStatus() { + return this.assessmentStatus; + } + + public void setAssessmentStatus(String assessmentStatus) { + this.assessmentStatus = assessmentStatus; + } + + public String getAssessmentResult() { + return this.assessmentResult; + } + + public void setAssessmentResult(String assessmentResult) { + this.assessmentResult = assessmentResult; + } + + public Double getAssessmentScore() { + return this.assessmentScore; + } + + public void setAssessmentScore(Double assessmentScore) { + this.assessmentScore = assessmentScore; + } + + public String getAssessmentGrade() { + return this.assessmentGrade; + } + + public void setAssessmentGrade(String assessmentGrade) { + this.assessmentGrade = assessmentGrade; + } + + public String getAssessmentComment() { + return this.assessmentComment; + } + + public void setAssessmentComment(String assessmentComment) { + this.assessmentComment = assessmentComment; + } + + public String getAssessmentDetail() { + return this.assessmentDetail; + } + + public void setAssessmentDetail(String assessmentDetail) { + this.assessmentDetail = assessmentDetail; + } + + public Boolean getIsFinalAsssessment() { + return this.isFinalAsssessment; + } + + public void setIsFinalAsssessment(Boolean isFinalAsssessment) { + this.isFinalAsssessment = isFinalAsssessment; + } + + public static class Builder { + /** + * 考核状态 + *

示例值:completed + */ + private String assessmentStatus; + /** + * 试用期考核结果 + *

示例值:approved + */ + private String assessmentResult; + /** + * 考核得分 + *

示例值:99.9 + */ + private Double assessmentScore; + /** + * 试用期考核等级 + *

示例值:grade_a + */ + private String assessmentGrade; + /** + * 考核评语 + *

示例值:超出预期 + */ + private String assessmentComment; + /** + * 考核结果页面超链接 + *

示例值:暂无示例 + */ + private String assessmentDetail; + /** + * 是否为最终考核结果 + *

示例值:false + */ + private Boolean isFinalAsssessment; + + /** + * 考核状态 + *

示例值:completed + * + * @param assessmentStatus + * @return + */ + public Builder assessmentStatus(String assessmentStatus) { + this.assessmentStatus = assessmentStatus; + return this; + } + + /** + * 考核状态 + *

示例值:completed + * + * @param assessmentStatus {@link com.lark.oapi.service.corehr.v2.enums.AssessmentForCreateAssessmentStatusEnum} + * @return + */ + public Builder assessmentStatus(com.lark.oapi.service.corehr.v2.enums.AssessmentForCreateAssessmentStatusEnum assessmentStatus) { + this.assessmentStatus = assessmentStatus.getValue(); + return this; + } + + + /** + * 试用期考核结果 + *

示例值:approved + * + * @param assessmentResult + * @return + */ + public Builder assessmentResult(String assessmentResult) { + this.assessmentResult = assessmentResult; + return this; + } + + /** + * 试用期考核结果 + *

示例值:approved + * + * @param assessmentResult {@link com.lark.oapi.service.corehr.v2.enums.AssessmentForCreateAssessmentResultEnum} + * @return + */ + public Builder assessmentResult(com.lark.oapi.service.corehr.v2.enums.AssessmentForCreateAssessmentResultEnum assessmentResult) { + this.assessmentResult = assessmentResult.getValue(); + return this; + } + + + /** + * 考核得分 + *

示例值:99.9 + * + * @param assessmentScore + * @return + */ + public Builder assessmentScore(Double assessmentScore) { + this.assessmentScore = assessmentScore; + return this; + } + + + /** + * 试用期考核等级 + *

示例值:grade_a + * + * @param assessmentGrade + * @return + */ + public Builder assessmentGrade(String assessmentGrade) { + this.assessmentGrade = assessmentGrade; + return this; + } + + + /** + * 考核评语 + *

示例值:超出预期 + * + * @param assessmentComment + * @return + */ + public Builder assessmentComment(String assessmentComment) { + this.assessmentComment = assessmentComment; + return this; + } + + + /** + * 考核结果页面超链接 + *

示例值:暂无示例 + * + * @param assessmentDetail + * @return + */ + public Builder assessmentDetail(String assessmentDetail) { + this.assessmentDetail = assessmentDetail; + return this; + } + + + /** + * 是否为最终考核结果 + *

示例值:false + * + * @param isFinalAsssessment + * @return + */ + public Builder isFinalAsssessment(Boolean isFinalAsssessment) { + this.isFinalAsssessment = isFinalAsssessment; + return this; + } + + + public AssessmentForCreate build() { + return new AssessmentForCreate(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Bank.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Bank.java new file mode 100644 index 000000000..af5321cc2 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Bank.java @@ -0,0 +1,234 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Bank { + /** + * 银行 ID + *

示例值:6893014062142064135 + */ + @SerializedName("bank_id") + private String bankId; + /** + * 银行名称 + *

示例值: + */ + @SerializedName("bank_name") + private I18n[] bankName; + /** + * 总行代码 + *

示例值:BKCH + */ + @SerializedName("bank_code") + private String bankCode; + /** + * 国家 / 地区 ID ,可通过【查询单条国家/地区信息】 接口查询 + *

示例值:6893014062142064133 + */ + @SerializedName("country_region_id") + private String countryRegionId; + /** + * 状态 + *

示例值:1 + */ + @SerializedName("status") + private Integer status; + + // builder 开始 + public Bank() { + } + + public Bank(Builder builder) { + /** + * 银行 ID + *

示例值:6893014062142064135 + */ + this.bankId = builder.bankId; + /** + * 银行名称 + *

示例值: + */ + this.bankName = builder.bankName; + /** + * 总行代码 + *

示例值:BKCH + */ + this.bankCode = builder.bankCode; + /** + * 国家 / 地区 ID ,可通过【查询单条国家/地区信息】 接口查询 + *

示例值:6893014062142064133 + */ + this.countryRegionId = builder.countryRegionId; + /** + * 状态 + *

示例值:1 + */ + this.status = builder.status; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getBankId() { + return this.bankId; + } + + public void setBankId(String bankId) { + this.bankId = bankId; + } + + public I18n[] getBankName() { + return this.bankName; + } + + public void setBankName(I18n[] bankName) { + this.bankName = bankName; + } + + public String getBankCode() { + return this.bankCode; + } + + public void setBankCode(String bankCode) { + this.bankCode = bankCode; + } + + public String getCountryRegionId() { + return this.countryRegionId; + } + + public void setCountryRegionId(String countryRegionId) { + this.countryRegionId = countryRegionId; + } + + public Integer getStatus() { + return this.status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public static class Builder { + /** + * 银行 ID + *

示例值:6893014062142064135 + */ + private String bankId; + /** + * 银行名称 + *

示例值: + */ + private I18n[] bankName; + /** + * 总行代码 + *

示例值:BKCH + */ + private String bankCode; + /** + * 国家 / 地区 ID ,可通过【查询单条国家/地区信息】 接口查询 + *

示例值:6893014062142064133 + */ + private String countryRegionId; + /** + * 状态 + *

示例值:1 + */ + private Integer status; + + /** + * 银行 ID + *

示例值:6893014062142064135 + * + * @param bankId + * @return + */ + public Builder bankId(String bankId) { + this.bankId = bankId; + return this; + } + + + /** + * 银行名称 + *

示例值: + * + * @param bankName + * @return + */ + public Builder bankName(I18n[] bankName) { + this.bankName = bankName; + return this; + } + + + /** + * 总行代码 + *

示例值:BKCH + * + * @param bankCode + * @return + */ + public Builder bankCode(String bankCode) { + this.bankCode = bankCode; + return this; + } + + + /** + * 国家 / 地区 ID ,可通过【查询单条国家/地区信息】 接口查询 + *

示例值:6893014062142064133 + * + * @param countryRegionId + * @return + */ + public Builder countryRegionId(String countryRegionId) { + this.countryRegionId = countryRegionId; + return this; + } + + + /** + * 状态 + *

示例值:1 + * + * @param status + * @return + */ + public Builder status(Integer status) { + this.status = status; + return this; + } + + /** + * 状态 + *

示例值:1 + * + * @param status {@link com.lark.oapi.service.corehr.v2.enums.BankBasicDataObjStatusEnum} + * @return + */ + public Builder status(com.lark.oapi.service.corehr.v2.enums.BankBasicDataObjStatusEnum status) { + this.status = status.getValue(); + return this; + } + + + public Bank build() { + return new Bank(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BankAccount.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BankAccount.java new file mode 100644 index 000000000..0145607a6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BankAccount.java @@ -0,0 +1,407 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class BankAccount { + /** + * 银行名称 + *

示例值:中国农业银行 + */ + @SerializedName("bank_name") + private String bankName; + /** + * 银行账号 + *

示例值:6231200000001223 + */ + @SerializedName("bank_account_number") + private String bankAccountNumber; + /** + * 开户人姓名 + *

示例值:孟十五 + */ + @SerializedName("account_holder") + private String accountHolder; + /** + * 支行名称 + *

示例值:中国农业银行支行 + */ + @SerializedName("branch_name") + private String branchName; + /** + * 国家/地区 ID,详细信息可通过【查询国家/地区信息】接口查询获得 + *

示例值:12 + */ + @SerializedName("country_region_id") + private String countryRegionId; + /** + * 银行卡用途,枚举值可通过文档【飞书人事枚举常量】银行卡用途(Bank Account Usage)枚举定义部分获得 + *

示例值: + */ + @SerializedName("bank_account_usage") + private Enum[] bankAccountUsage; + /** + * 银行卡类型,枚举值可通过文档【飞书人事枚举常量】银行卡类型(Bank Account Type)枚举定义部分获得 + *

示例值: + */ + @SerializedName("bank_account_type") + private Enum bankAccountType; + /** + * 货币id + *

示例值:12QueryCountryRegionSubdivisionDataReq + */ + @SerializedName("currency_id") + private String currencyId; + /** + * 国际银行账号 + *

示例值:CH56 0483 5012 3456 7800 9 + */ + @SerializedName("IBAN") + private String iBAN; + /** + * 自定义字段 + *

示例值: + */ + @SerializedName("custom_fields") + private CustomFieldData[] customFields; + + // builder 开始 + public BankAccount() { + } + + public BankAccount(Builder builder) { + /** + * 银行名称 + *

示例值:中国农业银行 + */ + this.bankName = builder.bankName; + /** + * 银行账号 + *

示例值:6231200000001223 + */ + this.bankAccountNumber = builder.bankAccountNumber; + /** + * 开户人姓名 + *

示例值:孟十五 + */ + this.accountHolder = builder.accountHolder; + /** + * 支行名称 + *

示例值:中国农业银行支行 + */ + this.branchName = builder.branchName; + /** + * 国家/地区 ID,详细信息可通过【查询国家/地区信息】接口查询获得 + *

示例值:12 + */ + this.countryRegionId = builder.countryRegionId; + /** + * 银行卡用途,枚举值可通过文档【飞书人事枚举常量】银行卡用途(Bank Account Usage)枚举定义部分获得 + *

示例值: + */ + this.bankAccountUsage = builder.bankAccountUsage; + /** + * 银行卡类型,枚举值可通过文档【飞书人事枚举常量】银行卡类型(Bank Account Type)枚举定义部分获得 + *

示例值: + */ + this.bankAccountType = builder.bankAccountType; + /** + * 货币id + *

示例值:12QueryCountryRegionSubdivisionDataReq + */ + this.currencyId = builder.currencyId; + /** + * 国际银行账号 + *

示例值:CH56 0483 5012 3456 7800 9 + */ + this.iBAN = builder.iBAN; + /** + * 自定义字段 + *

示例值: + */ + this.customFields = builder.customFields; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getBankName() { + return this.bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getBankAccountNumber() { + return this.bankAccountNumber; + } + + public void setBankAccountNumber(String bankAccountNumber) { + this.bankAccountNumber = bankAccountNumber; + } + + public String getAccountHolder() { + return this.accountHolder; + } + + public void setAccountHolder(String accountHolder) { + this.accountHolder = accountHolder; + } + + public String getBranchName() { + return this.branchName; + } + + public void setBranchName(String branchName) { + this.branchName = branchName; + } + + public String getCountryRegionId() { + return this.countryRegionId; + } + + public void setCountryRegionId(String countryRegionId) { + this.countryRegionId = countryRegionId; + } + + public Enum[] getBankAccountUsage() { + return this.bankAccountUsage; + } + + public void setBankAccountUsage(Enum[] bankAccountUsage) { + this.bankAccountUsage = bankAccountUsage; + } + + public Enum getBankAccountType() { + return this.bankAccountType; + } + + public void setBankAccountType(Enum bankAccountType) { + this.bankAccountType = bankAccountType; + } + + public String getCurrencyId() { + return this.currencyId; + } + + public void setCurrencyId(String currencyId) { + this.currencyId = currencyId; + } + + public String getIBAN() { + return this.iBAN; + } + + public void setIBAN(String iBAN) { + this.iBAN = iBAN; + } + + public CustomFieldData[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(CustomFieldData[] customFields) { + this.customFields = customFields; + } + + public static class Builder { + /** + * 银行名称 + *

示例值:中国农业银行 + */ + private String bankName; + /** + * 银行账号 + *

示例值:6231200000001223 + */ + private String bankAccountNumber; + /** + * 开户人姓名 + *

示例值:孟十五 + */ + private String accountHolder; + /** + * 支行名称 + *

示例值:中国农业银行支行 + */ + private String branchName; + /** + * 国家/地区 ID,详细信息可通过【查询国家/地区信息】接口查询获得 + *

示例值:12 + */ + private String countryRegionId; + /** + * 银行卡用途,枚举值可通过文档【飞书人事枚举常量】银行卡用途(Bank Account Usage)枚举定义部分获得 + *

示例值: + */ + private Enum[] bankAccountUsage; + /** + * 银行卡类型,枚举值可通过文档【飞书人事枚举常量】银行卡类型(Bank Account Type)枚举定义部分获得 + *

示例值: + */ + private Enum bankAccountType; + /** + * 货币id + *

示例值:12QueryCountryRegionSubdivisionDataReq + */ + private String currencyId; + /** + * 国际银行账号 + *

示例值:CH56 0483 5012 3456 7800 9 + */ + private String iBAN; + /** + * 自定义字段 + *

示例值: + */ + private CustomFieldData[] customFields; + + /** + * 银行名称 + *

示例值:中国农业银行 + * + * @param bankName + * @return + */ + public Builder bankName(String bankName) { + this.bankName = bankName; + return this; + } + + + /** + * 银行账号 + *

示例值:6231200000001223 + * + * @param bankAccountNumber + * @return + */ + public Builder bankAccountNumber(String bankAccountNumber) { + this.bankAccountNumber = bankAccountNumber; + return this; + } + + + /** + * 开户人姓名 + *

示例值:孟十五 + * + * @param accountHolder + * @return + */ + public Builder accountHolder(String accountHolder) { + this.accountHolder = accountHolder; + return this; + } + + + /** + * 支行名称 + *

示例值:中国农业银行支行 + * + * @param branchName + * @return + */ + public Builder branchName(String branchName) { + this.branchName = branchName; + return this; + } + + + /** + * 国家/地区 ID,详细信息可通过【查询国家/地区信息】接口查询获得 + *

示例值:12 + * + * @param countryRegionId + * @return + */ + public Builder countryRegionId(String countryRegionId) { + this.countryRegionId = countryRegionId; + return this; + } + + + /** + * 银行卡用途,枚举值可通过文档【飞书人事枚举常量】银行卡用途(Bank Account Usage)枚举定义部分获得 + *

示例值: + * + * @param bankAccountUsage + * @return + */ + public Builder bankAccountUsage(Enum[] bankAccountUsage) { + this.bankAccountUsage = bankAccountUsage; + return this; + } + + + /** + * 银行卡类型,枚举值可通过文档【飞书人事枚举常量】银行卡类型(Bank Account Type)枚举定义部分获得 + *

示例值: + * + * @param bankAccountType + * @return + */ + public Builder bankAccountType(Enum bankAccountType) { + this.bankAccountType = bankAccountType; + return this; + } + + + /** + * 货币id + *

示例值:12QueryCountryRegionSubdivisionDataReq + * + * @param currencyId + * @return + */ + public Builder currencyId(String currencyId) { + this.currencyId = currencyId; + return this; + } + + + /** + * 国际银行账号 + *

示例值:CH56 0483 5012 3456 7800 9 + * + * @param iBAN + * @return + */ + public Builder iBAN(String iBAN) { + this.iBAN = iBAN; + return this; + } + + + /** + * 自定义字段 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(CustomFieldData[] customFields) { + this.customFields = customFields; + return this; + } + + + public BankAccount build() { + return new BankAccount(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BankBranch.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BankBranch.java new file mode 100644 index 000000000..e3875b1a7 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BankBranch.java @@ -0,0 +1,271 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class BankBranch { + /** + * 支行 ID + *

示例值:6893014062142064111 + */ + @SerializedName("bank_branch_id") + private String bankBranchId; + /** + * 支行名称 + *

示例值: + */ + @SerializedName("bank_branch_name") + private I18n[] bankBranchName; + /** + * 所属银行 ID,可通过【查询银行信息】接口查询 + *

示例值:6893011062142064111 + */ + @SerializedName("bank_id") + private String bankId; + /** + * 金融分支机构编码 + *

示例值:201 + */ + @SerializedName("code") + private String code; + /** + * 银行代码 + *

示例值:PBOCCNBJ + */ + @SerializedName("swift_code") + private String swiftCode; + /** + * 状态 + *

示例值:1 + */ + @SerializedName("status") + private Integer status; + + // builder 开始 + public BankBranch() { + } + + public BankBranch(Builder builder) { + /** + * 支行 ID + *

示例值:6893014062142064111 + */ + this.bankBranchId = builder.bankBranchId; + /** + * 支行名称 + *

示例值: + */ + this.bankBranchName = builder.bankBranchName; + /** + * 所属银行 ID,可通过【查询银行信息】接口查询 + *

示例值:6893011062142064111 + */ + this.bankId = builder.bankId; + /** + * 金融分支机构编码 + *

示例值:201 + */ + this.code = builder.code; + /** + * 银行代码 + *

示例值:PBOCCNBJ + */ + this.swiftCode = builder.swiftCode; + /** + * 状态 + *

示例值:1 + */ + this.status = builder.status; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getBankBranchId() { + return this.bankBranchId; + } + + public void setBankBranchId(String bankBranchId) { + this.bankBranchId = bankBranchId; + } + + public I18n[] getBankBranchName() { + return this.bankBranchName; + } + + public void setBankBranchName(I18n[] bankBranchName) { + this.bankBranchName = bankBranchName; + } + + public String getBankId() { + return this.bankId; + } + + public void setBankId(String bankId) { + this.bankId = bankId; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getSwiftCode() { + return this.swiftCode; + } + + public void setSwiftCode(String swiftCode) { + this.swiftCode = swiftCode; + } + + public Integer getStatus() { + return this.status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public static class Builder { + /** + * 支行 ID + *

示例值:6893014062142064111 + */ + private String bankBranchId; + /** + * 支行名称 + *

示例值: + */ + private I18n[] bankBranchName; + /** + * 所属银行 ID,可通过【查询银行信息】接口查询 + *

示例值:6893011062142064111 + */ + private String bankId; + /** + * 金融分支机构编码 + *

示例值:201 + */ + private String code; + /** + * 银行代码 + *

示例值:PBOCCNBJ + */ + private String swiftCode; + /** + * 状态 + *

示例值:1 + */ + private Integer status; + + /** + * 支行 ID + *

示例值:6893014062142064111 + * + * @param bankBranchId + * @return + */ + public Builder bankBranchId(String bankBranchId) { + this.bankBranchId = bankBranchId; + return this; + } + + + /** + * 支行名称 + *

示例值: + * + * @param bankBranchName + * @return + */ + public Builder bankBranchName(I18n[] bankBranchName) { + this.bankBranchName = bankBranchName; + return this; + } + + + /** + * 所属银行 ID,可通过【查询银行信息】接口查询 + *

示例值:6893011062142064111 + * + * @param bankId + * @return + */ + public Builder bankId(String bankId) { + this.bankId = bankId; + return this; + } + + + /** + * 金融分支机构编码 + *

示例值:201 + * + * @param code + * @return + */ + public Builder code(String code) { + this.code = code; + return this; + } + + + /** + * 银行代码 + *

示例值:PBOCCNBJ + * + * @param swiftCode + * @return + */ + public Builder swiftCode(String swiftCode) { + this.swiftCode = swiftCode; + return this; + } + + + /** + * 状态 + *

示例值:1 + * + * @param status + * @return + */ + public Builder status(Integer status) { + this.status = status; + return this; + } + + /** + * 状态 + *

示例值:1 + * + * @param status {@link com.lark.oapi.service.corehr.v2.enums.BankBranchBasicDataObjStatusEnum} + * @return + */ + public Builder status(com.lark.oapi.service.corehr.v2.enums.BankBranchBasicDataObjStatusEnum status) { + this.status = status.getValue(); + return this; + } + + + public BankBranch build() { + return new BankBranch(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BasicDepartment.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BasicDepartment.java new file mode 100644 index 000000000..5dc8ef3f0 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BasicDepartment.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class BasicDepartment { + /** + * 部门 ID + *

示例值:4719456877659520852 + */ + @SerializedName("id") + private String id; + /** + * 部门名称 + *

示例值: + */ + @SerializedName("department_name") + private I18n[] departmentName; + + // builder 开始 + public BasicDepartment() { + } + + public BasicDepartment(Builder builder) { + /** + * 部门 ID + *

示例值:4719456877659520852 + */ + this.id = builder.id; + /** + * 部门名称 + *

示例值: + */ + this.departmentName = builder.departmentName; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public I18n[] getDepartmentName() { + return this.departmentName; + } + + public void setDepartmentName(I18n[] departmentName) { + this.departmentName = departmentName; + } + + public static class Builder { + /** + * 部门 ID + *

示例值:4719456877659520852 + */ + private String id; + /** + * 部门名称 + *

示例值: + */ + private I18n[] departmentName; + + /** + * 部门 ID + *

示例值:4719456877659520852 + * + * @param id + * @return + */ + public Builder id(String id) { + this.id = id; + return this; + } + + + /** + * 部门名称 + *

示例值: + * + * @param departmentName + * @return + */ + public Builder departmentName(I18n[] departmentName) { + this.departmentName = departmentName; + return this; + } + + + public BasicDepartment build() { + return new BasicDepartment(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BasicEmployee.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BasicEmployee.java new file mode 100644 index 000000000..e8eb7d88a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BasicEmployee.java @@ -0,0 +1,185 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class BasicEmployee { + /** + * 雇佣 ID + *

示例值:6893014062142064135 + */ + @SerializedName("employment_id") + private String employmentId; + /** + * 工号 + *

示例值:1000000 + */ + @SerializedName("employee_number") + private String employeeNumber; + /** + * 邮箱地址 + *

示例值:test@163.com + */ + @SerializedName("email_address") + private String emailAddress; + /** + * 基本个人信息 + *

示例值: + */ + @SerializedName("person_info") + private BasicPersonInfo personInfo; + + // builder 开始 + public BasicEmployee() { + } + + public BasicEmployee(Builder builder) { + /** + * 雇佣 ID + *

示例值:6893014062142064135 + */ + this.employmentId = builder.employmentId; + /** + * 工号 + *

示例值:1000000 + */ + this.employeeNumber = builder.employeeNumber; + /** + * 邮箱地址 + *

示例值:test@163.com + */ + this.emailAddress = builder.emailAddress; + /** + * 基本个人信息 + *

示例值: + */ + this.personInfo = builder.personInfo; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getEmploymentId() { + return this.employmentId; + } + + public void setEmploymentId(String employmentId) { + this.employmentId = employmentId; + } + + public String getEmployeeNumber() { + return this.employeeNumber; + } + + public void setEmployeeNumber(String employeeNumber) { + this.employeeNumber = employeeNumber; + } + + public String getEmailAddress() { + return this.emailAddress; + } + + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + + public BasicPersonInfo getPersonInfo() { + return this.personInfo; + } + + public void setPersonInfo(BasicPersonInfo personInfo) { + this.personInfo = personInfo; + } + + public static class Builder { + /** + * 雇佣 ID + *

示例值:6893014062142064135 + */ + private String employmentId; + /** + * 工号 + *

示例值:1000000 + */ + private String employeeNumber; + /** + * 邮箱地址 + *

示例值:test@163.com + */ + private String emailAddress; + /** + * 基本个人信息 + *

示例值: + */ + private BasicPersonInfo personInfo; + + /** + * 雇佣 ID + *

示例值:6893014062142064135 + * + * @param employmentId + * @return + */ + public Builder employmentId(String employmentId) { + this.employmentId = employmentId; + return this; + } + + + /** + * 工号 + *

示例值:1000000 + * + * @param employeeNumber + * @return + */ + public Builder employeeNumber(String employeeNumber) { + this.employeeNumber = employeeNumber; + return this; + } + + + /** + * 邮箱地址 + *

示例值:test@163.com + * + * @param emailAddress + * @return + */ + public Builder emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + + /** + * 基本个人信息 + *

示例值: + * + * @param personInfo + * @return + */ + public Builder personInfo(BasicPersonInfo personInfo) { + this.personInfo = personInfo; + return this; + } + + + public BasicEmployee build() { + return new BasicEmployee(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BasicInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BasicInfo.java new file mode 100644 index 000000000..efd3fda10 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BasicInfo.java @@ -0,0 +1,444 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class BasicInfo { + /** + * 描述 + *

示例值: + */ + @SerializedName("name") + private Name name; + /** + * 手机号 + *

示例值:31123127 + */ + @SerializedName("phone_number") + private String phoneNumber; + /** + * 区号 + *

示例值:86_china + */ + @SerializedName("international_area_code") + private String internationalAreaCode; + /** + * 个人邮箱 + *

示例值:xx@xx.com + */ + @SerializedName("email") + private String email; + /** + * 生日 + *

示例值:2011-99-99 + */ + @SerializedName("date_of_birth") + private String dateOfBirth; + /** + * 证件号 + *

示例值:31123127 + */ + @SerializedName("personal_id_number") + private String personalIdNumber; + /** + * 参加工作日期 + *

示例值:2100-09-09 + */ + @SerializedName("date_entered_workforce") + private String dateEnteredWorkforce; + /** + * 性别 + *

示例值:male + */ + @SerializedName("gender_id") + private String genderId; + /** + * 国籍 + *

示例值:6862995757234914824 + */ + @SerializedName("nationality_id") + private String nationalityId; + /** + * 家庭地址 + *

示例值:home addr + */ + @SerializedName("home_address") + private String homeAddress; + /** + * 人员编号 + *

示例值:6862995757234914824 + */ + @SerializedName("worker_id") + private String workerId; + + // builder 开始 + public BasicInfo() { + } + + public BasicInfo(Builder builder) { + /** + * 描述 + *

示例值: + */ + this.name = builder.name; + /** + * 手机号 + *

示例值:31123127 + */ + this.phoneNumber = builder.phoneNumber; + /** + * 区号 + *

示例值:86_china + */ + this.internationalAreaCode = builder.internationalAreaCode; + /** + * 个人邮箱 + *

示例值:xx@xx.com + */ + this.email = builder.email; + /** + * 生日 + *

示例值:2011-99-99 + */ + this.dateOfBirth = builder.dateOfBirth; + /** + * 证件号 + *

示例值:31123127 + */ + this.personalIdNumber = builder.personalIdNumber; + /** + * 参加工作日期 + *

示例值:2100-09-09 + */ + this.dateEnteredWorkforce = builder.dateEnteredWorkforce; + /** + * 性别 + *

示例值:male + */ + this.genderId = builder.genderId; + /** + * 国籍 + *

示例值:6862995757234914824 + */ + this.nationalityId = builder.nationalityId; + /** + * 家庭地址 + *

示例值:home addr + */ + this.homeAddress = builder.homeAddress; + /** + * 人员编号 + *

示例值:6862995757234914824 + */ + this.workerId = builder.workerId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Name getName() { + return this.name; + } + + public void setName(Name name) { + this.name = name; + } + + public String getPhoneNumber() { + return this.phoneNumber; + } + + public void setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + public String getInternationalAreaCode() { + return this.internationalAreaCode; + } + + public void setInternationalAreaCode(String internationalAreaCode) { + this.internationalAreaCode = internationalAreaCode; + } + + public String getEmail() { + return this.email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getDateOfBirth() { + return this.dateOfBirth; + } + + public void setDateOfBirth(String dateOfBirth) { + this.dateOfBirth = dateOfBirth; + } + + public String getPersonalIdNumber() { + return this.personalIdNumber; + } + + public void setPersonalIdNumber(String personalIdNumber) { + this.personalIdNumber = personalIdNumber; + } + + public String getDateEnteredWorkforce() { + return this.dateEnteredWorkforce; + } + + public void setDateEnteredWorkforce(String dateEnteredWorkforce) { + this.dateEnteredWorkforce = dateEnteredWorkforce; + } + + public String getGenderId() { + return this.genderId; + } + + public void setGenderId(String genderId) { + this.genderId = genderId; + } + + public String getNationalityId() { + return this.nationalityId; + } + + public void setNationalityId(String nationalityId) { + this.nationalityId = nationalityId; + } + + public String getHomeAddress() { + return this.homeAddress; + } + + public void setHomeAddress(String homeAddress) { + this.homeAddress = homeAddress; + } + + public String getWorkerId() { + return this.workerId; + } + + public void setWorkerId(String workerId) { + this.workerId = workerId; + } + + public static class Builder { + /** + * 描述 + *

示例值: + */ + private Name name; + /** + * 手机号 + *

示例值:31123127 + */ + private String phoneNumber; + /** + * 区号 + *

示例值:86_china + */ + private String internationalAreaCode; + /** + * 个人邮箱 + *

示例值:xx@xx.com + */ + private String email; + /** + * 生日 + *

示例值:2011-99-99 + */ + private String dateOfBirth; + /** + * 证件号 + *

示例值:31123127 + */ + private String personalIdNumber; + /** + * 参加工作日期 + *

示例值:2100-09-09 + */ + private String dateEnteredWorkforce; + /** + * 性别 + *

示例值:male + */ + private String genderId; + /** + * 国籍 + *

示例值:6862995757234914824 + */ + private String nationalityId; + /** + * 家庭地址 + *

示例值:home addr + */ + private String homeAddress; + /** + * 人员编号 + *

示例值:6862995757234914824 + */ + private String workerId; + + /** + * 描述 + *

示例值: + * + * @param name + * @return + */ + public Builder name(Name name) { + this.name = name; + return this; + } + + + /** + * 手机号 + *

示例值:31123127 + * + * @param phoneNumber + * @return + */ + public Builder phoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + + /** + * 区号 + *

示例值:86_china + * + * @param internationalAreaCode + * @return + */ + public Builder internationalAreaCode(String internationalAreaCode) { + this.internationalAreaCode = internationalAreaCode; + return this; + } + + + /** + * 个人邮箱 + *

示例值:xx@xx.com + * + * @param email + * @return + */ + public Builder email(String email) { + this.email = email; + return this; + } + + + /** + * 生日 + *

示例值:2011-99-99 + * + * @param dateOfBirth + * @return + */ + public Builder dateOfBirth(String dateOfBirth) { + this.dateOfBirth = dateOfBirth; + return this; + } + + + /** + * 证件号 + *

示例值:31123127 + * + * @param personalIdNumber + * @return + */ + public Builder personalIdNumber(String personalIdNumber) { + this.personalIdNumber = personalIdNumber; + return this; + } + + + /** + * 参加工作日期 + *

示例值:2100-09-09 + * + * @param dateEnteredWorkforce + * @return + */ + public Builder dateEnteredWorkforce(String dateEnteredWorkforce) { + this.dateEnteredWorkforce = dateEnteredWorkforce; + return this; + } + + + /** + * 性别 + *

示例值:male + * + * @param genderId + * @return + */ + public Builder genderId(String genderId) { + this.genderId = genderId; + return this; + } + + + /** + * 国籍 + *

示例值:6862995757234914824 + * + * @param nationalityId + * @return + */ + public Builder nationalityId(String nationalityId) { + this.nationalityId = nationalityId; + return this; + } + + + /** + * 家庭地址 + *

示例值:home addr + * + * @param homeAddress + * @return + */ + public Builder homeAddress(String homeAddress) { + this.homeAddress = homeAddress; + return this; + } + + + /** + * 人员编号 + *

示例值:6862995757234914824 + * + * @param workerId + * @return + */ + public Builder workerId(String workerId) { + this.workerId = workerId; + return this; + } + + + public BasicInfo build() { + return new BasicInfo(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BasicJobData.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BasicJobData.java new file mode 100644 index 000000000..0f051f699 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BasicJobData.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class BasicJobData { + /** + * 任职信息 ID + *

示例值:1000000 + */ + @SerializedName("job_data_id") + private String jobDataId; + /** + * 雇佣 ID + *

示例值:6893014062142064135 + */ + @SerializedName("employment_id") + private String employmentId; + + // builder 开始 + public BasicJobData() { + } + + public BasicJobData(Builder builder) { + /** + * 任职信息 ID + *

示例值:1000000 + */ + this.jobDataId = builder.jobDataId; + /** + * 雇佣 ID + *

示例值:6893014062142064135 + */ + this.employmentId = builder.employmentId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getJobDataId() { + return this.jobDataId; + } + + public void setJobDataId(String jobDataId) { + this.jobDataId = jobDataId; + } + + public String getEmploymentId() { + return this.employmentId; + } + + public void setEmploymentId(String employmentId) { + this.employmentId = employmentId; + } + + public static class Builder { + /** + * 任职信息 ID + *

示例值:1000000 + */ + private String jobDataId; + /** + * 雇佣 ID + *

示例值:6893014062142064135 + */ + private String employmentId; + + /** + * 任职信息 ID + *

示例值:1000000 + * + * @param jobDataId + * @return + */ + public Builder jobDataId(String jobDataId) { + this.jobDataId = jobDataId; + return this; + } + + + /** + * 雇佣 ID + *

示例值:6893014062142064135 + * + * @param employmentId + * @return + */ + public Builder employmentId(String employmentId) { + this.employmentId = employmentId; + return this; + } + + + public BasicJobData build() { + return new BasicJobData(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BasicPersonInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BasicPersonInfo.java new file mode 100644 index 000000000..de4ab82d0 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BasicPersonInfo.java @@ -0,0 +1,185 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class BasicPersonInfo { + /** + * 个人信息 ID + *

示例值:6919733936050406926 + */ + @SerializedName("person_id") + private String personId; + /** + * 常用名 + *

示例值:刘梓新 + */ + @SerializedName("preferred_name") + private String preferredName; + /** + * 常用本地全名 + *

示例值:刘梓新 + */ + @SerializedName("preferred_local_full_name") + private String preferredLocalFullName; + /** + * 常用英文全名 + *

示例值:Henry + */ + @SerializedName("preferred_english_full_name") + private String preferredEnglishFullName; + + // builder 开始 + public BasicPersonInfo() { + } + + public BasicPersonInfo(Builder builder) { + /** + * 个人信息 ID + *

示例值:6919733936050406926 + */ + this.personId = builder.personId; + /** + * 常用名 + *

示例值:刘梓新 + */ + this.preferredName = builder.preferredName; + /** + * 常用本地全名 + *

示例值:刘梓新 + */ + this.preferredLocalFullName = builder.preferredLocalFullName; + /** + * 常用英文全名 + *

示例值:Henry + */ + this.preferredEnglishFullName = builder.preferredEnglishFullName; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getPersonId() { + return this.personId; + } + + public void setPersonId(String personId) { + this.personId = personId; + } + + public String getPreferredName() { + return this.preferredName; + } + + public void setPreferredName(String preferredName) { + this.preferredName = preferredName; + } + + public String getPreferredLocalFullName() { + return this.preferredLocalFullName; + } + + public void setPreferredLocalFullName(String preferredLocalFullName) { + this.preferredLocalFullName = preferredLocalFullName; + } + + public String getPreferredEnglishFullName() { + return this.preferredEnglishFullName; + } + + public void setPreferredEnglishFullName(String preferredEnglishFullName) { + this.preferredEnglishFullName = preferredEnglishFullName; + } + + public static class Builder { + /** + * 个人信息 ID + *

示例值:6919733936050406926 + */ + private String personId; + /** + * 常用名 + *

示例值:刘梓新 + */ + private String preferredName; + /** + * 常用本地全名 + *

示例值:刘梓新 + */ + private String preferredLocalFullName; + /** + * 常用英文全名 + *

示例值:Henry + */ + private String preferredEnglishFullName; + + /** + * 个人信息 ID + *

示例值:6919733936050406926 + * + * @param personId + * @return + */ + public Builder personId(String personId) { + this.personId = personId; + return this; + } + + + /** + * 常用名 + *

示例值:刘梓新 + * + * @param preferredName + * @return + */ + public Builder preferredName(String preferredName) { + this.preferredName = preferredName; + return this; + } + + + /** + * 常用本地全名 + *

示例值:刘梓新 + * + * @param preferredLocalFullName + * @return + */ + public Builder preferredLocalFullName(String preferredLocalFullName) { + this.preferredLocalFullName = preferredLocalFullName; + return this; + } + + + /** + * 常用英文全名 + *

示例值:Henry + * + * @param preferredEnglishFullName + * @return + */ + public Builder preferredEnglishFullName(String preferredEnglishFullName) { + this.preferredEnglishFullName = preferredEnglishFullName; + return this; + } + + + public BasicPersonInfo build() { + return new BasicPersonInfo(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetCompanyReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetCompanyReq.java new file mode 100644 index 000000000..d085b12f1 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetCompanyReq.java @@ -0,0 +1,65 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.annotation.Body; + +public class BatchGetCompanyReq { + @Body + private BatchGetCompanyReqBody body; + + // builder 开始 + public BatchGetCompanyReq() { + } + + public BatchGetCompanyReq(Builder builder) { + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public BatchGetCompanyReqBody getBatchGetCompanyReqBody() { + return this.body; + } + + public void setBatchGetCompanyReqBody(BatchGetCompanyReqBody body) { + this.body = body; + } + + public static class Builder { + + private BatchGetCompanyReqBody body; + + public BatchGetCompanyReqBody getBatchGetCompanyReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder batchGetCompanyReqBody(BatchGetCompanyReqBody body) { + this.body = body; + return this; + } + + public BatchGetCompanyReq build() { + return new BatchGetCompanyReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetCompanyReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetCompanyReqBody.java new file mode 100644 index 000000000..670f52e2d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetCompanyReqBody.java @@ -0,0 +1,74 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class BatchGetCompanyReqBody { + /** + * 公司 ID 列表 + *

示例值: + */ + @SerializedName("company_ids") + private String[] companyIds; + + // builder 开始 + public BatchGetCompanyReqBody() { + } + + public BatchGetCompanyReqBody(Builder builder) { + /** + * 公司 ID 列表 + *

示例值: + */ + this.companyIds = builder.companyIds; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String[] getCompanyIds() { + return this.companyIds; + } + + public void setCompanyIds(String[] companyIds) { + this.companyIds = companyIds; + } + + public static class Builder { + /** + * 公司 ID 列表 + *

示例值: + */ + private String[] companyIds; + + /** + * 公司 ID 列表 + *

示例值: + * + * @param companyIds + * @return + */ + public Builder companyIds(String[] companyIds) { + this.companyIds = companyIds; + return this; + } + + + public BatchGetCompanyReqBody build() { + return new BatchGetCompanyReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetCompanyResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetCompanyResp.java new file mode 100644 index 000000000..7d2c9ab7d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetCompanyResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class BatchGetCompanyResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetCompanyRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetCompanyRespBody.java new file mode 100644 index 000000000..d668adccd --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetCompanyRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class BatchGetCompanyRespBody { + /** + * 查询的公司信息 + *

示例值: + */ + @SerializedName("items") + private Company[] items; + + public Company[] getItems() { + return this.items; + } + + public void setItems(Company[] items) { + this.items = items; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeeReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeeReq.java new file mode 100644 index 000000000..9a1ee6435 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeeReq.java @@ -0,0 +1,156 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Query; + +public class BatchGetEmployeeReq { + /** + * 用户 ID 类型 + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + */ + @Query + @SerializedName("department_id_type") + private String departmentIdType; + @Body + private BatchGetEmployeeReqBody body; + + // builder 开始 + public BatchGetEmployeeReq() { + } + + public BatchGetEmployeeReq(Builder builder) { + /** + * 用户 ID 类型 + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + */ + this.departmentIdType = builder.departmentIdType; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getDepartmentIdType() { + return this.departmentIdType; + } + + public void setDepartmentIdType(String departmentIdType) { + this.departmentIdType = departmentIdType; + } + + public BatchGetEmployeeReqBody getBatchGetEmployeeReqBody() { + return this.body; + } + + public void setBatchGetEmployeeReqBody(BatchGetEmployeeReqBody body) { + this.body = body; + } + + public static class Builder { + private String userIdType; // 用户 ID 类型 + private String departmentIdType; // 此次调用中使用的部门 ID 类型 + private BatchGetEmployeeReqBody body; + + /** + * 用户 ID 类型 + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 用户 ID 类型 + *

示例值:open_id + * + * @param userIdType {@link com.lark.oapi.service.corehr.v2.enums.BatchGetEmployeeUserIdTypeEnum} + * @return + */ + public Builder userIdType(com.lark.oapi.service.corehr.v2.enums.BatchGetEmployeeUserIdTypeEnum userIdType) { + this.userIdType = userIdType.getValue(); + return this; + } + + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + * + * @param departmentIdType + * @return + */ + public Builder departmentIdType(String departmentIdType) { + this.departmentIdType = departmentIdType; + return this; + } + + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + * + * @param departmentIdType {@link com.lark.oapi.service.corehr.v2.enums.BatchGetEmployeeDepartmentIdTypeEnum} + * @return + */ + public Builder departmentIdType(com.lark.oapi.service.corehr.v2.enums.BatchGetEmployeeDepartmentIdTypeEnum departmentIdType) { + this.departmentIdType = departmentIdType.getValue(); + return this; + } + + public BatchGetEmployeeReqBody getBatchGetEmployeeReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder batchGetEmployeeReqBody(BatchGetEmployeeReqBody body) { + this.body = body; + return this; + } + + public BatchGetEmployeeReq build() { + return new BatchGetEmployeeReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeeReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeeReqBody.java new file mode 100644 index 000000000..0fc3a8b12 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeeReqBody.java @@ -0,0 +1,185 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class BatchGetEmployeeReqBody { + /** + * 返回数据的字段列表,填写方式:为空时默认仅返回 ID + *

示例值: + */ + @SerializedName("fields") + private String[] fields; + /** + * 雇佣 ID 列表 + *

示例值: + */ + @SerializedName("employment_ids") + private String[] employmentIds; + /** + * 个人信息 ID 列表,employment_ids参数有值时该参数不生效 + *

示例值: + */ + @SerializedName("person_ids") + private String[] personIds; + /** + * 主工作邮箱列表 + *

示例值: + */ + @SerializedName("work_emails") + private String[] workEmails; + + // builder 开始 + public BatchGetEmployeeReqBody() { + } + + public BatchGetEmployeeReqBody(Builder builder) { + /** + * 返回数据的字段列表,填写方式:为空时默认仅返回 ID + *

示例值: + */ + this.fields = builder.fields; + /** + * 雇佣 ID 列表 + *

示例值: + */ + this.employmentIds = builder.employmentIds; + /** + * 个人信息 ID 列表,employment_ids参数有值时该参数不生效 + *

示例值: + */ + this.personIds = builder.personIds; + /** + * 主工作邮箱列表 + *

示例值: + */ + this.workEmails = builder.workEmails; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String[] getFields() { + return this.fields; + } + + public void setFields(String[] fields) { + this.fields = fields; + } + + public String[] getEmploymentIds() { + return this.employmentIds; + } + + public void setEmploymentIds(String[] employmentIds) { + this.employmentIds = employmentIds; + } + + public String[] getPersonIds() { + return this.personIds; + } + + public void setPersonIds(String[] personIds) { + this.personIds = personIds; + } + + public String[] getWorkEmails() { + return this.workEmails; + } + + public void setWorkEmails(String[] workEmails) { + this.workEmails = workEmails; + } + + public static class Builder { + /** + * 返回数据的字段列表,填写方式:为空时默认仅返回 ID + *

示例值: + */ + private String[] fields; + /** + * 雇佣 ID 列表 + *

示例值: + */ + private String[] employmentIds; + /** + * 个人信息 ID 列表,employment_ids参数有值时该参数不生效 + *

示例值: + */ + private String[] personIds; + /** + * 主工作邮箱列表 + *

示例值: + */ + private String[] workEmails; + + /** + * 返回数据的字段列表,填写方式:为空时默认仅返回 ID + *

示例值: + * + * @param fields + * @return + */ + public Builder fields(String[] fields) { + this.fields = fields; + return this; + } + + + /** + * 雇佣 ID 列表 + *

示例值: + * + * @param employmentIds + * @return + */ + public Builder employmentIds(String[] employmentIds) { + this.employmentIds = employmentIds; + return this; + } + + + /** + * 个人信息 ID 列表,employment_ids参数有值时该参数不生效 + *

示例值: + * + * @param personIds + * @return + */ + public Builder personIds(String[] personIds) { + this.personIds = personIds; + return this; + } + + + /** + * 主工作邮箱列表 + *

示例值: + * + * @param workEmails + * @return + */ + public Builder workEmails(String[] workEmails) { + this.workEmails = workEmails; + return this; + } + + + public BatchGetEmployeeReqBody build() { + return new BatchGetEmployeeReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeeResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeeResp.java new file mode 100644 index 000000000..f26db1073 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeeResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class BatchGetEmployeeResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeeRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeeRespBody.java new file mode 100644 index 000000000..632d01c02 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeeRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class BatchGetEmployeeRespBody { + /** + * 查询的雇佣信息 + *

示例值: + */ + @SerializedName("items") + private Employee[] items; + + public Employee[] getItems() { + return this.items; + } + + public void setItems(Employee[] items) { + this.items = items; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesBpReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesBpReq.java new file mode 100644 index 000000000..f6a4c6cee --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesBpReq.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Query; + +public class BatchGetEmployeesBpReq { + /** + * 用户 ID 类型 + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + @Body + private BatchGetEmployeesBpReqBody body; + + // builder 开始 + public BatchGetEmployeesBpReq() { + } + + public BatchGetEmployeesBpReq(Builder builder) { + /** + * 用户 ID 类型 + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public BatchGetEmployeesBpReqBody getBatchGetEmployeesBpReqBody() { + return this.body; + } + + public void setBatchGetEmployeesBpReqBody(BatchGetEmployeesBpReqBody body) { + this.body = body; + } + + public static class Builder { + private String userIdType; // 用户 ID 类型 + private BatchGetEmployeesBpReqBody body; + + /** + * 用户 ID 类型 + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 用户 ID 类型 + *

示例值:open_id + * + * @param userIdType {@link com.lark.oapi.service.corehr.v2.enums.BatchGetEmployeesBpUserIdTypeEnum} + * @return + */ + public Builder userIdType(com.lark.oapi.service.corehr.v2.enums.BatchGetEmployeesBpUserIdTypeEnum userIdType) { + this.userIdType = userIdType.getValue(); + return this; + } + + public BatchGetEmployeesBpReqBody getBatchGetEmployeesBpReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder batchGetEmployeesBpReqBody(BatchGetEmployeesBpReqBody body) { + this.body = body; + return this; + } + + public BatchGetEmployeesBpReq build() { + return new BatchGetEmployeesBpReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesBpReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesBpReqBody.java new file mode 100644 index 000000000..1cc058982 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesBpReqBody.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class BatchGetEmployeesBpReqBody { + /** + * 员工雇佣 ID + *

示例值: + */ + @SerializedName("employment_ids") + private String[] employmentIds; + /** + * 是否获取全部 BP,true 为获取员工所在部门及来自上级部门的全部 HRBP 和属地 BP,false 为仅获取员工的直属 HRBP 和属地 BP(当员工所在部门、属地无 BP 时,会上钻找到最近的 BP),默认为 false + *

示例值:true + */ + @SerializedName("get_all") + private Boolean getAll; + + // builder 开始 + public BatchGetEmployeesBpReqBody() { + } + + public BatchGetEmployeesBpReqBody(Builder builder) { + /** + * 员工雇佣 ID + *

示例值: + */ + this.employmentIds = builder.employmentIds; + /** + * 是否获取全部 BP,true 为获取员工所在部门及来自上级部门的全部 HRBP 和属地 BP,false 为仅获取员工的直属 HRBP 和属地 BP(当员工所在部门、属地无 BP 时,会上钻找到最近的 BP),默认为 false + *

示例值:true + */ + this.getAll = builder.getAll; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String[] getEmploymentIds() { + return this.employmentIds; + } + + public void setEmploymentIds(String[] employmentIds) { + this.employmentIds = employmentIds; + } + + public Boolean getGetAll() { + return this.getAll; + } + + public void setGetAll(Boolean getAll) { + this.getAll = getAll; + } + + public static class Builder { + /** + * 员工雇佣 ID + *

示例值: + */ + private String[] employmentIds; + /** + * 是否获取全部 BP,true 为获取员工所在部门及来自上级部门的全部 HRBP 和属地 BP,false 为仅获取员工的直属 HRBP 和属地 BP(当员工所在部门、属地无 BP 时,会上钻找到最近的 BP),默认为 false + *

示例值:true + */ + private Boolean getAll; + + /** + * 员工雇佣 ID + *

示例值: + * + * @param employmentIds + * @return + */ + public Builder employmentIds(String[] employmentIds) { + this.employmentIds = employmentIds; + return this; + } + + + /** + * 是否获取全部 BP,true 为获取员工所在部门及来自上级部门的全部 HRBP 和属地 BP,false 为仅获取员工的直属 HRBP 和属地 BP(当员工所在部门、属地无 BP 时,会上钻找到最近的 BP),默认为 false + *

示例值:true + * + * @param getAll + * @return + */ + public Builder getAll(Boolean getAll) { + this.getAll = getAll; + return this; + } + + + public BatchGetEmployeesBpReqBody build() { + return new BatchGetEmployeesBpReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesBpResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesBpResp.java new file mode 100644 index 000000000..85c8661ba --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesBpResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class BatchGetEmployeesBpResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesBpRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesBpRespBody.java new file mode 100644 index 000000000..e8f5689fe --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesBpRespBody.java @@ -0,0 +1,48 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class BatchGetEmployeesBpRespBody { + /** + * 员工直属 BP 信息,当员工所在部门、属地无 BP 时,会上钻找到最近的 BP + *

示例值: + */ + @SerializedName("employment_direct_bps") + private EmploymentBp[] employmentDirectBps; + /** + * 员工全部 BP 信息 + *

示例值: + */ + @SerializedName("employment_all_bps") + private EmploymentBp[] employmentAllBps; + + public EmploymentBp[] getEmploymentDirectBps() { + return this.employmentDirectBps; + } + + public void setEmploymentDirectBps(EmploymentBp[] employmentDirectBps) { + this.employmentDirectBps = employmentDirectBps; + } + + public EmploymentBp[] getEmploymentAllBps() { + return this.employmentAllBps; + } + + public void setEmploymentAllBps(EmploymentBp[] employmentAllBps) { + this.employmentAllBps = employmentAllBps; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesJobDataReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesJobDataReq.java new file mode 100644 index 000000000..220e49402 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesJobDataReq.java @@ -0,0 +1,156 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Query; + +public class BatchGetEmployeesJobDataReq { + /** + * 用户 ID 类型 + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:people_corehr_department_id + */ + @Query + @SerializedName("department_id_type") + private String departmentIdType; + @Body + private BatchGetEmployeesJobDataReqBody body; + + // builder 开始 + public BatchGetEmployeesJobDataReq() { + } + + public BatchGetEmployeesJobDataReq(Builder builder) { + /** + * 用户 ID 类型 + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:people_corehr_department_id + */ + this.departmentIdType = builder.departmentIdType; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getDepartmentIdType() { + return this.departmentIdType; + } + + public void setDepartmentIdType(String departmentIdType) { + this.departmentIdType = departmentIdType; + } + + public BatchGetEmployeesJobDataReqBody getBatchGetEmployeesJobDataReqBody() { + return this.body; + } + + public void setBatchGetEmployeesJobDataReqBody(BatchGetEmployeesJobDataReqBody body) { + this.body = body; + } + + public static class Builder { + private String userIdType; // 用户 ID 类型 + private String departmentIdType; // 此次调用中使用的部门 ID 类型 + private BatchGetEmployeesJobDataReqBody body; + + /** + * 用户 ID 类型 + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 用户 ID 类型 + *

示例值:open_id + * + * @param userIdType {@link com.lark.oapi.service.corehr.v2.enums.BatchGetEmployeesJobDataUserIdTypeEnum} + * @return + */ + public Builder userIdType(com.lark.oapi.service.corehr.v2.enums.BatchGetEmployeesJobDataUserIdTypeEnum userIdType) { + this.userIdType = userIdType.getValue(); + return this; + } + + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:people_corehr_department_id + * + * @param departmentIdType + * @return + */ + public Builder departmentIdType(String departmentIdType) { + this.departmentIdType = departmentIdType; + return this; + } + + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:people_corehr_department_id + * + * @param departmentIdType {@link com.lark.oapi.service.corehr.v2.enums.BatchGetEmployeesJobDataDepartmentIdTypeEnum} + * @return + */ + public Builder departmentIdType(com.lark.oapi.service.corehr.v2.enums.BatchGetEmployeesJobDataDepartmentIdTypeEnum departmentIdType) { + this.departmentIdType = departmentIdType.getValue(); + return this; + } + + public BatchGetEmployeesJobDataReqBody getBatchGetEmployeesJobDataReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder batchGetEmployeesJobDataReqBody(BatchGetEmployeesJobDataReqBody body) { + this.body = body; + return this; + } + + public BatchGetEmployeesJobDataReq build() { + return new BatchGetEmployeesJobDataReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesJobDataReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesJobDataReqBody.java new file mode 100644 index 000000000..33b0d85ce --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesJobDataReqBody.java @@ -0,0 +1,222 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class BatchGetEmployeesJobDataReqBody { + /** + * 员工雇佣 ID 列表 + *

示例值: + */ + @SerializedName("employment_ids") + private String[] employmentIds; + /** + * 是否获取所有任职记录,true 为获取员工所有版本的任职记录,false 为仅获取当前生效的任职记录,默认为 false + *

示例值:false + */ + @SerializedName("get_all_version") + private Boolean getAllVersion; + /** + * 生效日期 - 搜索范围开始 + *

示例值:2020-01-01 + */ + @SerializedName("effective_date_start") + private String effectiveDateStart; + /** + * 生效日期 - 搜索范围结束 + *

示例值:2020-01-01 + */ + @SerializedName("effective_date_end") + private String effectiveDateEnd; + /** + * 查看数据日期,默认为今天 + *

示例值:2020-01-01 + */ + @SerializedName("data_date") + private String dataDate; + + // builder 开始 + public BatchGetEmployeesJobDataReqBody() { + } + + public BatchGetEmployeesJobDataReqBody(Builder builder) { + /** + * 员工雇佣 ID 列表 + *

示例值: + */ + this.employmentIds = builder.employmentIds; + /** + * 是否获取所有任职记录,true 为获取员工所有版本的任职记录,false 为仅获取当前生效的任职记录,默认为 false + *

示例值:false + */ + this.getAllVersion = builder.getAllVersion; + /** + * 生效日期 - 搜索范围开始 + *

示例值:2020-01-01 + */ + this.effectiveDateStart = builder.effectiveDateStart; + /** + * 生效日期 - 搜索范围结束 + *

示例值:2020-01-01 + */ + this.effectiveDateEnd = builder.effectiveDateEnd; + /** + * 查看数据日期,默认为今天 + *

示例值:2020-01-01 + */ + this.dataDate = builder.dataDate; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String[] getEmploymentIds() { + return this.employmentIds; + } + + public void setEmploymentIds(String[] employmentIds) { + this.employmentIds = employmentIds; + } + + public Boolean getGetAllVersion() { + return this.getAllVersion; + } + + public void setGetAllVersion(Boolean getAllVersion) { + this.getAllVersion = getAllVersion; + } + + public String getEffectiveDateStart() { + return this.effectiveDateStart; + } + + public void setEffectiveDateStart(String effectiveDateStart) { + this.effectiveDateStart = effectiveDateStart; + } + + public String getEffectiveDateEnd() { + return this.effectiveDateEnd; + } + + public void setEffectiveDateEnd(String effectiveDateEnd) { + this.effectiveDateEnd = effectiveDateEnd; + } + + public String getDataDate() { + return this.dataDate; + } + + public void setDataDate(String dataDate) { + this.dataDate = dataDate; + } + + public static class Builder { + /** + * 员工雇佣 ID 列表 + *

示例值: + */ + private String[] employmentIds; + /** + * 是否获取所有任职记录,true 为获取员工所有版本的任职记录,false 为仅获取当前生效的任职记录,默认为 false + *

示例值:false + */ + private Boolean getAllVersion; + /** + * 生效日期 - 搜索范围开始 + *

示例值:2020-01-01 + */ + private String effectiveDateStart; + /** + * 生效日期 - 搜索范围结束 + *

示例值:2020-01-01 + */ + private String effectiveDateEnd; + /** + * 查看数据日期,默认为今天 + *

示例值:2020-01-01 + */ + private String dataDate; + + /** + * 员工雇佣 ID 列表 + *

示例值: + * + * @param employmentIds + * @return + */ + public Builder employmentIds(String[] employmentIds) { + this.employmentIds = employmentIds; + return this; + } + + + /** + * 是否获取所有任职记录,true 为获取员工所有版本的任职记录,false 为仅获取当前生效的任职记录,默认为 false + *

示例值:false + * + * @param getAllVersion + * @return + */ + public Builder getAllVersion(Boolean getAllVersion) { + this.getAllVersion = getAllVersion; + return this; + } + + + /** + * 生效日期 - 搜索范围开始 + *

示例值:2020-01-01 + * + * @param effectiveDateStart + * @return + */ + public Builder effectiveDateStart(String effectiveDateStart) { + this.effectiveDateStart = effectiveDateStart; + return this; + } + + + /** + * 生效日期 - 搜索范围结束 + *

示例值:2020-01-01 + * + * @param effectiveDateEnd + * @return + */ + public Builder effectiveDateEnd(String effectiveDateEnd) { + this.effectiveDateEnd = effectiveDateEnd; + return this; + } + + + /** + * 查看数据日期,默认为今天 + *

示例值:2020-01-01 + * + * @param dataDate + * @return + */ + public Builder dataDate(String dataDate) { + this.dataDate = dataDate; + return this; + } + + + public BatchGetEmployeesJobDataReqBody build() { + return new BatchGetEmployeesJobDataReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesJobDataResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesJobDataResp.java new file mode 100644 index 000000000..32e75060d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesJobDataResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class BatchGetEmployeesJobDataResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesJobDataRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesJobDataRespBody.java new file mode 100644 index 000000000..b87a64cdc --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetEmployeesJobDataRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class BatchGetEmployeesJobDataRespBody { + /** + * 查询的雇佣信息 + *

示例值: + */ + @SerializedName("items") + private EmployeeJobData[] items; + + public EmployeeJobData[] getItems() { + return this.items; + } + + public void setItems(EmployeeJobData[] items) { + this.items = items; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobFamilyReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobFamilyReq.java new file mode 100644 index 000000000..15417b0f8 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobFamilyReq.java @@ -0,0 +1,65 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.annotation.Body; + +public class BatchGetJobFamilyReq { + @Body + private BatchGetJobFamilyReqBody body; + + // builder 开始 + public BatchGetJobFamilyReq() { + } + + public BatchGetJobFamilyReq(Builder builder) { + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public BatchGetJobFamilyReqBody getBatchGetJobFamilyReqBody() { + return this.body; + } + + public void setBatchGetJobFamilyReqBody(BatchGetJobFamilyReqBody body) { + this.body = body; + } + + public static class Builder { + + private BatchGetJobFamilyReqBody body; + + public BatchGetJobFamilyReqBody getBatchGetJobFamilyReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder batchGetJobFamilyReqBody(BatchGetJobFamilyReqBody body) { + this.body = body; + return this; + } + + public BatchGetJobFamilyReq build() { + return new BatchGetJobFamilyReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobFamilyReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobFamilyReqBody.java new file mode 100644 index 000000000..0e1d1aa91 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobFamilyReqBody.java @@ -0,0 +1,74 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class BatchGetJobFamilyReqBody { + /** + * 序列 ID 列表 + *

示例值: + */ + @SerializedName("job_family_ids") + private String[] jobFamilyIds; + + // builder 开始 + public BatchGetJobFamilyReqBody() { + } + + public BatchGetJobFamilyReqBody(Builder builder) { + /** + * 序列 ID 列表 + *

示例值: + */ + this.jobFamilyIds = builder.jobFamilyIds; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String[] getJobFamilyIds() { + return this.jobFamilyIds; + } + + public void setJobFamilyIds(String[] jobFamilyIds) { + this.jobFamilyIds = jobFamilyIds; + } + + public static class Builder { + /** + * 序列 ID 列表 + *

示例值: + */ + private String[] jobFamilyIds; + + /** + * 序列 ID 列表 + *

示例值: + * + * @param jobFamilyIds + * @return + */ + public Builder jobFamilyIds(String[] jobFamilyIds) { + this.jobFamilyIds = jobFamilyIds; + return this; + } + + + public BatchGetJobFamilyReqBody build() { + return new BatchGetJobFamilyReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobFamilyResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobFamilyResp.java new file mode 100644 index 000000000..7d0274f10 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobFamilyResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class BatchGetJobFamilyResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobFamilyRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobFamilyRespBody.java new file mode 100644 index 000000000..601cf2bdf --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobFamilyRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class BatchGetJobFamilyRespBody { + /** + * 查询的序列信息 + *

示例值: + */ + @SerializedName("items") + private JobFamily[] items; + + public JobFamily[] getItems() { + return this.items; + } + + public void setItems(JobFamily[] items) { + this.items = items; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobLevelReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobLevelReq.java new file mode 100644 index 000000000..5f03e6c5c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobLevelReq.java @@ -0,0 +1,65 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.annotation.Body; + +public class BatchGetJobLevelReq { + @Body + private BatchGetJobLevelReqBody body; + + // builder 开始 + public BatchGetJobLevelReq() { + } + + public BatchGetJobLevelReq(Builder builder) { + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public BatchGetJobLevelReqBody getBatchGetJobLevelReqBody() { + return this.body; + } + + public void setBatchGetJobLevelReqBody(BatchGetJobLevelReqBody body) { + this.body = body; + } + + public static class Builder { + + private BatchGetJobLevelReqBody body; + + public BatchGetJobLevelReqBody getBatchGetJobLevelReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder batchGetJobLevelReqBody(BatchGetJobLevelReqBody body) { + this.body = body; + return this; + } + + public BatchGetJobLevelReq build() { + return new BatchGetJobLevelReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobLevelReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobLevelReqBody.java new file mode 100644 index 000000000..2d3cc1400 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobLevelReqBody.java @@ -0,0 +1,74 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class BatchGetJobLevelReqBody { + /** + * 职级 ID 列表 + *

示例值: + */ + @SerializedName("job_level_ids") + private String[] jobLevelIds; + + // builder 开始 + public BatchGetJobLevelReqBody() { + } + + public BatchGetJobLevelReqBody(Builder builder) { + /** + * 职级 ID 列表 + *

示例值: + */ + this.jobLevelIds = builder.jobLevelIds; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String[] getJobLevelIds() { + return this.jobLevelIds; + } + + public void setJobLevelIds(String[] jobLevelIds) { + this.jobLevelIds = jobLevelIds; + } + + public static class Builder { + /** + * 职级 ID 列表 + *

示例值: + */ + private String[] jobLevelIds; + + /** + * 职级 ID 列表 + *

示例值: + * + * @param jobLevelIds + * @return + */ + public Builder jobLevelIds(String[] jobLevelIds) { + this.jobLevelIds = jobLevelIds; + return this; + } + + + public BatchGetJobLevelReqBody build() { + return new BatchGetJobLevelReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobLevelResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobLevelResp.java new file mode 100644 index 000000000..28924ddb3 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobLevelResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class BatchGetJobLevelResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobLevelRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobLevelRespBody.java new file mode 100644 index 000000000..5b4a9bd3e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetJobLevelRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class BatchGetJobLevelRespBody { + /** + * 查询的职级信息 + *

示例值: + */ + @SerializedName("items") + private JobLevel[] items; + + public JobLevel[] getItems() { + return this.items; + } + + public void setItems(JobLevel[] items) { + this.items = items; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetLocationReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetLocationReq.java new file mode 100644 index 000000000..39eb2340f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetLocationReq.java @@ -0,0 +1,65 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.annotation.Body; + +public class BatchGetLocationReq { + @Body + private BatchGetLocationReqBody body; + + // builder 开始 + public BatchGetLocationReq() { + } + + public BatchGetLocationReq(Builder builder) { + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public BatchGetLocationReqBody getBatchGetLocationReqBody() { + return this.body; + } + + public void setBatchGetLocationReqBody(BatchGetLocationReqBody body) { + this.body = body; + } + + public static class Builder { + + private BatchGetLocationReqBody body; + + public BatchGetLocationReqBody getBatchGetLocationReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder batchGetLocationReqBody(BatchGetLocationReqBody body) { + this.body = body; + return this; + } + + public BatchGetLocationReq build() { + return new BatchGetLocationReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetLocationReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetLocationReqBody.java new file mode 100644 index 000000000..db7bc4748 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetLocationReqBody.java @@ -0,0 +1,74 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class BatchGetLocationReqBody { + /** + * 地点 ID 列表 + *

示例值: + */ + @SerializedName("location_ids") + private String[] locationIds; + + // builder 开始 + public BatchGetLocationReqBody() { + } + + public BatchGetLocationReqBody(Builder builder) { + /** + * 地点 ID 列表 + *

示例值: + */ + this.locationIds = builder.locationIds; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String[] getLocationIds() { + return this.locationIds; + } + + public void setLocationIds(String[] locationIds) { + this.locationIds = locationIds; + } + + public static class Builder { + /** + * 地点 ID 列表 + *

示例值: + */ + private String[] locationIds; + + /** + * 地点 ID 列表 + *

示例值: + * + * @param locationIds + * @return + */ + public Builder locationIds(String[] locationIds) { + this.locationIds = locationIds; + return this; + } + + + public BatchGetLocationReqBody build() { + return new BatchGetLocationReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetLocationResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetLocationResp.java new file mode 100644 index 000000000..9b512d7a4 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetLocationResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class BatchGetLocationResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetLocationRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetLocationRespBody.java new file mode 100644 index 000000000..84a2957fa --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/BatchGetLocationRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class BatchGetLocationRespBody { + /** + * 查询的地点信息 + *

示例值: + */ + @SerializedName("items") + private Location[] items; + + public Location[] getItems() { + return this.items; + } + + public void setItems(Location[] items) { + this.items = items; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Bp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Bp.java new file mode 100644 index 000000000..dc9fc7b3d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Bp.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Bp { + /** + * 部门 ID + *

示例值:4719456877659520852 + */ + @SerializedName("department_id") + private String departmentId; + /** + * BP 的雇佣 ID + *

示例值:4719456877659520852 + */ + @SerializedName("hrbp_id") + private String hrbpId; + + // builder 开始 + public Bp() { + } + + public Bp(Builder builder) { + /** + * 部门 ID + *

示例值:4719456877659520852 + */ + this.departmentId = builder.departmentId; + /** + * BP 的雇佣 ID + *

示例值:4719456877659520852 + */ + this.hrbpId = builder.hrbpId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getDepartmentId() { + return this.departmentId; + } + + public void setDepartmentId(String departmentId) { + this.departmentId = departmentId; + } + + public String getHrbpId() { + return this.hrbpId; + } + + public void setHrbpId(String hrbpId) { + this.hrbpId = hrbpId; + } + + public static class Builder { + /** + * 部门 ID + *

示例值:4719456877659520852 + */ + private String departmentId; + /** + * BP 的雇佣 ID + *

示例值:4719456877659520852 + */ + private String hrbpId; + + /** + * 部门 ID + *

示例值:4719456877659520852 + * + * @param departmentId + * @return + */ + public Builder departmentId(String departmentId) { + this.departmentId = departmentId; + return this; + } + + + /** + * BP 的雇佣 ID + *

示例值:4719456877659520852 + * + * @param hrbpId + * @return + */ + public Builder hrbpId(String hrbpId) { + this.hrbpId = hrbpId; + return this; + } + + + public Bp build() { + return new Bp(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CalculateParam.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CalculateParam.java new file mode 100644 index 000000000..fbdcecec4 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CalculateParam.java @@ -0,0 +1,333 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class CalculateParam { + /** + * 部门 ID + *

示例值:slnkdnaklsnda + */ + @SerializedName("department_id") + private String departmentId; + /** + * 人员类型 ID + *

示例值:kajsdnjasdn + */ + @SerializedName("employee_type_id") + private String employeeTypeId; + /** + * 工作地点 ID + *

示例值:asbjldasnjdlwa + */ + @SerializedName("work_location_id") + private String workLocationId; + /** + * 社保公积金缴纳地 ID + *

示例值:dsalndlnasl + */ + @SerializedName("social_security_city_id") + private String socialSecurityCityId; + /** + * 序列 ID + *

示例值:bjlsadnas + */ + @SerializedName("job_family_id") + private String jobFamilyId; + /** + * 职级 ID + *

示例值:dsadamkdq + */ + @SerializedName("job_level_id") + private String jobLevelId; + /** + * 职务 ID + *

示例值:dsandkjanjnda + */ + @SerializedName("job_id") + private String jobId; + /** + * 人员自定义字段 + *

示例值: + */ + @SerializedName("matching_rule_dimension") + private DimensionValue[] matchingRuleDimension; + + // builder 开始 + public CalculateParam() { + } + + public CalculateParam(Builder builder) { + /** + * 部门 ID + *

示例值:slnkdnaklsnda + */ + this.departmentId = builder.departmentId; + /** + * 人员类型 ID + *

示例值:kajsdnjasdn + */ + this.employeeTypeId = builder.employeeTypeId; + /** + * 工作地点 ID + *

示例值:asbjldasnjdlwa + */ + this.workLocationId = builder.workLocationId; + /** + * 社保公积金缴纳地 ID + *

示例值:dsalndlnasl + */ + this.socialSecurityCityId = builder.socialSecurityCityId; + /** + * 序列 ID + *

示例值:bjlsadnas + */ + this.jobFamilyId = builder.jobFamilyId; + /** + * 职级 ID + *

示例值:dsadamkdq + */ + this.jobLevelId = builder.jobLevelId; + /** + * 职务 ID + *

示例值:dsandkjanjnda + */ + this.jobId = builder.jobId; + /** + * 人员自定义字段 + *

示例值: + */ + this.matchingRuleDimension = builder.matchingRuleDimension; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getDepartmentId() { + return this.departmentId; + } + + public void setDepartmentId(String departmentId) { + this.departmentId = departmentId; + } + + public String getEmployeeTypeId() { + return this.employeeTypeId; + } + + public void setEmployeeTypeId(String employeeTypeId) { + this.employeeTypeId = employeeTypeId; + } + + public String getWorkLocationId() { + return this.workLocationId; + } + + public void setWorkLocationId(String workLocationId) { + this.workLocationId = workLocationId; + } + + public String getSocialSecurityCityId() { + return this.socialSecurityCityId; + } + + public void setSocialSecurityCityId(String socialSecurityCityId) { + this.socialSecurityCityId = socialSecurityCityId; + } + + public String getJobFamilyId() { + return this.jobFamilyId; + } + + public void setJobFamilyId(String jobFamilyId) { + this.jobFamilyId = jobFamilyId; + } + + public String getJobLevelId() { + return this.jobLevelId; + } + + public void setJobLevelId(String jobLevelId) { + this.jobLevelId = jobLevelId; + } + + public String getJobId() { + return this.jobId; + } + + public void setJobId(String jobId) { + this.jobId = jobId; + } + + public DimensionValue[] getMatchingRuleDimension() { + return this.matchingRuleDimension; + } + + public void setMatchingRuleDimension(DimensionValue[] matchingRuleDimension) { + this.matchingRuleDimension = matchingRuleDimension; + } + + public static class Builder { + /** + * 部门 ID + *

示例值:slnkdnaklsnda + */ + private String departmentId; + /** + * 人员类型 ID + *

示例值:kajsdnjasdn + */ + private String employeeTypeId; + /** + * 工作地点 ID + *

示例值:asbjldasnjdlwa + */ + private String workLocationId; + /** + * 社保公积金缴纳地 ID + *

示例值:dsalndlnasl + */ + private String socialSecurityCityId; + /** + * 序列 ID + *

示例值:bjlsadnas + */ + private String jobFamilyId; + /** + * 职级 ID + *

示例值:dsadamkdq + */ + private String jobLevelId; + /** + * 职务 ID + *

示例值:dsandkjanjnda + */ + private String jobId; + /** + * 人员自定义字段 + *

示例值: + */ + private DimensionValue[] matchingRuleDimension; + + /** + * 部门 ID + *

示例值:slnkdnaklsnda + * + * @param departmentId + * @return + */ + public Builder departmentId(String departmentId) { + this.departmentId = departmentId; + return this; + } + + + /** + * 人员类型 ID + *

示例值:kajsdnjasdn + * + * @param employeeTypeId + * @return + */ + public Builder employeeTypeId(String employeeTypeId) { + this.employeeTypeId = employeeTypeId; + return this; + } + + + /** + * 工作地点 ID + *

示例值:asbjldasnjdlwa + * + * @param workLocationId + * @return + */ + public Builder workLocationId(String workLocationId) { + this.workLocationId = workLocationId; + return this; + } + + + /** + * 社保公积金缴纳地 ID + *

示例值:dsalndlnasl + * + * @param socialSecurityCityId + * @return + */ + public Builder socialSecurityCityId(String socialSecurityCityId) { + this.socialSecurityCityId = socialSecurityCityId; + return this; + } + + + /** + * 序列 ID + *

示例值:bjlsadnas + * + * @param jobFamilyId + * @return + */ + public Builder jobFamilyId(String jobFamilyId) { + this.jobFamilyId = jobFamilyId; + return this; + } + + + /** + * 职级 ID + *

示例值:dsadamkdq + * + * @param jobLevelId + * @return + */ + public Builder jobLevelId(String jobLevelId) { + this.jobLevelId = jobLevelId; + return this; + } + + + /** + * 职务 ID + *

示例值:dsandkjanjnda + * + * @param jobId + * @return + */ + public Builder jobId(String jobId) { + this.jobId = jobId; + return this; + } + + + /** + * 人员自定义字段 + *

示例值: + * + * @param matchingRuleDimension + * @return + */ + public Builder matchingRuleDimension(DimensionValue[] matchingRuleDimension) { + this.matchingRuleDimension = matchingRuleDimension; + return this; + } + + + public CalculateParam build() { + return new CalculateParam(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ChangeFieldPair.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ChangeFieldPair.java new file mode 100644 index 000000000..2cca0cadd --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ChangeFieldPair.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class ChangeFieldPair { + /** + * 调整前 + *

示例值: + */ + @SerializedName("origin_value") + private CustomFieldData originValue; + /** + * 调整后 + *

示例值: + */ + @SerializedName("target_value") + private CustomFieldData targetValue; + + // builder 开始 + public ChangeFieldPair() { + } + + public ChangeFieldPair(Builder builder) { + /** + * 调整前 + *

示例值: + */ + this.originValue = builder.originValue; + /** + * 调整后 + *

示例值: + */ + this.targetValue = builder.targetValue; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public CustomFieldData getOriginValue() { + return this.originValue; + } + + public void setOriginValue(CustomFieldData originValue) { + this.originValue = originValue; + } + + public CustomFieldData getTargetValue() { + return this.targetValue; + } + + public void setTargetValue(CustomFieldData targetValue) { + this.targetValue = targetValue; + } + + public static class Builder { + /** + * 调整前 + *

示例值: + */ + private CustomFieldData originValue; + /** + * 调整后 + *

示例值: + */ + private CustomFieldData targetValue; + + /** + * 调整前 + *

示例值: + * + * @param originValue + * @return + */ + public Builder originValue(CustomFieldData originValue) { + this.originValue = originValue; + return this; + } + + + /** + * 调整后 + *

示例值: + * + * @param targetValue + * @return + */ + public Builder targetValue(CustomFieldData targetValue) { + this.targetValue = targetValue; + return this; + } + + + public ChangeFieldPair build() { + return new ChangeFieldPair(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/City.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/City.java new file mode 100644 index 000000000..6a83f0c21 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/City.java @@ -0,0 +1,234 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class City { + /** + * 城市 ID + *

示例值:6822114662122064111 + */ + @SerializedName("city_id") + private String cityId; + /** + * 城市名称 + *

示例值: + */ + @SerializedName("name") + private I18n[] name; + /** + * 所属国家/地区 ID,详细信息可通过【查询国家/地区信息】接口查询获得 + *

示例值:6822114062133062211 + */ + @SerializedName("country_region_subdivision_id") + private String countryRegionSubdivisionId; + /** + * 城市三字码 + *

示例值:PEK + */ + @SerializedName("code") + private String code; + /** + * 状态 + *

示例值:1 + */ + @SerializedName("status") + private Integer status; + + // builder 开始 + public City() { + } + + public City(Builder builder) { + /** + * 城市 ID + *

示例值:6822114662122064111 + */ + this.cityId = builder.cityId; + /** + * 城市名称 + *

示例值: + */ + this.name = builder.name; + /** + * 所属国家/地区 ID,详细信息可通过【查询国家/地区信息】接口查询获得 + *

示例值:6822114062133062211 + */ + this.countryRegionSubdivisionId = builder.countryRegionSubdivisionId; + /** + * 城市三字码 + *

示例值:PEK + */ + this.code = builder.code; + /** + * 状态 + *

示例值:1 + */ + this.status = builder.status; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getCityId() { + return this.cityId; + } + + public void setCityId(String cityId) { + this.cityId = cityId; + } + + public I18n[] getName() { + return this.name; + } + + public void setName(I18n[] name) { + this.name = name; + } + + public String getCountryRegionSubdivisionId() { + return this.countryRegionSubdivisionId; + } + + public void setCountryRegionSubdivisionId(String countryRegionSubdivisionId) { + this.countryRegionSubdivisionId = countryRegionSubdivisionId; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public Integer getStatus() { + return this.status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public static class Builder { + /** + * 城市 ID + *

示例值:6822114662122064111 + */ + private String cityId; + /** + * 城市名称 + *

示例值: + */ + private I18n[] name; + /** + * 所属国家/地区 ID,详细信息可通过【查询国家/地区信息】接口查询获得 + *

示例值:6822114062133062211 + */ + private String countryRegionSubdivisionId; + /** + * 城市三字码 + *

示例值:PEK + */ + private String code; + /** + * 状态 + *

示例值:1 + */ + private Integer status; + + /** + * 城市 ID + *

示例值:6822114662122064111 + * + * @param cityId + * @return + */ + public Builder cityId(String cityId) { + this.cityId = cityId; + return this; + } + + + /** + * 城市名称 + *

示例值: + * + * @param name + * @return + */ + public Builder name(I18n[] name) { + this.name = name; + return this; + } + + + /** + * 所属国家/地区 ID,详细信息可通过【查询国家/地区信息】接口查询获得 + *

示例值:6822114062133062211 + * + * @param countryRegionSubdivisionId + * @return + */ + public Builder countryRegionSubdivisionId(String countryRegionSubdivisionId) { + this.countryRegionSubdivisionId = countryRegionSubdivisionId; + return this; + } + + + /** + * 城市三字码 + *

示例值:PEK + * + * @param code + * @return + */ + public Builder code(String code) { + this.code = code; + return this; + } + + + /** + * 状态 + *

示例值:1 + * + * @param status + * @return + */ + public Builder status(Integer status) { + this.status = status; + return this; + } + + /** + * 状态 + *

示例值:1 + * + * @param status {@link com.lark.oapi.service.corehr.v2.enums.CityBasicDataObjStatusEnum} + * @return + */ + public Builder status(com.lark.oapi.service.corehr.v2.enums.CityBasicDataObjStatusEnum status) { + this.status = status.getValue(); + return this; + } + + + public City build() { + return new City(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Company.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Company.java new file mode 100644 index 000000000..842f1960a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Company.java @@ -0,0 +1,666 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Company { + /** + * 公司 ID + *

示例值:4692472714243080020 + */ + @SerializedName("company_id") + private String companyId; + /** + * 公司基本信息 + *

示例值: + */ + @SerializedName("hiberarchy_common") + private HiberarchyCommon hiberarchyCommon; + /** + * 性质 + *

示例值: + */ + @SerializedName("type") + private Enum type; + /** + * 行业 + *

示例值: + */ + @SerializedName("industry_list") + private Enum[] industryList; + /** + * 法定代表人 + *

示例值: + */ + @SerializedName("legal_representative") + private I18n[] legalRepresentative; + /** + * 邮编 + *

示例值:邮编 + */ + @SerializedName("post_code") + private String postCode; + /** + * 纳税人识别号 + *

示例值:123456840 + */ + @SerializedName("tax_payer_id") + private String taxPayerId; + /** + * confidential + *

示例值:true + */ + @SerializedName("confidential") + private Boolean confidential; + /** + * 主体类型 + *

示例值: + */ + @SerializedName("sub_type_list") + private Enum[] subTypeList; + /** + * 是否为分公司 + *

示例值:true + */ + @SerializedName("branch_company") + private Boolean branchCompany; + /** + * 主要负责人 + *

示例值: + */ + @SerializedName("primary_manager") + private I18n[] primaryManager; + /** + * 默认币种 + *

示例值: + */ + @SerializedName("currency") + private Currency currency; + /** + * 电话 + *

示例值: + */ + @SerializedName("phone") + private PhoneNumberAndAreaCode phone; + /** + * 传真 + *

示例值: + */ + @SerializedName("fax") + private PhoneNumberAndAreaCode fax; + /** + * 注册地址 + *

示例值: + */ + @SerializedName("registered_office_address") + private I18n[] registeredOfficeAddress; + /** + * 办公地址 + *

示例值: + */ + @SerializedName("office_address") + private I18n[] officeAddress; + /** + * 自定义字段 + *

示例值: + */ + @SerializedName("custom_fields") + private CustomFieldData[] customFields; + + // builder 开始 + public Company() { + } + + public Company(Builder builder) { + /** + * 公司 ID + *

示例值:4692472714243080020 + */ + this.companyId = builder.companyId; + /** + * 公司基本信息 + *

示例值: + */ + this.hiberarchyCommon = builder.hiberarchyCommon; + /** + * 性质 + *

示例值: + */ + this.type = builder.type; + /** + * 行业 + *

示例值: + */ + this.industryList = builder.industryList; + /** + * 法定代表人 + *

示例值: + */ + this.legalRepresentative = builder.legalRepresentative; + /** + * 邮编 + *

示例值:邮编 + */ + this.postCode = builder.postCode; + /** + * 纳税人识别号 + *

示例值:123456840 + */ + this.taxPayerId = builder.taxPayerId; + /** + * confidential + *

示例值:true + */ + this.confidential = builder.confidential; + /** + * 主体类型 + *

示例值: + */ + this.subTypeList = builder.subTypeList; + /** + * 是否为分公司 + *

示例值:true + */ + this.branchCompany = builder.branchCompany; + /** + * 主要负责人 + *

示例值: + */ + this.primaryManager = builder.primaryManager; + /** + * 默认币种 + *

示例值: + */ + this.currency = builder.currency; + /** + * 电话 + *

示例值: + */ + this.phone = builder.phone; + /** + * 传真 + *

示例值: + */ + this.fax = builder.fax; + /** + * 注册地址 + *

示例值: + */ + this.registeredOfficeAddress = builder.registeredOfficeAddress; + /** + * 办公地址 + *

示例值: + */ + this.officeAddress = builder.officeAddress; + /** + * 自定义字段 + *

示例值: + */ + this.customFields = builder.customFields; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getCompanyId() { + return this.companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + public HiberarchyCommon getHiberarchyCommon() { + return this.hiberarchyCommon; + } + + public void setHiberarchyCommon(HiberarchyCommon hiberarchyCommon) { + this.hiberarchyCommon = hiberarchyCommon; + } + + public Enum getType() { + return this.type; + } + + public void setType(Enum type) { + this.type = type; + } + + public Enum[] getIndustryList() { + return this.industryList; + } + + public void setIndustryList(Enum[] industryList) { + this.industryList = industryList; + } + + public I18n[] getLegalRepresentative() { + return this.legalRepresentative; + } + + public void setLegalRepresentative(I18n[] legalRepresentative) { + this.legalRepresentative = legalRepresentative; + } + + public String getPostCode() { + return this.postCode; + } + + public void setPostCode(String postCode) { + this.postCode = postCode; + } + + public String getTaxPayerId() { + return this.taxPayerId; + } + + public void setTaxPayerId(String taxPayerId) { + this.taxPayerId = taxPayerId; + } + + public Boolean getConfidential() { + return this.confidential; + } + + public void setConfidential(Boolean confidential) { + this.confidential = confidential; + } + + public Enum[] getSubTypeList() { + return this.subTypeList; + } + + public void setSubTypeList(Enum[] subTypeList) { + this.subTypeList = subTypeList; + } + + public Boolean getBranchCompany() { + return this.branchCompany; + } + + public void setBranchCompany(Boolean branchCompany) { + this.branchCompany = branchCompany; + } + + public I18n[] getPrimaryManager() { + return this.primaryManager; + } + + public void setPrimaryManager(I18n[] primaryManager) { + this.primaryManager = primaryManager; + } + + public Currency getCurrency() { + return this.currency; + } + + public void setCurrency(Currency currency) { + this.currency = currency; + } + + public PhoneNumberAndAreaCode getPhone() { + return this.phone; + } + + public void setPhone(PhoneNumberAndAreaCode phone) { + this.phone = phone; + } + + public PhoneNumberAndAreaCode getFax() { + return this.fax; + } + + public void setFax(PhoneNumberAndAreaCode fax) { + this.fax = fax; + } + + public I18n[] getRegisteredOfficeAddress() { + return this.registeredOfficeAddress; + } + + public void setRegisteredOfficeAddress(I18n[] registeredOfficeAddress) { + this.registeredOfficeAddress = registeredOfficeAddress; + } + + public I18n[] getOfficeAddress() { + return this.officeAddress; + } + + public void setOfficeAddress(I18n[] officeAddress) { + this.officeAddress = officeAddress; + } + + public CustomFieldData[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(CustomFieldData[] customFields) { + this.customFields = customFields; + } + + public static class Builder { + /** + * 公司 ID + *

示例值:4692472714243080020 + */ + private String companyId; + /** + * 公司基本信息 + *

示例值: + */ + private HiberarchyCommon hiberarchyCommon; + /** + * 性质 + *

示例值: + */ + private Enum type; + /** + * 行业 + *

示例值: + */ + private Enum[] industryList; + /** + * 法定代表人 + *

示例值: + */ + private I18n[] legalRepresentative; + /** + * 邮编 + *

示例值:邮编 + */ + private String postCode; + /** + * 纳税人识别号 + *

示例值:123456840 + */ + private String taxPayerId; + /** + * confidential + *

示例值:true + */ + private Boolean confidential; + /** + * 主体类型 + *

示例值: + */ + private Enum[] subTypeList; + /** + * 是否为分公司 + *

示例值:true + */ + private Boolean branchCompany; + /** + * 主要负责人 + *

示例值: + */ + private I18n[] primaryManager; + /** + * 默认币种 + *

示例值: + */ + private Currency currency; + /** + * 电话 + *

示例值: + */ + private PhoneNumberAndAreaCode phone; + /** + * 传真 + *

示例值: + */ + private PhoneNumberAndAreaCode fax; + /** + * 注册地址 + *

示例值: + */ + private I18n[] registeredOfficeAddress; + /** + * 办公地址 + *

示例值: + */ + private I18n[] officeAddress; + /** + * 自定义字段 + *

示例值: + */ + private CustomFieldData[] customFields; + + /** + * 公司 ID + *

示例值:4692472714243080020 + * + * @param companyId + * @return + */ + public Builder companyId(String companyId) { + this.companyId = companyId; + return this; + } + + + /** + * 公司基本信息 + *

示例值: + * + * @param hiberarchyCommon + * @return + */ + public Builder hiberarchyCommon(HiberarchyCommon hiberarchyCommon) { + this.hiberarchyCommon = hiberarchyCommon; + return this; + } + + + /** + * 性质 + *

示例值: + * + * @param type + * @return + */ + public Builder type(Enum type) { + this.type = type; + return this; + } + + + /** + * 行业 + *

示例值: + * + * @param industryList + * @return + */ + public Builder industryList(Enum[] industryList) { + this.industryList = industryList; + return this; + } + + + /** + * 法定代表人 + *

示例值: + * + * @param legalRepresentative + * @return + */ + public Builder legalRepresentative(I18n[] legalRepresentative) { + this.legalRepresentative = legalRepresentative; + return this; + } + + + /** + * 邮编 + *

示例值:邮编 + * + * @param postCode + * @return + */ + public Builder postCode(String postCode) { + this.postCode = postCode; + return this; + } + + + /** + * 纳税人识别号 + *

示例值:123456840 + * + * @param taxPayerId + * @return + */ + public Builder taxPayerId(String taxPayerId) { + this.taxPayerId = taxPayerId; + return this; + } + + + /** + * confidential + *

示例值:true + * + * @param confidential + * @return + */ + public Builder confidential(Boolean confidential) { + this.confidential = confidential; + return this; + } + + + /** + * 主体类型 + *

示例值: + * + * @param subTypeList + * @return + */ + public Builder subTypeList(Enum[] subTypeList) { + this.subTypeList = subTypeList; + return this; + } + + + /** + * 是否为分公司 + *

示例值:true + * + * @param branchCompany + * @return + */ + public Builder branchCompany(Boolean branchCompany) { + this.branchCompany = branchCompany; + return this; + } + + + /** + * 主要负责人 + *

示例值: + * + * @param primaryManager + * @return + */ + public Builder primaryManager(I18n[] primaryManager) { + this.primaryManager = primaryManager; + return this; + } + + + /** + * 默认币种 + *

示例值: + * + * @param currency + * @return + */ + public Builder currency(Currency currency) { + this.currency = currency; + return this; + } + + + /** + * 电话 + *

示例值: + * + * @param phone + * @return + */ + public Builder phone(PhoneNumberAndAreaCode phone) { + this.phone = phone; + return this; + } + + + /** + * 传真 + *

示例值: + * + * @param fax + * @return + */ + public Builder fax(PhoneNumberAndAreaCode fax) { + this.fax = fax; + return this; + } + + + /** + * 注册地址 + *

示例值: + * + * @param registeredOfficeAddress + * @return + */ + public Builder registeredOfficeAddress(I18n[] registeredOfficeAddress) { + this.registeredOfficeAddress = registeredOfficeAddress; + return this; + } + + + /** + * 办公地址 + *

示例值: + * + * @param officeAddress + * @return + */ + public Builder officeAddress(I18n[] officeAddress) { + this.officeAddress = officeAddress; + return this; + } + + + /** + * 自定义字段 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(CustomFieldData[] customFields) { + this.customFields = customFields; + return this; + } + + + public Company build() { + return new Company(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CompanyIdAndName.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CompanyIdAndName.java new file mode 100644 index 000000000..24cfe9caa --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CompanyIdAndName.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class CompanyIdAndName { + /** + * 所属公司的 ID + *

示例值:sadasdasda + */ + @SerializedName("company_id") + private String companyId; + /** + * 所属公司的名称 + *

示例值: + */ + @SerializedName("company_name") + private I18n[] companyName; + + // builder 开始 + public CompanyIdAndName() { + } + + public CompanyIdAndName(Builder builder) { + /** + * 所属公司的 ID + *

示例值:sadasdasda + */ + this.companyId = builder.companyId; + /** + * 所属公司的名称 + *

示例值: + */ + this.companyName = builder.companyName; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getCompanyId() { + return this.companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + public I18n[] getCompanyName() { + return this.companyName; + } + + public void setCompanyName(I18n[] companyName) { + this.companyName = companyName; + } + + public static class Builder { + /** + * 所属公司的 ID + *

示例值:sadasdasda + */ + private String companyId; + /** + * 所属公司的名称 + *

示例值: + */ + private I18n[] companyName; + + /** + * 所属公司的 ID + *

示例值:sadasdasda + * + * @param companyId + * @return + */ + public Builder companyId(String companyId) { + this.companyId = companyId; + return this; + } + + + /** + * 所属公司的名称 + *

示例值: + * + * @param companyName + * @return + */ + public Builder companyName(I18n[] companyName) { + this.companyName = companyName; + return this; + } + + + public CompanyIdAndName build() { + return new CompanyIdAndName(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Contract.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Contract.java new file mode 100644 index 000000000..f64ab99dc --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Contract.java @@ -0,0 +1,444 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Contract { + /** + * 合同ID + *

示例值:7147527056140813828 + */ + @SerializedName("id") + private String id; + /** + * 合同开始日期 + *

示例值:2023-01-01 00:00:00 + */ + @SerializedName("effective_time") + private String effectiveTime; + /** + * 合同结束日期 + *

示例值:2024-01-01 + */ + @SerializedName("contract_end_date") + private String contractEndDate; + /** + * 实际结束日期 + *

示例值:2023-11-01 00:00:00 + */ + @SerializedName("expiration_time") + private String expirationTime; + /** + * 雇佣 ID + *

示例值:6893014062142064135 + */ + @SerializedName("employment_id") + private String employmentId; + /** + * 合同类型,枚举值可通过文档【飞书人事枚举常量】合同类型(contract_type)枚举定义部分获得 + *

示例值: + */ + @SerializedName("contract_type") + private Enum contractType; + /** + * 合同主体, 引用Company的ID,枚举值及详细信息可通过【批量查询公司】接口查询获得 + *

示例值:7091599096804394540 + */ + @SerializedName("first_party_company_id") + private String firstPartyCompanyId; + /** + * Person ID,枚举值及详细信息可通过【批量查询个人信息】接口查询获得 + *

示例值:7088589447189022252 + */ + @SerializedName("person_id") + private String personId; + /** + * 期限类型,枚举值可通过文档【飞书人事枚举常量】合同期限类型(duration_type)枚举定义部分获得 + *

示例值: + */ + @SerializedName("duration_type") + private Enum durationType; + /** + * 合同编号 + *

示例值:0000011 + */ + @SerializedName("contract_number") + private String contractNumber; + /** + * 签订类型,枚举值可通过文档【飞书人事枚举常量】签订类型(signing_type)枚举定义部分获得 + *

示例值: + */ + @SerializedName("signing_type") + private Enum signingType; + + // builder 开始 + public Contract() { + } + + public Contract(Builder builder) { + /** + * 合同ID + *

示例值:7147527056140813828 + */ + this.id = builder.id; + /** + * 合同开始日期 + *

示例值:2023-01-01 00:00:00 + */ + this.effectiveTime = builder.effectiveTime; + /** + * 合同结束日期 + *

示例值:2024-01-01 + */ + this.contractEndDate = builder.contractEndDate; + /** + * 实际结束日期 + *

示例值:2023-11-01 00:00:00 + */ + this.expirationTime = builder.expirationTime; + /** + * 雇佣 ID + *

示例值:6893014062142064135 + */ + this.employmentId = builder.employmentId; + /** + * 合同类型,枚举值可通过文档【飞书人事枚举常量】合同类型(contract_type)枚举定义部分获得 + *

示例值: + */ + this.contractType = builder.contractType; + /** + * 合同主体, 引用Company的ID,枚举值及详细信息可通过【批量查询公司】接口查询获得 + *

示例值:7091599096804394540 + */ + this.firstPartyCompanyId = builder.firstPartyCompanyId; + /** + * Person ID,枚举值及详细信息可通过【批量查询个人信息】接口查询获得 + *

示例值:7088589447189022252 + */ + this.personId = builder.personId; + /** + * 期限类型,枚举值可通过文档【飞书人事枚举常量】合同期限类型(duration_type)枚举定义部分获得 + *

示例值: + */ + this.durationType = builder.durationType; + /** + * 合同编号 + *

示例值:0000011 + */ + this.contractNumber = builder.contractNumber; + /** + * 签订类型,枚举值可通过文档【飞书人事枚举常量】签订类型(signing_type)枚举定义部分获得 + *

示例值: + */ + this.signingType = builder.signingType; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public String getEffectiveTime() { + return this.effectiveTime; + } + + public void setEffectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + } + + public String getContractEndDate() { + return this.contractEndDate; + } + + public void setContractEndDate(String contractEndDate) { + this.contractEndDate = contractEndDate; + } + + public String getExpirationTime() { + return this.expirationTime; + } + + public void setExpirationTime(String expirationTime) { + this.expirationTime = expirationTime; + } + + public String getEmploymentId() { + return this.employmentId; + } + + public void setEmploymentId(String employmentId) { + this.employmentId = employmentId; + } + + public Enum getContractType() { + return this.contractType; + } + + public void setContractType(Enum contractType) { + this.contractType = contractType; + } + + public String getFirstPartyCompanyId() { + return this.firstPartyCompanyId; + } + + public void setFirstPartyCompanyId(String firstPartyCompanyId) { + this.firstPartyCompanyId = firstPartyCompanyId; + } + + public String getPersonId() { + return this.personId; + } + + public void setPersonId(String personId) { + this.personId = personId; + } + + public Enum getDurationType() { + return this.durationType; + } + + public void setDurationType(Enum durationType) { + this.durationType = durationType; + } + + public String getContractNumber() { + return this.contractNumber; + } + + public void setContractNumber(String contractNumber) { + this.contractNumber = contractNumber; + } + + public Enum getSigningType() { + return this.signingType; + } + + public void setSigningType(Enum signingType) { + this.signingType = signingType; + } + + public static class Builder { + /** + * 合同ID + *

示例值:7147527056140813828 + */ + private String id; + /** + * 合同开始日期 + *

示例值:2023-01-01 00:00:00 + */ + private String effectiveTime; + /** + * 合同结束日期 + *

示例值:2024-01-01 + */ + private String contractEndDate; + /** + * 实际结束日期 + *

示例值:2023-11-01 00:00:00 + */ + private String expirationTime; + /** + * 雇佣 ID + *

示例值:6893014062142064135 + */ + private String employmentId; + /** + * 合同类型,枚举值可通过文档【飞书人事枚举常量】合同类型(contract_type)枚举定义部分获得 + *

示例值: + */ + private Enum contractType; + /** + * 合同主体, 引用Company的ID,枚举值及详细信息可通过【批量查询公司】接口查询获得 + *

示例值:7091599096804394540 + */ + private String firstPartyCompanyId; + /** + * Person ID,枚举值及详细信息可通过【批量查询个人信息】接口查询获得 + *

示例值:7088589447189022252 + */ + private String personId; + /** + * 期限类型,枚举值可通过文档【飞书人事枚举常量】合同期限类型(duration_type)枚举定义部分获得 + *

示例值: + */ + private Enum durationType; + /** + * 合同编号 + *

示例值:0000011 + */ + private String contractNumber; + /** + * 签订类型,枚举值可通过文档【飞书人事枚举常量】签订类型(signing_type)枚举定义部分获得 + *

示例值: + */ + private Enum signingType; + + /** + * 合同ID + *

示例值:7147527056140813828 + * + * @param id + * @return + */ + public Builder id(String id) { + this.id = id; + return this; + } + + + /** + * 合同开始日期 + *

示例值:2023-01-01 00:00:00 + * + * @param effectiveTime + * @return + */ + public Builder effectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + return this; + } + + + /** + * 合同结束日期 + *

示例值:2024-01-01 + * + * @param contractEndDate + * @return + */ + public Builder contractEndDate(String contractEndDate) { + this.contractEndDate = contractEndDate; + return this; + } + + + /** + * 实际结束日期 + *

示例值:2023-11-01 00:00:00 + * + * @param expirationTime + * @return + */ + public Builder expirationTime(String expirationTime) { + this.expirationTime = expirationTime; + return this; + } + + + /** + * 雇佣 ID + *

示例值:6893014062142064135 + * + * @param employmentId + * @return + */ + public Builder employmentId(String employmentId) { + this.employmentId = employmentId; + return this; + } + + + /** + * 合同类型,枚举值可通过文档【飞书人事枚举常量】合同类型(contract_type)枚举定义部分获得 + *

示例值: + * + * @param contractType + * @return + */ + public Builder contractType(Enum contractType) { + this.contractType = contractType; + return this; + } + + + /** + * 合同主体, 引用Company的ID,枚举值及详细信息可通过【批量查询公司】接口查询获得 + *

示例值:7091599096804394540 + * + * @param firstPartyCompanyId + * @return + */ + public Builder firstPartyCompanyId(String firstPartyCompanyId) { + this.firstPartyCompanyId = firstPartyCompanyId; + return this; + } + + + /** + * Person ID,枚举值及详细信息可通过【批量查询个人信息】接口查询获得 + *

示例值:7088589447189022252 + * + * @param personId + * @return + */ + public Builder personId(String personId) { + this.personId = personId; + return this; + } + + + /** + * 期限类型,枚举值可通过文档【飞书人事枚举常量】合同期限类型(duration_type)枚举定义部分获得 + *

示例值: + * + * @param durationType + * @return + */ + public Builder durationType(Enum durationType) { + this.durationType = durationType; + return this; + } + + + /** + * 合同编号 + *

示例值:0000011 + * + * @param contractNumber + * @return + */ + public Builder contractNumber(String contractNumber) { + this.contractNumber = contractNumber; + return this; + } + + + /** + * 签订类型,枚举值可通过文档【飞书人事枚举常量】签订类型(signing_type)枚举定义部分获得 + *

示例值: + * + * @param signingType + * @return + */ + public Builder signingType(Enum signingType) { + this.signingType = signingType; + return this; + } + + + public Contract build() { + return new Contract(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CostCenter.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CostCenter.java new file mode 100644 index 000000000..0abc46982 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CostCenter.java @@ -0,0 +1,407 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class CostCenter { + /** + * 成本中心ID + *

示例值:6969828847121885087 + */ + @SerializedName("cost_center_id") + private String costCenterId; + /** + * 成本中心名称 + *

示例值: + */ + @SerializedName("name") + private I18n[] name; + /** + * 编码 + *

示例值:MDPD00000023 + */ + @SerializedName("code") + private String code; + /** + * 上级成本中心ID + *

示例值:6862995757234914824 + */ + @SerializedName("parent_cost_center_id") + private String parentCostCenterId; + /** + * 成本中心负责人ID 列表,可通过雇佣信息接口查询获得 + *

示例值: + */ + @SerializedName("managers") + private String[] managers; + /** + * 成本中心描述 + *

示例值: + */ + @SerializedName("description") + private I18n[] description; + /** + * 生效时间 + *

示例值:2020-01-01 + */ + @SerializedName("effective_time") + private String effectiveTime; + /** + * 过期时间 + *

示例值:2020-01-01 + */ + @SerializedName("expiration_time") + private String expirationTime; + /** + * 当前实体是否启用 + *

示例值:2020-01-01 + */ + @SerializedName("active") + private Boolean active; + /** + * 操作原因 + *

示例值:过期作废 + */ + @SerializedName("operation_reason") + private String operationReason; + + // builder 开始 + public CostCenter() { + } + + public CostCenter(Builder builder) { + /** + * 成本中心ID + *

示例值:6969828847121885087 + */ + this.costCenterId = builder.costCenterId; + /** + * 成本中心名称 + *

示例值: + */ + this.name = builder.name; + /** + * 编码 + *

示例值:MDPD00000023 + */ + this.code = builder.code; + /** + * 上级成本中心ID + *

示例值:6862995757234914824 + */ + this.parentCostCenterId = builder.parentCostCenterId; + /** + * 成本中心负责人ID 列表,可通过雇佣信息接口查询获得 + *

示例值: + */ + this.managers = builder.managers; + /** + * 成本中心描述 + *

示例值: + */ + this.description = builder.description; + /** + * 生效时间 + *

示例值:2020-01-01 + */ + this.effectiveTime = builder.effectiveTime; + /** + * 过期时间 + *

示例值:2020-01-01 + */ + this.expirationTime = builder.expirationTime; + /** + * 当前实体是否启用 + *

示例值:2020-01-01 + */ + this.active = builder.active; + /** + * 操作原因 + *

示例值:过期作废 + */ + this.operationReason = builder.operationReason; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getCostCenterId() { + return this.costCenterId; + } + + public void setCostCenterId(String costCenterId) { + this.costCenterId = costCenterId; + } + + public I18n[] getName() { + return this.name; + } + + public void setName(I18n[] name) { + this.name = name; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getParentCostCenterId() { + return this.parentCostCenterId; + } + + public void setParentCostCenterId(String parentCostCenterId) { + this.parentCostCenterId = parentCostCenterId; + } + + public String[] getManagers() { + return this.managers; + } + + public void setManagers(String[] managers) { + this.managers = managers; + } + + public I18n[] getDescription() { + return this.description; + } + + public void setDescription(I18n[] description) { + this.description = description; + } + + public String getEffectiveTime() { + return this.effectiveTime; + } + + public void setEffectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + } + + public String getExpirationTime() { + return this.expirationTime; + } + + public void setExpirationTime(String expirationTime) { + this.expirationTime = expirationTime; + } + + public Boolean getActive() { + return this.active; + } + + public void setActive(Boolean active) { + this.active = active; + } + + public String getOperationReason() { + return this.operationReason; + } + + public void setOperationReason(String operationReason) { + this.operationReason = operationReason; + } + + public static class Builder { + /** + * 成本中心ID + *

示例值:6969828847121885087 + */ + private String costCenterId; + /** + * 成本中心名称 + *

示例值: + */ + private I18n[] name; + /** + * 编码 + *

示例值:MDPD00000023 + */ + private String code; + /** + * 上级成本中心ID + *

示例值:6862995757234914824 + */ + private String parentCostCenterId; + /** + * 成本中心负责人ID 列表,可通过雇佣信息接口查询获得 + *

示例值: + */ + private String[] managers; + /** + * 成本中心描述 + *

示例值: + */ + private I18n[] description; + /** + * 生效时间 + *

示例值:2020-01-01 + */ + private String effectiveTime; + /** + * 过期时间 + *

示例值:2020-01-01 + */ + private String expirationTime; + /** + * 当前实体是否启用 + *

示例值:2020-01-01 + */ + private Boolean active; + /** + * 操作原因 + *

示例值:过期作废 + */ + private String operationReason; + + /** + * 成本中心ID + *

示例值:6969828847121885087 + * + * @param costCenterId + * @return + */ + public Builder costCenterId(String costCenterId) { + this.costCenterId = costCenterId; + return this; + } + + + /** + * 成本中心名称 + *

示例值: + * + * @param name + * @return + */ + public Builder name(I18n[] name) { + this.name = name; + return this; + } + + + /** + * 编码 + *

示例值:MDPD00000023 + * + * @param code + * @return + */ + public Builder code(String code) { + this.code = code; + return this; + } + + + /** + * 上级成本中心ID + *

示例值:6862995757234914824 + * + * @param parentCostCenterId + * @return + */ + public Builder parentCostCenterId(String parentCostCenterId) { + this.parentCostCenterId = parentCostCenterId; + return this; + } + + + /** + * 成本中心负责人ID 列表,可通过雇佣信息接口查询获得 + *

示例值: + * + * @param managers + * @return + */ + public Builder managers(String[] managers) { + this.managers = managers; + return this; + } + + + /** + * 成本中心描述 + *

示例值: + * + * @param description + * @return + */ + public Builder description(I18n[] description) { + this.description = description; + return this; + } + + + /** + * 生效时间 + *

示例值:2020-01-01 + * + * @param effectiveTime + * @return + */ + public Builder effectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + return this; + } + + + /** + * 过期时间 + *

示例值:2020-01-01 + * + * @param expirationTime + * @return + */ + public Builder expirationTime(String expirationTime) { + this.expirationTime = expirationTime; + return this; + } + + + /** + * 当前实体是否启用 + *

示例值:2020-01-01 + * + * @param active + * @return + */ + public Builder active(Boolean active) { + this.active = active; + return this; + } + + + /** + * 操作原因 + *

示例值:过期作废 + * + * @param operationReason + * @return + */ + public Builder operationReason(String operationReason) { + this.operationReason = operationReason; + return this; + } + + + public CostCenter build() { + return new CostCenter(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CostCenterVersion.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CostCenterVersion.java new file mode 100644 index 000000000..932b156e4 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CostCenterVersion.java @@ -0,0 +1,444 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class CostCenterVersion { + /** + * 成本中心ID + *

示例值:6969828847121885087 + */ + @SerializedName("cost_center_id") + private String costCenterId; + /** + * 成本中心版本ID + *

示例值:6969828847121885087 + */ + @SerializedName("version_id") + private String versionId; + /** + * 成本中心名称 + *

示例值: + */ + @SerializedName("name") + private I18n[] name; + /** + * 编码 + *

示例值:MDPD00000023 + */ + @SerializedName("code") + private String code; + /** + * 上级成本中心ID + *

示例值:6862995757234914824 + */ + @SerializedName("parent_cost_center_id") + private String parentCostCenterId; + /** + * 成本中心负责人ID 列表,可通过雇佣信息接口查询获得 + *

示例值: + */ + @SerializedName("managers") + private String[] managers; + /** + * 成本中心描述 + *

示例值: + */ + @SerializedName("description") + private I18n[] description; + /** + * 生效时间 + *

示例值:2020-01-01 + */ + @SerializedName("effective_time") + private String effectiveTime; + /** + * 过期时间 + *

示例值:2020-01-01 + */ + @SerializedName("expiration_time") + private String expirationTime; + /** + * 当前实体是否启用 + *

示例值:2020-01-01 + */ + @SerializedName("active") + private Boolean active; + /** + * 操作原因 + *

示例值:过期作废 + */ + @SerializedName("operation_reason") + private String operationReason; + + // builder 开始 + public CostCenterVersion() { + } + + public CostCenterVersion(Builder builder) { + /** + * 成本中心ID + *

示例值:6969828847121885087 + */ + this.costCenterId = builder.costCenterId; + /** + * 成本中心版本ID + *

示例值:6969828847121885087 + */ + this.versionId = builder.versionId; + /** + * 成本中心名称 + *

示例值: + */ + this.name = builder.name; + /** + * 编码 + *

示例值:MDPD00000023 + */ + this.code = builder.code; + /** + * 上级成本中心ID + *

示例值:6862995757234914824 + */ + this.parentCostCenterId = builder.parentCostCenterId; + /** + * 成本中心负责人ID 列表,可通过雇佣信息接口查询获得 + *

示例值: + */ + this.managers = builder.managers; + /** + * 成本中心描述 + *

示例值: + */ + this.description = builder.description; + /** + * 生效时间 + *

示例值:2020-01-01 + */ + this.effectiveTime = builder.effectiveTime; + /** + * 过期时间 + *

示例值:2020-01-01 + */ + this.expirationTime = builder.expirationTime; + /** + * 当前实体是否启用 + *

示例值:2020-01-01 + */ + this.active = builder.active; + /** + * 操作原因 + *

示例值:过期作废 + */ + this.operationReason = builder.operationReason; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getCostCenterId() { + return this.costCenterId; + } + + public void setCostCenterId(String costCenterId) { + this.costCenterId = costCenterId; + } + + public String getVersionId() { + return this.versionId; + } + + public void setVersionId(String versionId) { + this.versionId = versionId; + } + + public I18n[] getName() { + return this.name; + } + + public void setName(I18n[] name) { + this.name = name; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getParentCostCenterId() { + return this.parentCostCenterId; + } + + public void setParentCostCenterId(String parentCostCenterId) { + this.parentCostCenterId = parentCostCenterId; + } + + public String[] getManagers() { + return this.managers; + } + + public void setManagers(String[] managers) { + this.managers = managers; + } + + public I18n[] getDescription() { + return this.description; + } + + public void setDescription(I18n[] description) { + this.description = description; + } + + public String getEffectiveTime() { + return this.effectiveTime; + } + + public void setEffectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + } + + public String getExpirationTime() { + return this.expirationTime; + } + + public void setExpirationTime(String expirationTime) { + this.expirationTime = expirationTime; + } + + public Boolean getActive() { + return this.active; + } + + public void setActive(Boolean active) { + this.active = active; + } + + public String getOperationReason() { + return this.operationReason; + } + + public void setOperationReason(String operationReason) { + this.operationReason = operationReason; + } + + public static class Builder { + /** + * 成本中心ID + *

示例值:6969828847121885087 + */ + private String costCenterId; + /** + * 成本中心版本ID + *

示例值:6969828847121885087 + */ + private String versionId; + /** + * 成本中心名称 + *

示例值: + */ + private I18n[] name; + /** + * 编码 + *

示例值:MDPD00000023 + */ + private String code; + /** + * 上级成本中心ID + *

示例值:6862995757234914824 + */ + private String parentCostCenterId; + /** + * 成本中心负责人ID 列表,可通过雇佣信息接口查询获得 + *

示例值: + */ + private String[] managers; + /** + * 成本中心描述 + *

示例值: + */ + private I18n[] description; + /** + * 生效时间 + *

示例值:2020-01-01 + */ + private String effectiveTime; + /** + * 过期时间 + *

示例值:2020-01-01 + */ + private String expirationTime; + /** + * 当前实体是否启用 + *

示例值:2020-01-01 + */ + private Boolean active; + /** + * 操作原因 + *

示例值:过期作废 + */ + private String operationReason; + + /** + * 成本中心ID + *

示例值:6969828847121885087 + * + * @param costCenterId + * @return + */ + public Builder costCenterId(String costCenterId) { + this.costCenterId = costCenterId; + return this; + } + + + /** + * 成本中心版本ID + *

示例值:6969828847121885087 + * + * @param versionId + * @return + */ + public Builder versionId(String versionId) { + this.versionId = versionId; + return this; + } + + + /** + * 成本中心名称 + *

示例值: + * + * @param name + * @return + */ + public Builder name(I18n[] name) { + this.name = name; + return this; + } + + + /** + * 编码 + *

示例值:MDPD00000023 + * + * @param code + * @return + */ + public Builder code(String code) { + this.code = code; + return this; + } + + + /** + * 上级成本中心ID + *

示例值:6862995757234914824 + * + * @param parentCostCenterId + * @return + */ + public Builder parentCostCenterId(String parentCostCenterId) { + this.parentCostCenterId = parentCostCenterId; + return this; + } + + + /** + * 成本中心负责人ID 列表,可通过雇佣信息接口查询获得 + *

示例值: + * + * @param managers + * @return + */ + public Builder managers(String[] managers) { + this.managers = managers; + return this; + } + + + /** + * 成本中心描述 + *

示例值: + * + * @param description + * @return + */ + public Builder description(I18n[] description) { + this.description = description; + return this; + } + + + /** + * 生效时间 + *

示例值:2020-01-01 + * + * @param effectiveTime + * @return + */ + public Builder effectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + return this; + } + + + /** + * 过期时间 + *

示例值:2020-01-01 + * + * @param expirationTime + * @return + */ + public Builder expirationTime(String expirationTime) { + this.expirationTime = expirationTime; + return this; + } + + + /** + * 当前实体是否启用 + *

示例值:2020-01-01 + * + * @param active + * @return + */ + public Builder active(Boolean active) { + this.active = active; + return this; + } + + + /** + * 操作原因 + *

示例值:过期作废 + * + * @param operationReason + * @return + */ + public Builder operationReason(String operationReason) { + this.operationReason = operationReason; + return this; + } + + + public CostCenterVersion build() { + return new CostCenterVersion(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CountryRegion.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CountryRegion.java new file mode 100644 index 000000000..3953c0a88 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CountryRegion.java @@ -0,0 +1,308 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class CountryRegion { + /** + * 国家/地区 ID + *

示例值:6893114062122064111 + */ + @SerializedName("country_region_id") + private String countryRegionId; + /** + * 国家/地区名称 + *

示例值: + */ + @SerializedName("name") + private I18n[] name; + /** + * 国家/地区全称 + *

示例值: + */ + @SerializedName("full_name") + private I18n[] fullName; + /** + * 国家地区二字码 + *

示例值:CN + */ + @SerializedName("alpha_2_code") + private String alpha2Code; + /** + * 国家地区三字码 + *

示例值:CHN + */ + @SerializedName("alpha_3_code") + private String alpha3Code; + /** + * 国际电话区号 + *

示例值:+86 + */ + @SerializedName("global_code") + private String globalCode; + /** + * 状态 + *

示例值:1 + */ + @SerializedName("status") + private Integer status; + + // builder 开始 + public CountryRegion() { + } + + public CountryRegion(Builder builder) { + /** + * 国家/地区 ID + *

示例值:6893114062122064111 + */ + this.countryRegionId = builder.countryRegionId; + /** + * 国家/地区名称 + *

示例值: + */ + this.name = builder.name; + /** + * 国家/地区全称 + *

示例值: + */ + this.fullName = builder.fullName; + /** + * 国家地区二字码 + *

示例值:CN + */ + this.alpha2Code = builder.alpha2Code; + /** + * 国家地区三字码 + *

示例值:CHN + */ + this.alpha3Code = builder.alpha3Code; + /** + * 国际电话区号 + *

示例值:+86 + */ + this.globalCode = builder.globalCode; + /** + * 状态 + *

示例值:1 + */ + this.status = builder.status; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getCountryRegionId() { + return this.countryRegionId; + } + + public void setCountryRegionId(String countryRegionId) { + this.countryRegionId = countryRegionId; + } + + public I18n[] getName() { + return this.name; + } + + public void setName(I18n[] name) { + this.name = name; + } + + public I18n[] getFullName() { + return this.fullName; + } + + public void setFullName(I18n[] fullName) { + this.fullName = fullName; + } + + public String getAlpha2Code() { + return this.alpha2Code; + } + + public void setAlpha2Code(String alpha2Code) { + this.alpha2Code = alpha2Code; + } + + public String getAlpha3Code() { + return this.alpha3Code; + } + + public void setAlpha3Code(String alpha3Code) { + this.alpha3Code = alpha3Code; + } + + public String getGlobalCode() { + return this.globalCode; + } + + public void setGlobalCode(String globalCode) { + this.globalCode = globalCode; + } + + public Integer getStatus() { + return this.status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public static class Builder { + /** + * 国家/地区 ID + *

示例值:6893114062122064111 + */ + private String countryRegionId; + /** + * 国家/地区名称 + *

示例值: + */ + private I18n[] name; + /** + * 国家/地区全称 + *

示例值: + */ + private I18n[] fullName; + /** + * 国家地区二字码 + *

示例值:CN + */ + private String alpha2Code; + /** + * 国家地区三字码 + *

示例值:CHN + */ + private String alpha3Code; + /** + * 国际电话区号 + *

示例值:+86 + */ + private String globalCode; + /** + * 状态 + *

示例值:1 + */ + private Integer status; + + /** + * 国家/地区 ID + *

示例值:6893114062122064111 + * + * @param countryRegionId + * @return + */ + public Builder countryRegionId(String countryRegionId) { + this.countryRegionId = countryRegionId; + return this; + } + + + /** + * 国家/地区名称 + *

示例值: + * + * @param name + * @return + */ + public Builder name(I18n[] name) { + this.name = name; + return this; + } + + + /** + * 国家/地区全称 + *

示例值: + * + * @param fullName + * @return + */ + public Builder fullName(I18n[] fullName) { + this.fullName = fullName; + return this; + } + + + /** + * 国家地区二字码 + *

示例值:CN + * + * @param alpha2Code + * @return + */ + public Builder alpha2Code(String alpha2Code) { + this.alpha2Code = alpha2Code; + return this; + } + + + /** + * 国家地区三字码 + *

示例值:CHN + * + * @param alpha3Code + * @return + */ + public Builder alpha3Code(String alpha3Code) { + this.alpha3Code = alpha3Code; + return this; + } + + + /** + * 国际电话区号 + *

示例值:+86 + * + * @param globalCode + * @return + */ + public Builder globalCode(String globalCode) { + this.globalCode = globalCode; + return this; + } + + + /** + * 状态 + *

示例值:1 + * + * @param status + * @return + */ + public Builder status(Integer status) { + this.status = status; + return this; + } + + /** + * 状态 + *

示例值:1 + * + * @param status {@link com.lark.oapi.service.corehr.v2.enums.CountryRegionBasicDataObjStatusEnum} + * @return + */ + public Builder status(com.lark.oapi.service.corehr.v2.enums.CountryRegionBasicDataObjStatusEnum status) { + this.status = status.getValue(); + return this; + } + + + public CountryRegion build() { + return new CountryRegion(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CountryRegionSubdivision.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CountryRegionSubdivision.java new file mode 100644 index 000000000..6b457c345 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CountryRegionSubdivision.java @@ -0,0 +1,271 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class CountryRegionSubdivision { + /** + * 省份/行政区 ID + *

示例值:6822114062122064111 + */ + @SerializedName("country_region_subdivision_id") + private String countryRegionSubdivisionId; + /** + * 省份/行政区名称 + *

示例值: + */ + @SerializedName("name") + private I18n[] name; + /** + * 所属国家/地区 ID,详细信息可通过【查询国家/地区信息】接口查询获得 + *

示例值:6822114062122062211 + */ + @SerializedName("country_region_id") + private String countryRegionId; + /** + * 行政区类型,枚举值可通过文档【飞书人事枚举常量】行政区类型(subdivision_type)枚举定义部分获得 + *

示例值: + */ + @SerializedName("subdivision_type") + private Enum subdivisionType; + /** + * 省份/行政区三字码 + *

示例值:PEK + */ + @SerializedName("iso_code") + private String isoCode; + /** + * 状态 + *

示例值:1 + */ + @SerializedName("status") + private Integer status; + + // builder 开始 + public CountryRegionSubdivision() { + } + + public CountryRegionSubdivision(Builder builder) { + /** + * 省份/行政区 ID + *

示例值:6822114062122064111 + */ + this.countryRegionSubdivisionId = builder.countryRegionSubdivisionId; + /** + * 省份/行政区名称 + *

示例值: + */ + this.name = builder.name; + /** + * 所属国家/地区 ID,详细信息可通过【查询国家/地区信息】接口查询获得 + *

示例值:6822114062122062211 + */ + this.countryRegionId = builder.countryRegionId; + /** + * 行政区类型,枚举值可通过文档【飞书人事枚举常量】行政区类型(subdivision_type)枚举定义部分获得 + *

示例值: + */ + this.subdivisionType = builder.subdivisionType; + /** + * 省份/行政区三字码 + *

示例值:PEK + */ + this.isoCode = builder.isoCode; + /** + * 状态 + *

示例值:1 + */ + this.status = builder.status; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getCountryRegionSubdivisionId() { + return this.countryRegionSubdivisionId; + } + + public void setCountryRegionSubdivisionId(String countryRegionSubdivisionId) { + this.countryRegionSubdivisionId = countryRegionSubdivisionId; + } + + public I18n[] getName() { + return this.name; + } + + public void setName(I18n[] name) { + this.name = name; + } + + public String getCountryRegionId() { + return this.countryRegionId; + } + + public void setCountryRegionId(String countryRegionId) { + this.countryRegionId = countryRegionId; + } + + public Enum getSubdivisionType() { + return this.subdivisionType; + } + + public void setSubdivisionType(Enum subdivisionType) { + this.subdivisionType = subdivisionType; + } + + public String getIsoCode() { + return this.isoCode; + } + + public void setIsoCode(String isoCode) { + this.isoCode = isoCode; + } + + public Integer getStatus() { + return this.status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public static class Builder { + /** + * 省份/行政区 ID + *

示例值:6822114062122064111 + */ + private String countryRegionSubdivisionId; + /** + * 省份/行政区名称 + *

示例值: + */ + private I18n[] name; + /** + * 所属国家/地区 ID,详细信息可通过【查询国家/地区信息】接口查询获得 + *

示例值:6822114062122062211 + */ + private String countryRegionId; + /** + * 行政区类型,枚举值可通过文档【飞书人事枚举常量】行政区类型(subdivision_type)枚举定义部分获得 + *

示例值: + */ + private Enum subdivisionType; + /** + * 省份/行政区三字码 + *

示例值:PEK + */ + private String isoCode; + /** + * 状态 + *

示例值:1 + */ + private Integer status; + + /** + * 省份/行政区 ID + *

示例值:6822114062122064111 + * + * @param countryRegionSubdivisionId + * @return + */ + public Builder countryRegionSubdivisionId(String countryRegionSubdivisionId) { + this.countryRegionSubdivisionId = countryRegionSubdivisionId; + return this; + } + + + /** + * 省份/行政区名称 + *

示例值: + * + * @param name + * @return + */ + public Builder name(I18n[] name) { + this.name = name; + return this; + } + + + /** + * 所属国家/地区 ID,详细信息可通过【查询国家/地区信息】接口查询获得 + *

示例值:6822114062122062211 + * + * @param countryRegionId + * @return + */ + public Builder countryRegionId(String countryRegionId) { + this.countryRegionId = countryRegionId; + return this; + } + + + /** + * 行政区类型,枚举值可通过文档【飞书人事枚举常量】行政区类型(subdivision_type)枚举定义部分获得 + *

示例值: + * + * @param subdivisionType + * @return + */ + public Builder subdivisionType(Enum subdivisionType) { + this.subdivisionType = subdivisionType; + return this; + } + + + /** + * 省份/行政区三字码 + *

示例值:PEK + * + * @param isoCode + * @return + */ + public Builder isoCode(String isoCode) { + this.isoCode = isoCode; + return this; + } + + + /** + * 状态 + *

示例值:1 + * + * @param status + * @return + */ + public Builder status(Integer status) { + this.status = status; + return this; + } + + /** + * 状态 + *

示例值:1 + * + * @param status {@link com.lark.oapi.service.corehr.v2.enums.CountryRegionSubdivisionBasicDataObjStatusEnum} + * @return + */ + public Builder status(com.lark.oapi.service.corehr.v2.enums.CountryRegionSubdivisionBasicDataObjStatusEnum status) { + this.status = status.getValue(); + return this; + } + + + public CountryRegionSubdivision build() { + return new CountryRegionSubdivision(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreatePersonReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreatePersonReq.java new file mode 100644 index 000000000..daa42d4fe --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreatePersonReq.java @@ -0,0 +1,99 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Query; + +public class CreatePersonReq { + /** + * 根据client_token是否一致来判断是否为同一请求 + *

示例值:12454646 + */ + @Query + @SerializedName("client_token") + private String clientToken; + @Body + private PersonInfo body; + + // builder 开始 + public CreatePersonReq() { + } + + public CreatePersonReq(Builder builder) { + /** + * 根据client_token是否一致来判断是否为同一请求 + *

示例值:12454646 + */ + this.clientToken = builder.clientToken; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getClientToken() { + return this.clientToken; + } + + public void setClientToken(String clientToken) { + this.clientToken = clientToken; + } + + public PersonInfo getPersonInfo() { + return this.body; + } + + public void setPersonInfo(PersonInfo body) { + this.body = body; + } + + public static class Builder { + private String clientToken; // 根据client_token是否一致来判断是否为同一请求 + private PersonInfo body; + + /** + * 根据client_token是否一致来判断是否为同一请求 + *

示例值:12454646 + * + * @param clientToken + * @return + */ + public Builder clientToken(String clientToken) { + this.clientToken = clientToken; + return this; + } + + public PersonInfo getPersonInfo() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder personInfo(PersonInfo body) { + this.body = body; + return this; + } + + public CreatePersonReq build() { + return new CreatePersonReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreatePersonResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreatePersonResp.java new file mode 100644 index 000000000..3ed83d470 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreatePersonResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class CreatePersonResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreatePersonRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreatePersonRespBody.java new file mode 100644 index 000000000..49148a95e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreatePersonRespBody.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class CreatePersonRespBody { + /** + *

示例值: + */ + @SerializedName("person") + private PersonInfo person; + + public PersonInfo getPerson() { + return this.person; + } + + public void setPerson(PersonInfo person) { + this.person = person; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreatePreHireReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreatePreHireReq.java new file mode 100644 index 000000000..ffa4af1bb --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreatePreHireReq.java @@ -0,0 +1,65 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.annotation.Body; + +public class CreatePreHireReq { + @Body + private PrehireCreate body; + + // builder 开始 + public CreatePreHireReq() { + } + + public CreatePreHireReq(Builder builder) { + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public PrehireCreate getPrehireCreate() { + return this.body; + } + + public void setPrehireCreate(PrehireCreate body) { + this.body = body; + } + + public static class Builder { + + private PrehireCreate body; + + public PrehireCreate getPrehireCreate() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder prehireCreate(PrehireCreate body) { + this.body = body; + return this; + } + + public CreatePreHireReq build() { + return new CreatePreHireReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreatePreHireResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreatePreHireResp.java new file mode 100644 index 000000000..ad3352a81 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreatePreHireResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class CreatePreHireResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreatePreHireRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreatePreHireRespBody.java new file mode 100644 index 000000000..7e94105fe --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreatePreHireRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class CreatePreHireRespBody { + /** + * 待入职 ID + *

示例值:6966234786251671053 + */ + @SerializedName("pre_hire_id") + private String preHireId; + + public String getPreHireId() { + return this.preHireId; + } + + public void setPreHireId(String preHireId) { + this.preHireId = preHireId; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreateProbationAssessmentReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreateProbationAssessmentReq.java new file mode 100644 index 000000000..64a0dd43b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreateProbationAssessmentReq.java @@ -0,0 +1,144 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Query; + +public class CreateProbationAssessmentReq { + /** + * 根据 client_token 是否一致来判断是否为同一请求 + *

示例值:6822122262122064111 + */ + @Query + @SerializedName("client_token") + private String clientToken; + /** + * 用户 ID 类型 + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + @Body + private CreateProbationAssessmentReqBody body; + + // builder 开始 + public CreateProbationAssessmentReq() { + } + + public CreateProbationAssessmentReq(Builder builder) { + /** + * 根据 client_token 是否一致来判断是否为同一请求 + *

示例值:6822122262122064111 + */ + this.clientToken = builder.clientToken; + /** + * 用户 ID 类型 + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getClientToken() { + return this.clientToken; + } + + public void setClientToken(String clientToken) { + this.clientToken = clientToken; + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public CreateProbationAssessmentReqBody getCreateProbationAssessmentReqBody() { + return this.body; + } + + public void setCreateProbationAssessmentReqBody(CreateProbationAssessmentReqBody body) { + this.body = body; + } + + public static class Builder { + private String clientToken; // 根据 client_token 是否一致来判断是否为同一请求 + private String userIdType; // 用户 ID 类型 + private CreateProbationAssessmentReqBody body; + + /** + * 根据 client_token 是否一致来判断是否为同一请求 + *

示例值:6822122262122064111 + * + * @param clientToken + * @return + */ + public Builder clientToken(String clientToken) { + this.clientToken = clientToken; + return this; + } + + /** + * 用户 ID 类型 + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 用户 ID 类型 + *

示例值:open_id + * + * @param userIdType {@link com.lark.oapi.service.corehr.v2.enums.CreateProbationAssessmentUserIdTypeEnum} + * @return + */ + public Builder userIdType(com.lark.oapi.service.corehr.v2.enums.CreateProbationAssessmentUserIdTypeEnum userIdType) { + this.userIdType = userIdType.getValue(); + return this; + } + + public CreateProbationAssessmentReqBody getCreateProbationAssessmentReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder createProbationAssessmentReqBody(CreateProbationAssessmentReqBody body) { + this.body = body; + return this; + } + + public CreateProbationAssessmentReq build() { + return new CreateProbationAssessmentReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreateProbationAssessmentReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreateProbationAssessmentReqBody.java new file mode 100644 index 000000000..ad8376536 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreateProbationAssessmentReqBody.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class CreateProbationAssessmentReqBody { + /** + * 试用期人员的雇佣 ID + *

示例值:7140964208476371111 + */ + @SerializedName("employment_id") + private String employmentId; + /** + * 试用期考核结果列表 + *

示例值: + */ + @SerializedName("assessments") + private AssessmentForCreate[] assessments; + + // builder 开始 + public CreateProbationAssessmentReqBody() { + } + + public CreateProbationAssessmentReqBody(Builder builder) { + /** + * 试用期人员的雇佣 ID + *

示例值:7140964208476371111 + */ + this.employmentId = builder.employmentId; + /** + * 试用期考核结果列表 + *

示例值: + */ + this.assessments = builder.assessments; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getEmploymentId() { + return this.employmentId; + } + + public void setEmploymentId(String employmentId) { + this.employmentId = employmentId; + } + + public AssessmentForCreate[] getAssessments() { + return this.assessments; + } + + public void setAssessments(AssessmentForCreate[] assessments) { + this.assessments = assessments; + } + + public static class Builder { + /** + * 试用期人员的雇佣 ID + *

示例值:7140964208476371111 + */ + private String employmentId; + /** + * 试用期考核结果列表 + *

示例值: + */ + private AssessmentForCreate[] assessments; + + /** + * 试用期人员的雇佣 ID + *

示例值:7140964208476371111 + * + * @param employmentId + * @return + */ + public Builder employmentId(String employmentId) { + this.employmentId = employmentId; + return this; + } + + + /** + * 试用期考核结果列表 + *

示例值: + * + * @param assessments + * @return + */ + public Builder assessments(AssessmentForCreate[] assessments) { + this.assessments = assessments; + return this; + } + + + public CreateProbationAssessmentReqBody build() { + return new CreateProbationAssessmentReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreateProbationAssessmentResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreateProbationAssessmentResp.java new file mode 100644 index 000000000..eb6febdb6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreateProbationAssessmentResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class CreateProbationAssessmentResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreateProbationAssessmentRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreateProbationAssessmentRespBody.java new file mode 100644 index 000000000..b74b4023e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CreateProbationAssessmentRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class CreateProbationAssessmentRespBody { + /** + * 创建的试用期考核记录 ID 列表,有序返回 + *

示例值: + */ + @SerializedName("assessment_ids") + private String[] assessmentIds; + + public String[] getAssessmentIds() { + return this.assessmentIds; + } + + public void setAssessmentIds(String[] assessmentIds) { + this.assessmentIds = assessmentIds; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Currency.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Currency.java new file mode 100644 index 000000000..397582ee8 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Currency.java @@ -0,0 +1,271 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Currency { + /** + * 货币 ID + *

示例值:6893114062142064111 + */ + @SerializedName("currency_id") + private String currencyId; + /** + * 货币所属国家/地区 ID,详细信息可通过【查询国家/地区信息】接口查询获得 + *

示例值:6893114162142064111 + */ + @SerializedName("country_region_id") + private String countryRegionId; + /** + * 货币名称 + *

示例值: + */ + @SerializedName("currency_name") + private I18n[] currencyName; + /** + * 数字代码 + *

示例值:156 + */ + @SerializedName("numeric_code") + private Integer numericCode; + /** + * 三位字母代码 + *

示例值:CNY + */ + @SerializedName("currency_alpha_3_code") + private String currencyAlpha3Code; + /** + * 状态 + *

示例值:1 + */ + @SerializedName("status") + private Integer status; + + // builder 开始 + public Currency() { + } + + public Currency(Builder builder) { + /** + * 货币 ID + *

示例值:6893114062142064111 + */ + this.currencyId = builder.currencyId; + /** + * 货币所属国家/地区 ID,详细信息可通过【查询国家/地区信息】接口查询获得 + *

示例值:6893114162142064111 + */ + this.countryRegionId = builder.countryRegionId; + /** + * 货币名称 + *

示例值: + */ + this.currencyName = builder.currencyName; + /** + * 数字代码 + *

示例值:156 + */ + this.numericCode = builder.numericCode; + /** + * 三位字母代码 + *

示例值:CNY + */ + this.currencyAlpha3Code = builder.currencyAlpha3Code; + /** + * 状态 + *

示例值:1 + */ + this.status = builder.status; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getCurrencyId() { + return this.currencyId; + } + + public void setCurrencyId(String currencyId) { + this.currencyId = currencyId; + } + + public String getCountryRegionId() { + return this.countryRegionId; + } + + public void setCountryRegionId(String countryRegionId) { + this.countryRegionId = countryRegionId; + } + + public I18n[] getCurrencyName() { + return this.currencyName; + } + + public void setCurrencyName(I18n[] currencyName) { + this.currencyName = currencyName; + } + + public Integer getNumericCode() { + return this.numericCode; + } + + public void setNumericCode(Integer numericCode) { + this.numericCode = numericCode; + } + + public String getCurrencyAlpha3Code() { + return this.currencyAlpha3Code; + } + + public void setCurrencyAlpha3Code(String currencyAlpha3Code) { + this.currencyAlpha3Code = currencyAlpha3Code; + } + + public Integer getStatus() { + return this.status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public static class Builder { + /** + * 货币 ID + *

示例值:6893114062142064111 + */ + private String currencyId; + /** + * 货币所属国家/地区 ID,详细信息可通过【查询国家/地区信息】接口查询获得 + *

示例值:6893114162142064111 + */ + private String countryRegionId; + /** + * 货币名称 + *

示例值: + */ + private I18n[] currencyName; + /** + * 数字代码 + *

示例值:156 + */ + private Integer numericCode; + /** + * 三位字母代码 + *

示例值:CNY + */ + private String currencyAlpha3Code; + /** + * 状态 + *

示例值:1 + */ + private Integer status; + + /** + * 货币 ID + *

示例值:6893114062142064111 + * + * @param currencyId + * @return + */ + public Builder currencyId(String currencyId) { + this.currencyId = currencyId; + return this; + } + + + /** + * 货币所属国家/地区 ID,详细信息可通过【查询国家/地区信息】接口查询获得 + *

示例值:6893114162142064111 + * + * @param countryRegionId + * @return + */ + public Builder countryRegionId(String countryRegionId) { + this.countryRegionId = countryRegionId; + return this; + } + + + /** + * 货币名称 + *

示例值: + * + * @param currencyName + * @return + */ + public Builder currencyName(I18n[] currencyName) { + this.currencyName = currencyName; + return this; + } + + + /** + * 数字代码 + *

示例值:156 + * + * @param numericCode + * @return + */ + public Builder numericCode(Integer numericCode) { + this.numericCode = numericCode; + return this; + } + + + /** + * 三位字母代码 + *

示例值:CNY + * + * @param currencyAlpha3Code + * @return + */ + public Builder currencyAlpha3Code(String currencyAlpha3Code) { + this.currencyAlpha3Code = currencyAlpha3Code; + return this; + } + + + /** + * 状态 + *

示例值:1 + * + * @param status + * @return + */ + public Builder status(Integer status) { + this.status = status; + return this; + } + + /** + * 状态 + *

示例值:1 + * + * @param status {@link com.lark.oapi.service.corehr.v2.enums.CurrencyBasicDataObjStatusEnum} + * @return + */ + public Builder status(com.lark.oapi.service.corehr.v2.enums.CurrencyBasicDataObjStatusEnum status) { + this.status = status.getValue(); + return this; + } + + + public Currency build() { + return new Currency(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CustomFieldData.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CustomFieldData.java new file mode 100644 index 000000000..07f23d42a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CustomFieldData.java @@ -0,0 +1,185 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class CustomFieldData { + /** + * 自定义字段 apiname,即自定义字段的唯一标识 + *

示例值:name + */ + @SerializedName("custom_api_name") + private String customApiName; + /** + * 自定义字段名称 + *

示例值: + */ + @SerializedName("name") + private CustomName name; + /** + * 自定义字段类型 + *

示例值:1 + */ + @SerializedName("type") + private Integer type; + /** + * 字段值,是 json 转义后的字符串,根据元数据定义不同,字段格式不同(如 123, 123.23, "true", ["id1","id2"], "2006-01-02 15:04:05") + *

示例值:\"231\" + */ + @SerializedName("value") + private String value; + + // builder 开始 + public CustomFieldData() { + } + + public CustomFieldData(Builder builder) { + /** + * 自定义字段 apiname,即自定义字段的唯一标识 + *

示例值:name + */ + this.customApiName = builder.customApiName; + /** + * 自定义字段名称 + *

示例值: + */ + this.name = builder.name; + /** + * 自定义字段类型 + *

示例值:1 + */ + this.type = builder.type; + /** + * 字段值,是 json 转义后的字符串,根据元数据定义不同,字段格式不同(如 123, 123.23, "true", ["id1","id2"], "2006-01-02 15:04:05") + *

示例值:\"231\" + */ + this.value = builder.value; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getCustomApiName() { + return this.customApiName; + } + + public void setCustomApiName(String customApiName) { + this.customApiName = customApiName; + } + + public CustomName getName() { + return this.name; + } + + public void setName(CustomName name) { + this.name = name; + } + + public Integer getType() { + return this.type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + public static class Builder { + /** + * 自定义字段 apiname,即自定义字段的唯一标识 + *

示例值:name + */ + private String customApiName; + /** + * 自定义字段名称 + *

示例值: + */ + private CustomName name; + /** + * 自定义字段类型 + *

示例值:1 + */ + private Integer type; + /** + * 字段值,是 json 转义后的字符串,根据元数据定义不同,字段格式不同(如 123, 123.23, "true", ["id1","id2"], "2006-01-02 15:04:05") + *

示例值:\"231\" + */ + private String value; + + /** + * 自定义字段 apiname,即自定义字段的唯一标识 + *

示例值:name + * + * @param customApiName + * @return + */ + public Builder customApiName(String customApiName) { + this.customApiName = customApiName; + return this; + } + + + /** + * 自定义字段名称 + *

示例值: + * + * @param name + * @return + */ + public Builder name(CustomName name) { + this.name = name; + return this; + } + + + /** + * 自定义字段类型 + *

示例值:1 + * + * @param type + * @return + */ + public Builder type(Integer type) { + this.type = type; + return this; + } + + + /** + * 字段值,是 json 转义后的字符串,根据元数据定义不同,字段格式不同(如 123, 123.23, "true", ["id1","id2"], "2006-01-02 15:04:05") + *

示例值:\"231\" + * + * @param value + * @return + */ + public Builder value(String value) { + this.value = value; + return this; + } + + + public CustomFieldData build() { + return new CustomFieldData(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CustomName.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CustomName.java new file mode 100644 index 000000000..7f0b529d6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CustomName.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class CustomName { + /** + * 中文 + *

示例值:自定义姓名 + */ + @SerializedName("zh_cn") + private String zhCn; + /** + * 英文 + *

示例值:Custom Name + */ + @SerializedName("en_us") + private String enUs; + + // builder 开始 + public CustomName() { + } + + public CustomName(Builder builder) { + /** + * 中文 + *

示例值:自定义姓名 + */ + this.zhCn = builder.zhCn; + /** + * 英文 + *

示例值:Custom Name + */ + this.enUs = builder.enUs; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getZhCn() { + return this.zhCn; + } + + public void setZhCn(String zhCn) { + this.zhCn = zhCn; + } + + public String getEnUs() { + return this.enUs; + } + + public void setEnUs(String enUs) { + this.enUs = enUs; + } + + public static class Builder { + /** + * 中文 + *

示例值:自定义姓名 + */ + private String zhCn; + /** + * 英文 + *

示例值:Custom Name + */ + private String enUs; + + /** + * 中文 + *

示例值:自定义姓名 + * + * @param zhCn + * @return + */ + public Builder zhCn(String zhCn) { + this.zhCn = zhCn; + return this; + } + + + /** + * 英文 + *

示例值:Custom Name + * + * @param enUs + * @return + */ + public Builder enUs(String enUs) { + this.enUs = enUs; + return this; + } + + + public CustomName build() { + return new CustomName(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CustomValue.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CustomValue.java new file mode 100644 index 000000000..bfa0fabdd --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/CustomValue.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class CustomValue { + /** + * 布尔类型的字段值 + *

示例值:false + */ + @SerializedName("value_boolean") + private Boolean valueBoolean; + /** + * 枚举类型的字段的枚举值 ID + *

示例值:sadasdas + */ + @SerializedName("value_enum_id") + private String valueEnumId; + + // builder 开始 + public CustomValue() { + } + + public CustomValue(Builder builder) { + /** + * 布尔类型的字段值 + *

示例值:false + */ + this.valueBoolean = builder.valueBoolean; + /** + * 枚举类型的字段的枚举值 ID + *

示例值:sadasdas + */ + this.valueEnumId = builder.valueEnumId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Boolean getValueBoolean() { + return this.valueBoolean; + } + + public void setValueBoolean(Boolean valueBoolean) { + this.valueBoolean = valueBoolean; + } + + public String getValueEnumId() { + return this.valueEnumId; + } + + public void setValueEnumId(String valueEnumId) { + this.valueEnumId = valueEnumId; + } + + public static class Builder { + /** + * 布尔类型的字段值 + *

示例值:false + */ + private Boolean valueBoolean; + /** + * 枚举类型的字段的枚举值 ID + *

示例值:sadasdas + */ + private String valueEnumId; + + /** + * 布尔类型的字段值 + *

示例值:false + * + * @param valueBoolean + * @return + */ + public Builder valueBoolean(Boolean valueBoolean) { + this.valueBoolean = valueBoolean; + return this; + } + + + /** + * 枚举类型的字段的枚举值 ID + *

示例值:sadasdas + * + * @param valueEnumId + * @return + */ + public Builder valueEnumId(String valueEnumId) { + this.valueEnumId = valueEnumId; + return this; + } + + + public CustomValue build() { + return new CustomValue(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DataengineI18n.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DataengineI18n.java new file mode 100644 index 000000000..a4309b868 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DataengineI18n.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class DataengineI18n { + /** + * 中文值 + *

示例值:中文 + */ + @SerializedName("zh_cn") + private String zhCn; + /** + * 英文值 + *

示例值:English + */ + @SerializedName("en_us") + private String enUs; + + // builder 开始 + public DataengineI18n() { + } + + public DataengineI18n(Builder builder) { + /** + * 中文值 + *

示例值:中文 + */ + this.zhCn = builder.zhCn; + /** + * 英文值 + *

示例值:English + */ + this.enUs = builder.enUs; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getZhCn() { + return this.zhCn; + } + + public void setZhCn(String zhCn) { + this.zhCn = zhCn; + } + + public String getEnUs() { + return this.enUs; + } + + public void setEnUs(String enUs) { + this.enUs = enUs; + } + + public static class Builder { + /** + * 中文值 + *

示例值:中文 + */ + private String zhCn; + /** + * 英文值 + *

示例值:English + */ + private String enUs; + + /** + * 中文值 + *

示例值:中文 + * + * @param zhCn + * @return + */ + public Builder zhCn(String zhCn) { + this.zhCn = zhCn; + return this; + } + + + /** + * 英文值 + *

示例值:English + * + * @param enUs + * @return + */ + public Builder enUs(String enUs) { + this.enUs = enUs; + return this; + } + + + public DataengineI18n build() { + return new DataengineI18n(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DeleteProbationAssessmentReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DeleteProbationAssessmentReq.java new file mode 100644 index 000000000..42167a744 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DeleteProbationAssessmentReq.java @@ -0,0 +1,72 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Path; + +public class DeleteProbationAssessmentReq { + /** + * 考核结果 ID + *

示例值:7140964208476371331 + */ + @Path + @SerializedName("assessment_id") + private String assessmentId; + + // builder 开始 + public DeleteProbationAssessmentReq() { + } + + public DeleteProbationAssessmentReq(Builder builder) { + /** + * 考核结果 ID + *

示例值:7140964208476371331 + */ + this.assessmentId = builder.assessmentId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getAssessmentId() { + return this.assessmentId; + } + + public void setAssessmentId(String assessmentId) { + this.assessmentId = assessmentId; + } + + public static class Builder { + + private String assessmentId; // 考核结果 ID + + /** + * 考核结果 ID + *

示例值:7140964208476371331 + * + * @param assessmentId + * @return + */ + public Builder assessmentId(String assessmentId) { + this.assessmentId = assessmentId; + return this; + } + + public DeleteProbationAssessmentReq build() { + return new DeleteProbationAssessmentReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DeleteProbationAssessmentResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DeleteProbationAssessmentResp.java new file mode 100644 index 000000000..bce0ba5d3 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DeleteProbationAssessmentResp.java @@ -0,0 +1,20 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; +import com.lark.oapi.core.response.EmptyData; + +public class DeleteProbationAssessmentResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Department.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Department.java new file mode 100644 index 000000000..a26ad036f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Department.java @@ -0,0 +1,629 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Department { + /** + * 部门 ID + *

示例值:4719456877659520852 + */ + @SerializedName("id") + private String id; + /** + * 部门记录版本 ID + *

示例值:6890452208593372611 + */ + @SerializedName("version_id") + private String versionId; + /** + * 部门名称 + *

示例值: + */ + @SerializedName("department_name") + private I18n[] departmentName; + /** + * 部门类型,枚举值可通过文档【飞书人事枚举常量】部门子类型(department_sub_type)枚举定义部分获得 + *

示例值: + */ + @SerializedName("sub_type") + private Enum subType; + /** + * 上级部门 ID + *

示例值:4719456877659520111 + */ + @SerializedName("parent_department_id") + private String parentDepartmentId; + /** + * 部门负责人雇佣 ID,枚举值及详细信息可通过【查询员工信息】接口查询获得 + *

示例值:6893013238632416777 + */ + @SerializedName("manager") + private String manager; + /** + * 树形排序,代表同层级的部门排序序号 + *

示例值:001000 + */ + @SerializedName("tree_order") + private String treeOrder; + /** + * 列表排序,代表所有部门的混排序号 + *

示例值:001000-001000 + */ + @SerializedName("list_order") + private String listOrder; + /** + * 编码 + *

示例值:D00000456 + */ + @SerializedName("code") + private String code; + /** + * 是否根部门 + *

示例值:false + */ + @SerializedName("is_root") + private Boolean isRoot; + /** + * 是否保密 + *

示例值:false + */ + @SerializedName("is_confidential") + private Boolean isConfidential; + /** + * 生效日期 + *

示例值:2020-05-01 + */ + @SerializedName("effective_date") + private String effectiveDate; + /** + * 失效日期 + *

示例值:2020-05-02 + */ + @SerializedName("expiration_date") + private String expirationDate; + /** + * 是否启用 + *

示例值:true + */ + @SerializedName("active") + private Boolean active; + /** + * 描述 + *

示例值: + */ + @SerializedName("description") + private I18n[] description; + /** + * 自定义字段 + *

示例值: + */ + @SerializedName("custom_fields") + private CustomFieldData[] customFields; + + // builder 开始 + public Department() { + } + + public Department(Builder builder) { + /** + * 部门 ID + *

示例值:4719456877659520852 + */ + this.id = builder.id; + /** + * 部门记录版本 ID + *

示例值:6890452208593372611 + */ + this.versionId = builder.versionId; + /** + * 部门名称 + *

示例值: + */ + this.departmentName = builder.departmentName; + /** + * 部门类型,枚举值可通过文档【飞书人事枚举常量】部门子类型(department_sub_type)枚举定义部分获得 + *

示例值: + */ + this.subType = builder.subType; + /** + * 上级部门 ID + *

示例值:4719456877659520111 + */ + this.parentDepartmentId = builder.parentDepartmentId; + /** + * 部门负责人雇佣 ID,枚举值及详细信息可通过【查询员工信息】接口查询获得 + *

示例值:6893013238632416777 + */ + this.manager = builder.manager; + /** + * 树形排序,代表同层级的部门排序序号 + *

示例值:001000 + */ + this.treeOrder = builder.treeOrder; + /** + * 列表排序,代表所有部门的混排序号 + *

示例值:001000-001000 + */ + this.listOrder = builder.listOrder; + /** + * 编码 + *

示例值:D00000456 + */ + this.code = builder.code; + /** + * 是否根部门 + *

示例值:false + */ + this.isRoot = builder.isRoot; + /** + * 是否保密 + *

示例值:false + */ + this.isConfidential = builder.isConfidential; + /** + * 生效日期 + *

示例值:2020-05-01 + */ + this.effectiveDate = builder.effectiveDate; + /** + * 失效日期 + *

示例值:2020-05-02 + */ + this.expirationDate = builder.expirationDate; + /** + * 是否启用 + *

示例值:true + */ + this.active = builder.active; + /** + * 描述 + *

示例值: + */ + this.description = builder.description; + /** + * 自定义字段 + *

示例值: + */ + this.customFields = builder.customFields; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public String getVersionId() { + return this.versionId; + } + + public void setVersionId(String versionId) { + this.versionId = versionId; + } + + public I18n[] getDepartmentName() { + return this.departmentName; + } + + public void setDepartmentName(I18n[] departmentName) { + this.departmentName = departmentName; + } + + public Enum getSubType() { + return this.subType; + } + + public void setSubType(Enum subType) { + this.subType = subType; + } + + public String getParentDepartmentId() { + return this.parentDepartmentId; + } + + public void setParentDepartmentId(String parentDepartmentId) { + this.parentDepartmentId = parentDepartmentId; + } + + public String getManager() { + return this.manager; + } + + public void setManager(String manager) { + this.manager = manager; + } + + public String getTreeOrder() { + return this.treeOrder; + } + + public void setTreeOrder(String treeOrder) { + this.treeOrder = treeOrder; + } + + public String getListOrder() { + return this.listOrder; + } + + public void setListOrder(String listOrder) { + this.listOrder = listOrder; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public Boolean getIsRoot() { + return this.isRoot; + } + + public void setIsRoot(Boolean isRoot) { + this.isRoot = isRoot; + } + + public Boolean getIsConfidential() { + return this.isConfidential; + } + + public void setIsConfidential(Boolean isConfidential) { + this.isConfidential = isConfidential; + } + + public String getEffectiveDate() { + return this.effectiveDate; + } + + public void setEffectiveDate(String effectiveDate) { + this.effectiveDate = effectiveDate; + } + + public String getExpirationDate() { + return this.expirationDate; + } + + public void setExpirationDate(String expirationDate) { + this.expirationDate = expirationDate; + } + + public Boolean getActive() { + return this.active; + } + + public void setActive(Boolean active) { + this.active = active; + } + + public I18n[] getDescription() { + return this.description; + } + + public void setDescription(I18n[] description) { + this.description = description; + } + + public CustomFieldData[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(CustomFieldData[] customFields) { + this.customFields = customFields; + } + + public static class Builder { + /** + * 部门 ID + *

示例值:4719456877659520852 + */ + private String id; + /** + * 部门记录版本 ID + *

示例值:6890452208593372611 + */ + private String versionId; + /** + * 部门名称 + *

示例值: + */ + private I18n[] departmentName; + /** + * 部门类型,枚举值可通过文档【飞书人事枚举常量】部门子类型(department_sub_type)枚举定义部分获得 + *

示例值: + */ + private Enum subType; + /** + * 上级部门 ID + *

示例值:4719456877659520111 + */ + private String parentDepartmentId; + /** + * 部门负责人雇佣 ID,枚举值及详细信息可通过【查询员工信息】接口查询获得 + *

示例值:6893013238632416777 + */ + private String manager; + /** + * 树形排序,代表同层级的部门排序序号 + *

示例值:001000 + */ + private String treeOrder; + /** + * 列表排序,代表所有部门的混排序号 + *

示例值:001000-001000 + */ + private String listOrder; + /** + * 编码 + *

示例值:D00000456 + */ + private String code; + /** + * 是否根部门 + *

示例值:false + */ + private Boolean isRoot; + /** + * 是否保密 + *

示例值:false + */ + private Boolean isConfidential; + /** + * 生效日期 + *

示例值:2020-05-01 + */ + private String effectiveDate; + /** + * 失效日期 + *

示例值:2020-05-02 + */ + private String expirationDate; + /** + * 是否启用 + *

示例值:true + */ + private Boolean active; + /** + * 描述 + *

示例值: + */ + private I18n[] description; + /** + * 自定义字段 + *

示例值: + */ + private CustomFieldData[] customFields; + + /** + * 部门 ID + *

示例值:4719456877659520852 + * + * @param id + * @return + */ + public Builder id(String id) { + this.id = id; + return this; + } + + + /** + * 部门记录版本 ID + *

示例值:6890452208593372611 + * + * @param versionId + * @return + */ + public Builder versionId(String versionId) { + this.versionId = versionId; + return this; + } + + + /** + * 部门名称 + *

示例值: + * + * @param departmentName + * @return + */ + public Builder departmentName(I18n[] departmentName) { + this.departmentName = departmentName; + return this; + } + + + /** + * 部门类型,枚举值可通过文档【飞书人事枚举常量】部门子类型(department_sub_type)枚举定义部分获得 + *

示例值: + * + * @param subType + * @return + */ + public Builder subType(Enum subType) { + this.subType = subType; + return this; + } + + + /** + * 上级部门 ID + *

示例值:4719456877659520111 + * + * @param parentDepartmentId + * @return + */ + public Builder parentDepartmentId(String parentDepartmentId) { + this.parentDepartmentId = parentDepartmentId; + return this; + } + + + /** + * 部门负责人雇佣 ID,枚举值及详细信息可通过【查询员工信息】接口查询获得 + *

示例值:6893013238632416777 + * + * @param manager + * @return + */ + public Builder manager(String manager) { + this.manager = manager; + return this; + } + + + /** + * 树形排序,代表同层级的部门排序序号 + *

示例值:001000 + * + * @param treeOrder + * @return + */ + public Builder treeOrder(String treeOrder) { + this.treeOrder = treeOrder; + return this; + } + + + /** + * 列表排序,代表所有部门的混排序号 + *

示例值:001000-001000 + * + * @param listOrder + * @return + */ + public Builder listOrder(String listOrder) { + this.listOrder = listOrder; + return this; + } + + + /** + * 编码 + *

示例值:D00000456 + * + * @param code + * @return + */ + public Builder code(String code) { + this.code = code; + return this; + } + + + /** + * 是否根部门 + *

示例值:false + * + * @param isRoot + * @return + */ + public Builder isRoot(Boolean isRoot) { + this.isRoot = isRoot; + return this; + } + + + /** + * 是否保密 + *

示例值:false + * + * @param isConfidential + * @return + */ + public Builder isConfidential(Boolean isConfidential) { + this.isConfidential = isConfidential; + return this; + } + + + /** + * 生效日期 + *

示例值:2020-05-01 + * + * @param effectiveDate + * @return + */ + public Builder effectiveDate(String effectiveDate) { + this.effectiveDate = effectiveDate; + return this; + } + + + /** + * 失效日期 + *

示例值:2020-05-02 + * + * @param expirationDate + * @return + */ + public Builder expirationDate(String expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + + /** + * 是否启用 + *

示例值:true + * + * @param active + * @return + */ + public Builder active(Boolean active) { + this.active = active; + return this; + } + + + /** + * 描述 + *

示例值: + * + * @param description + * @return + */ + public Builder description(I18n[] description) { + this.description = description; + return this; + } + + + /** + * 自定义字段 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(CustomFieldData[] customFields) { + this.customFields = customFields; + return this; + } + + + public Department build() { + return new Department(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DepartmentChange.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DepartmentChange.java new file mode 100644 index 000000000..88bfb3dfd --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DepartmentChange.java @@ -0,0 +1,197 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class DepartmentChange { + /** + * 部门调整记录 ID + *

示例值:6991776076699549697 + */ + @SerializedName("department_change_id") + private String departmentChangeId; + /** + * 部门 ID + *

示例值:6966236933198579208 + */ + @SerializedName("department_id") + private String departmentId; + /** + * 调整类型 + *

示例值:Create + */ + @SerializedName("department_change_type") + private String departmentChangeType; + /** + * 调整详细信息 + *

示例值: + */ + @SerializedName("reorganization_info") + private ReorganizationInfo reorganizationInfo; + + // builder 开始 + public DepartmentChange() { + } + + public DepartmentChange(Builder builder) { + /** + * 部门调整记录 ID + *

示例值:6991776076699549697 + */ + this.departmentChangeId = builder.departmentChangeId; + /** + * 部门 ID + *

示例值:6966236933198579208 + */ + this.departmentId = builder.departmentId; + /** + * 调整类型 + *

示例值:Create + */ + this.departmentChangeType = builder.departmentChangeType; + /** + * 调整详细信息 + *

示例值: + */ + this.reorganizationInfo = builder.reorganizationInfo; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getDepartmentChangeId() { + return this.departmentChangeId; + } + + public void setDepartmentChangeId(String departmentChangeId) { + this.departmentChangeId = departmentChangeId; + } + + public String getDepartmentId() { + return this.departmentId; + } + + public void setDepartmentId(String departmentId) { + this.departmentId = departmentId; + } + + public String getDepartmentChangeType() { + return this.departmentChangeType; + } + + public void setDepartmentChangeType(String departmentChangeType) { + this.departmentChangeType = departmentChangeType; + } + + public ReorganizationInfo getReorganizationInfo() { + return this.reorganizationInfo; + } + + public void setReorganizationInfo(ReorganizationInfo reorganizationInfo) { + this.reorganizationInfo = reorganizationInfo; + } + + public static class Builder { + /** + * 部门调整记录 ID + *

示例值:6991776076699549697 + */ + private String departmentChangeId; + /** + * 部门 ID + *

示例值:6966236933198579208 + */ + private String departmentId; + /** + * 调整类型 + *

示例值:Create + */ + private String departmentChangeType; + /** + * 调整详细信息 + *

示例值: + */ + private ReorganizationInfo reorganizationInfo; + + /** + * 部门调整记录 ID + *

示例值:6991776076699549697 + * + * @param departmentChangeId + * @return + */ + public Builder departmentChangeId(String departmentChangeId) { + this.departmentChangeId = departmentChangeId; + return this; + } + + + /** + * 部门 ID + *

示例值:6966236933198579208 + * + * @param departmentId + * @return + */ + public Builder departmentId(String departmentId) { + this.departmentId = departmentId; + return this; + } + + + /** + * 调整类型 + *

示例值:Create + * + * @param departmentChangeType + * @return + */ + public Builder departmentChangeType(String departmentChangeType) { + this.departmentChangeType = departmentChangeType; + return this; + } + + /** + * 调整类型 + *

示例值:Create + * + * @param departmentChangeType {@link com.lark.oapi.service.corehr.v2.enums.DepartmentChangeDepartmentChangeTypeEnum} + * @return + */ + public Builder departmentChangeType(com.lark.oapi.service.corehr.v2.enums.DepartmentChangeDepartmentChangeTypeEnum departmentChangeType) { + this.departmentChangeType = departmentChangeType.getValue(); + return this; + } + + + /** + * 调整详细信息 + *

示例值: + * + * @param reorganizationInfo + * @return + */ + public Builder reorganizationInfo(ReorganizationInfo reorganizationInfo) { + this.reorganizationInfo = reorganizationInfo; + return this; + } + + + public DepartmentChange build() { + return new DepartmentChange(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DepartmentHrbp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DepartmentHrbp.java new file mode 100644 index 000000000..2a616e31d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DepartmentHrbp.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class DepartmentHrbp { + /** + * 部门 ID + *

示例值:4719456877659520852 + */ + @SerializedName("department_id") + private String departmentId; + /** + * 部门 HRBP 雇佣 ID + *

示例值: + */ + @SerializedName("hrbp_ids") + private String[] hrbpIds; + + // builder 开始 + public DepartmentHrbp() { + } + + public DepartmentHrbp(Builder builder) { + /** + * 部门 ID + *

示例值:4719456877659520852 + */ + this.departmentId = builder.departmentId; + /** + * 部门 HRBP 雇佣 ID + *

示例值: + */ + this.hrbpIds = builder.hrbpIds; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getDepartmentId() { + return this.departmentId; + } + + public void setDepartmentId(String departmentId) { + this.departmentId = departmentId; + } + + public String[] getHrbpIds() { + return this.hrbpIds; + } + + public void setHrbpIds(String[] hrbpIds) { + this.hrbpIds = hrbpIds; + } + + public static class Builder { + /** + * 部门 ID + *

示例值:4719456877659520852 + */ + private String departmentId; + /** + * 部门 HRBP 雇佣 ID + *

示例值: + */ + private String[] hrbpIds; + + /** + * 部门 ID + *

示例值:4719456877659520852 + * + * @param departmentId + * @return + */ + public Builder departmentId(String departmentId) { + this.departmentId = departmentId; + return this; + } + + + /** + * 部门 HRBP 雇佣 ID + *

示例值: + * + * @param hrbpIds + * @return + */ + public Builder hrbpIds(String[] hrbpIds) { + this.hrbpIds = hrbpIds; + return this; + } + + + public DepartmentHrbp build() { + return new DepartmentHrbp(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DepartmentId.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DepartmentId.java new file mode 100644 index 000000000..182eb028d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DepartmentId.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class DepartmentId { + /** + *

示例值: + */ + @SerializedName("department_id") + private String departmentId; + /** + *

示例值: + */ + @SerializedName("open_department_id") + private String openDepartmentId; + + // builder 开始 + public DepartmentId() { + } + + public DepartmentId(Builder builder) { + /** + * + *

示例值: + */ + this.departmentId = builder.departmentId; + /** + * + *

示例值: + */ + this.openDepartmentId = builder.openDepartmentId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getDepartmentId() { + return this.departmentId; + } + + public void setDepartmentId(String departmentId) { + this.departmentId = departmentId; + } + + public String getOpenDepartmentId() { + return this.openDepartmentId; + } + + public void setOpenDepartmentId(String openDepartmentId) { + this.openDepartmentId = openDepartmentId; + } + + public static class Builder { + /** + *

示例值: + */ + private String departmentId; + /** + *

示例值: + */ + private String openDepartmentId; + + /** + *

示例值: + * + * @param departmentId + * @return + */ + public Builder departmentId(String departmentId) { + this.departmentId = departmentId; + return this; + } + + + /** + *

示例值: + * + * @param openDepartmentId + * @return + */ + public Builder openDepartmentId(String openDepartmentId) { + this.openDepartmentId = openDepartmentId; + return this; + } + + + public DepartmentId build() { + return new DepartmentId(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DepartmentParentInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DepartmentParentInfo.java new file mode 100644 index 000000000..73e34e2c0 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DepartmentParentInfo.java @@ -0,0 +1,222 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class DepartmentParentInfo { + /** + * 部门 ID + *

示例值:4719456877659520852 + */ + @SerializedName("department_id") + private String departmentId; + /** + * 部门名称 + *

示例值: + */ + @SerializedName("department_name") + private I18n[] departmentName; + /** + * 上级部门 ID + *

示例值:4719456877659520111 + */ + @SerializedName("parent_department_id") + private String parentDepartmentId; + /** + * 是否启用 + *

示例值:true + */ + @SerializedName("active") + private Boolean active; + /** + * 是否根部门 + *

示例值:true + */ + @SerializedName("is_root") + private Boolean isRoot; + + // builder 开始 + public DepartmentParentInfo() { + } + + public DepartmentParentInfo(Builder builder) { + /** + * 部门 ID + *

示例值:4719456877659520852 + */ + this.departmentId = builder.departmentId; + /** + * 部门名称 + *

示例值: + */ + this.departmentName = builder.departmentName; + /** + * 上级部门 ID + *

示例值:4719456877659520111 + */ + this.parentDepartmentId = builder.parentDepartmentId; + /** + * 是否启用 + *

示例值:true + */ + this.active = builder.active; + /** + * 是否根部门 + *

示例值:true + */ + this.isRoot = builder.isRoot; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getDepartmentId() { + return this.departmentId; + } + + public void setDepartmentId(String departmentId) { + this.departmentId = departmentId; + } + + public I18n[] getDepartmentName() { + return this.departmentName; + } + + public void setDepartmentName(I18n[] departmentName) { + this.departmentName = departmentName; + } + + public String getParentDepartmentId() { + return this.parentDepartmentId; + } + + public void setParentDepartmentId(String parentDepartmentId) { + this.parentDepartmentId = parentDepartmentId; + } + + public Boolean getActive() { + return this.active; + } + + public void setActive(Boolean active) { + this.active = active; + } + + public Boolean getIsRoot() { + return this.isRoot; + } + + public void setIsRoot(Boolean isRoot) { + this.isRoot = isRoot; + } + + public static class Builder { + /** + * 部门 ID + *

示例值:4719456877659520852 + */ + private String departmentId; + /** + * 部门名称 + *

示例值: + */ + private I18n[] departmentName; + /** + * 上级部门 ID + *

示例值:4719456877659520111 + */ + private String parentDepartmentId; + /** + * 是否启用 + *

示例值:true + */ + private Boolean active; + /** + * 是否根部门 + *

示例值:true + */ + private Boolean isRoot; + + /** + * 部门 ID + *

示例值:4719456877659520852 + * + * @param departmentId + * @return + */ + public Builder departmentId(String departmentId) { + this.departmentId = departmentId; + return this; + } + + + /** + * 部门名称 + *

示例值: + * + * @param departmentName + * @return + */ + public Builder departmentName(I18n[] departmentName) { + this.departmentName = departmentName; + return this; + } + + + /** + * 上级部门 ID + *

示例值:4719456877659520111 + * + * @param parentDepartmentId + * @return + */ + public Builder parentDepartmentId(String parentDepartmentId) { + this.parentDepartmentId = parentDepartmentId; + return this; + } + + + /** + * 是否启用 + *

示例值:true + * + * @param active + * @return + */ + public Builder active(Boolean active) { + this.active = active; + return this; + } + + + /** + * 是否根部门 + *

示例值:true + * + * @param isRoot + * @return + */ + public Builder isRoot(Boolean isRoot) { + this.isRoot = isRoot; + return this; + } + + + public DepartmentParentInfo build() { + return new DepartmentParentInfo(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DepartmentParents.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DepartmentParents.java new file mode 100644 index 000000000..be63d4009 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DepartmentParents.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class DepartmentParents { + /** + * 部门 ID + *

示例值:6893014062142064111 + */ + @SerializedName("department_id") + private String departmentId; + /** + * 父部门列表,部门按照至底向上的顺序返回 + *

示例值: + */ + @SerializedName("parent_department_list") + private DepartmentParentInfo[] parentDepartmentList; + + // builder 开始 + public DepartmentParents() { + } + + public DepartmentParents(Builder builder) { + /** + * 部门 ID + *

示例值:6893014062142064111 + */ + this.departmentId = builder.departmentId; + /** + * 父部门列表,部门按照至底向上的顺序返回 + *

示例值: + */ + this.parentDepartmentList = builder.parentDepartmentList; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getDepartmentId() { + return this.departmentId; + } + + public void setDepartmentId(String departmentId) { + this.departmentId = departmentId; + } + + public DepartmentParentInfo[] getParentDepartmentList() { + return this.parentDepartmentList; + } + + public void setParentDepartmentList(DepartmentParentInfo[] parentDepartmentList) { + this.parentDepartmentList = parentDepartmentList; + } + + public static class Builder { + /** + * 部门 ID + *

示例值:6893014062142064111 + */ + private String departmentId; + /** + * 父部门列表,部门按照至底向上的顺序返回 + *

示例值: + */ + private DepartmentParentInfo[] parentDepartmentList; + + /** + * 部门 ID + *

示例值:6893014062142064111 + * + * @param departmentId + * @return + */ + public Builder departmentId(String departmentId) { + this.departmentId = departmentId; + return this; + } + + + /** + * 父部门列表,部门按照至底向上的顺序返回 + *

示例值: + * + * @param parentDepartmentList + * @return + */ + public Builder parentDepartmentList(DepartmentParentInfo[] parentDepartmentList) { + this.parentDepartmentList = parentDepartmentList; + return this; + } + + + public DepartmentParents build() { + return new DepartmentParents(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Dependent.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Dependent.java new file mode 100644 index 000000000..f9fe084df --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Dependent.java @@ -0,0 +1,592 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Dependent { + /** + * 姓名 + *

示例值: + */ + @SerializedName("name") + private PersonName name; + /** + * 关系 + *

示例值: + */ + @SerializedName("relationship") + private Enum relationship; + /** + * 性别 + *

示例值: + */ + @SerializedName("gender") + private Enum gender; + /** + * 生日 + *

示例值:2020-01-01 + */ + @SerializedName("date_of_birth") + private String dateOfBirth; + /** + * 证件号码 + *

示例值: + */ + @SerializedName("national_id_list") + private NationalId[] nationalIdList; + /** + * 配偶工作状态 + *

示例值: + */ + @SerializedName("spouses_working_status") + private Enum spousesWorkingStatus; + /** + * 包含家属医疗保险 + *

示例值:true + */ + @SerializedName("is_this_person_covered_by_health_insurance") + private Boolean isThisPersonCoveredByHealthInsurance; + /** + * 允许家属抵扣税款 + *

示例值:false + */ + @SerializedName("is_this_person_allowed_for_tax_deduction") + private Boolean isThisPersonAllowedForTaxDeduction; + /** + * 自定义字段 + *

示例值: + */ + @SerializedName("custom_fields") + private CustomFieldData[] customFields; + /** + * 家庭成员姓名 + *

示例值:张三 + */ + @SerializedName("dependent_name") + private String dependentName; + /** + * 工作单位 + *

示例值:海淀区交警大队 + */ + @SerializedName("employer") + private String employer; + /** + * 岗位 + *

示例值:保安 + */ + @SerializedName("job") + private String job; + /** + * 电话 + *

示例值: + */ + @SerializedName("phone") + private Phone phone; + /** + * 联系地址 + *

示例值: + */ + @SerializedName("address") + private Address address; + /** + * 出生证明 + *

示例值: + */ + @SerializedName("birth_certificate_of_child") + private File[] birthCertificateOfChild; + + // builder 开始 + public Dependent() { + } + + public Dependent(Builder builder) { + /** + * 姓名 + *

示例值: + */ + this.name = builder.name; + /** + * 关系 + *

示例值: + */ + this.relationship = builder.relationship; + /** + * 性别 + *

示例值: + */ + this.gender = builder.gender; + /** + * 生日 + *

示例值:2020-01-01 + */ + this.dateOfBirth = builder.dateOfBirth; + /** + * 证件号码 + *

示例值: + */ + this.nationalIdList = builder.nationalIdList; + /** + * 配偶工作状态 + *

示例值: + */ + this.spousesWorkingStatus = builder.spousesWorkingStatus; + /** + * 包含家属医疗保险 + *

示例值:true + */ + this.isThisPersonCoveredByHealthInsurance = builder.isThisPersonCoveredByHealthInsurance; + /** + * 允许家属抵扣税款 + *

示例值:false + */ + this.isThisPersonAllowedForTaxDeduction = builder.isThisPersonAllowedForTaxDeduction; + /** + * 自定义字段 + *

示例值: + */ + this.customFields = builder.customFields; + /** + * 家庭成员姓名 + *

示例值:张三 + */ + this.dependentName = builder.dependentName; + /** + * 工作单位 + *

示例值:海淀区交警大队 + */ + this.employer = builder.employer; + /** + * 岗位 + *

示例值:保安 + */ + this.job = builder.job; + /** + * 电话 + *

示例值: + */ + this.phone = builder.phone; + /** + * 联系地址 + *

示例值: + */ + this.address = builder.address; + /** + * 出生证明 + *

示例值: + */ + this.birthCertificateOfChild = builder.birthCertificateOfChild; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public PersonName getName() { + return this.name; + } + + public void setName(PersonName name) { + this.name = name; + } + + public Enum getRelationship() { + return this.relationship; + } + + public void setRelationship(Enum relationship) { + this.relationship = relationship; + } + + public Enum getGender() { + return this.gender; + } + + public void setGender(Enum gender) { + this.gender = gender; + } + + public String getDateOfBirth() { + return this.dateOfBirth; + } + + public void setDateOfBirth(String dateOfBirth) { + this.dateOfBirth = dateOfBirth; + } + + public NationalId[] getNationalIdList() { + return this.nationalIdList; + } + + public void setNationalIdList(NationalId[] nationalIdList) { + this.nationalIdList = nationalIdList; + } + + public Enum getSpousesWorkingStatus() { + return this.spousesWorkingStatus; + } + + public void setSpousesWorkingStatus(Enum spousesWorkingStatus) { + this.spousesWorkingStatus = spousesWorkingStatus; + } + + public Boolean getIsThisPersonCoveredByHealthInsurance() { + return this.isThisPersonCoveredByHealthInsurance; + } + + public void setIsThisPersonCoveredByHealthInsurance(Boolean isThisPersonCoveredByHealthInsurance) { + this.isThisPersonCoveredByHealthInsurance = isThisPersonCoveredByHealthInsurance; + } + + public Boolean getIsThisPersonAllowedForTaxDeduction() { + return this.isThisPersonAllowedForTaxDeduction; + } + + public void setIsThisPersonAllowedForTaxDeduction(Boolean isThisPersonAllowedForTaxDeduction) { + this.isThisPersonAllowedForTaxDeduction = isThisPersonAllowedForTaxDeduction; + } + + public CustomFieldData[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(CustomFieldData[] customFields) { + this.customFields = customFields; + } + + public String getDependentName() { + return this.dependentName; + } + + public void setDependentName(String dependentName) { + this.dependentName = dependentName; + } + + public String getEmployer() { + return this.employer; + } + + public void setEmployer(String employer) { + this.employer = employer; + } + + public String getJob() { + return this.job; + } + + public void setJob(String job) { + this.job = job; + } + + public Phone getPhone() { + return this.phone; + } + + public void setPhone(Phone phone) { + this.phone = phone; + } + + public Address getAddress() { + return this.address; + } + + public void setAddress(Address address) { + this.address = address; + } + + public File[] getBirthCertificateOfChild() { + return this.birthCertificateOfChild; + } + + public void setBirthCertificateOfChild(File[] birthCertificateOfChild) { + this.birthCertificateOfChild = birthCertificateOfChild; + } + + public static class Builder { + /** + * 姓名 + *

示例值: + */ + private PersonName name; + /** + * 关系 + *

示例值: + */ + private Enum relationship; + /** + * 性别 + *

示例值: + */ + private Enum gender; + /** + * 生日 + *

示例值:2020-01-01 + */ + private String dateOfBirth; + /** + * 证件号码 + *

示例值: + */ + private NationalId[] nationalIdList; + /** + * 配偶工作状态 + *

示例值: + */ + private Enum spousesWorkingStatus; + /** + * 包含家属医疗保险 + *

示例值:true + */ + private Boolean isThisPersonCoveredByHealthInsurance; + /** + * 允许家属抵扣税款 + *

示例值:false + */ + private Boolean isThisPersonAllowedForTaxDeduction; + /** + * 自定义字段 + *

示例值: + */ + private CustomFieldData[] customFields; + /** + * 家庭成员姓名 + *

示例值:张三 + */ + private String dependentName; + /** + * 工作单位 + *

示例值:海淀区交警大队 + */ + private String employer; + /** + * 岗位 + *

示例值:保安 + */ + private String job; + /** + * 电话 + *

示例值: + */ + private Phone phone; + /** + * 联系地址 + *

示例值: + */ + private Address address; + /** + * 出生证明 + *

示例值: + */ + private File[] birthCertificateOfChild; + + /** + * 姓名 + *

示例值: + * + * @param name + * @return + */ + public Builder name(PersonName name) { + this.name = name; + return this; + } + + + /** + * 关系 + *

示例值: + * + * @param relationship + * @return + */ + public Builder relationship(Enum relationship) { + this.relationship = relationship; + return this; + } + + + /** + * 性别 + *

示例值: + * + * @param gender + * @return + */ + public Builder gender(Enum gender) { + this.gender = gender; + return this; + } + + + /** + * 生日 + *

示例值:2020-01-01 + * + * @param dateOfBirth + * @return + */ + public Builder dateOfBirth(String dateOfBirth) { + this.dateOfBirth = dateOfBirth; + return this; + } + + + /** + * 证件号码 + *

示例值: + * + * @param nationalIdList + * @return + */ + public Builder nationalIdList(NationalId[] nationalIdList) { + this.nationalIdList = nationalIdList; + return this; + } + + + /** + * 配偶工作状态 + *

示例值: + * + * @param spousesWorkingStatus + * @return + */ + public Builder spousesWorkingStatus(Enum spousesWorkingStatus) { + this.spousesWorkingStatus = spousesWorkingStatus; + return this; + } + + + /** + * 包含家属医疗保险 + *

示例值:true + * + * @param isThisPersonCoveredByHealthInsurance + * @return + */ + public Builder isThisPersonCoveredByHealthInsurance(Boolean isThisPersonCoveredByHealthInsurance) { + this.isThisPersonCoveredByHealthInsurance = isThisPersonCoveredByHealthInsurance; + return this; + } + + + /** + * 允许家属抵扣税款 + *

示例值:false + * + * @param isThisPersonAllowedForTaxDeduction + * @return + */ + public Builder isThisPersonAllowedForTaxDeduction(Boolean isThisPersonAllowedForTaxDeduction) { + this.isThisPersonAllowedForTaxDeduction = isThisPersonAllowedForTaxDeduction; + return this; + } + + + /** + * 自定义字段 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(CustomFieldData[] customFields) { + this.customFields = customFields; + return this; + } + + + /** + * 家庭成员姓名 + *

示例值:张三 + * + * @param dependentName + * @return + */ + public Builder dependentName(String dependentName) { + this.dependentName = dependentName; + return this; + } + + + /** + * 工作单位 + *

示例值:海淀区交警大队 + * + * @param employer + * @return + */ + public Builder employer(String employer) { + this.employer = employer; + return this; + } + + + /** + * 岗位 + *

示例值:保安 + * + * @param job + * @return + */ + public Builder job(String job) { + this.job = job; + return this; + } + + + /** + * 电话 + *

示例值: + * + * @param phone + * @return + */ + public Builder phone(Phone phone) { + this.phone = phone; + return this; + } + + + /** + * 联系地址 + *

示例值: + * + * @param address + * @return + */ + public Builder address(Address address) { + this.address = address; + return this; + } + + + /** + * 出生证明 + *

示例值: + * + * @param birthCertificateOfChild + * @return + */ + public Builder birthCertificateOfChild(File[] birthCertificateOfChild) { + this.birthCertificateOfChild = birthCertificateOfChild; + return this; + } + + + public Dependent build() { + return new Dependent(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Dimension.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Dimension.java new file mode 100644 index 000000000..3f902421a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Dimension.java @@ -0,0 +1,222 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Dimension { + /** + * 维度的名称 + *

示例值: + */ + @SerializedName("name") + private I18n[] name; + /** + * 维度的 api name + *

示例值:department + */ + @SerializedName("api_name") + private String apiName; + /** + * 维度的字段类型。enum 代表字段为枚举类型,lookup 代表字段为 lookup 类型,bool 代表字段为布尔类型 + *

示例值:enum + */ + @SerializedName("field_type") + private String fieldType; + /** + * 维度是否为必填 + *

示例值:true + */ + @SerializedName("required") + private Boolean required; + /** + * 枚举类型的维度对应的枚举值列表 + *

示例值: + */ + @SerializedName("enum_value") + private Enum[] enumValue; + + // builder 开始 + public Dimension() { + } + + public Dimension(Builder builder) { + /** + * 维度的名称 + *

示例值: + */ + this.name = builder.name; + /** + * 维度的 api name + *

示例值:department + */ + this.apiName = builder.apiName; + /** + * 维度的字段类型。enum 代表字段为枚举类型,lookup 代表字段为 lookup 类型,bool 代表字段为布尔类型 + *

示例值:enum + */ + this.fieldType = builder.fieldType; + /** + * 维度是否为必填 + *

示例值:true + */ + this.required = builder.required; + /** + * 枚举类型的维度对应的枚举值列表 + *

示例值: + */ + this.enumValue = builder.enumValue; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public I18n[] getName() { + return this.name; + } + + public void setName(I18n[] name) { + this.name = name; + } + + public String getApiName() { + return this.apiName; + } + + public void setApiName(String apiName) { + this.apiName = apiName; + } + + public String getFieldType() { + return this.fieldType; + } + + public void setFieldType(String fieldType) { + this.fieldType = fieldType; + } + + public Boolean getRequired() { + return this.required; + } + + public void setRequired(Boolean required) { + this.required = required; + } + + public Enum[] getEnumValue() { + return this.enumValue; + } + + public void setEnumValue(Enum[] enumValue) { + this.enumValue = enumValue; + } + + public static class Builder { + /** + * 维度的名称 + *

示例值: + */ + private I18n[] name; + /** + * 维度的 api name + *

示例值:department + */ + private String apiName; + /** + * 维度的字段类型。enum 代表字段为枚举类型,lookup 代表字段为 lookup 类型,bool 代表字段为布尔类型 + *

示例值:enum + */ + private String fieldType; + /** + * 维度是否为必填 + *

示例值:true + */ + private Boolean required; + /** + * 枚举类型的维度对应的枚举值列表 + *

示例值: + */ + private Enum[] enumValue; + + /** + * 维度的名称 + *

示例值: + * + * @param name + * @return + */ + public Builder name(I18n[] name) { + this.name = name; + return this; + } + + + /** + * 维度的 api name + *

示例值:department + * + * @param apiName + * @return + */ + public Builder apiName(String apiName) { + this.apiName = apiName; + return this; + } + + + /** + * 维度的字段类型。enum 代表字段为枚举类型,lookup 代表字段为 lookup 类型,bool 代表字段为布尔类型 + *

示例值:enum + * + * @param fieldType + * @return + */ + public Builder fieldType(String fieldType) { + this.fieldType = fieldType; + return this; + } + + + /** + * 维度是否为必填 + *

示例值:true + * + * @param required + * @return + */ + public Builder required(Boolean required) { + this.required = required; + return this; + } + + + /** + * 枚举类型的维度对应的枚举值列表 + *

示例值: + * + * @param enumValue + * @return + */ + public Builder enumValue(Enum[] enumValue) { + this.enumValue = enumValue; + return this; + } + + + public Dimension build() { + return new Dimension(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DimensionInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DimensionInfo.java new file mode 100644 index 000000000..b8f576e15 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DimensionInfo.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class DimensionInfo { + /** + * 维度id + *

示例值:“123456” + */ + @SerializedName("id") + private String id; + /** + * 维度名称 + *

示例值: + */ + @SerializedName("name") + private I18n[] name; + + // builder 开始 + public DimensionInfo() { + } + + public DimensionInfo(Builder builder) { + /** + * 维度id + *

示例值:“123456” + */ + this.id = builder.id; + /** + * 维度名称 + *

示例值: + */ + this.name = builder.name; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public I18n[] getName() { + return this.name; + } + + public void setName(I18n[] name) { + this.name = name; + } + + public static class Builder { + /** + * 维度id + *

示例值:“123456” + */ + private String id; + /** + * 维度名称 + *

示例值: + */ + private I18n[] name; + + /** + * 维度id + *

示例值:“123456” + * + * @param id + * @return + */ + public Builder id(String id) { + this.id = id; + return this; + } + + + /** + * 维度名称 + *

示例值: + * + * @param name + * @return + */ + public Builder name(I18n[] name) { + this.name = name; + return this; + } + + + public DimensionInfo build() { + return new DimensionInfo(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DimensionValue.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DimensionValue.java new file mode 100644 index 000000000..eeeb7c762 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/DimensionValue.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class DimensionValue { + /** + * API name + *

示例值:asdasdsa + */ + @SerializedName("dimension_api_name") + private String dimensionApiName; + /** + * 查询的维度值信息 + *

示例值: + */ + @SerializedName("dimension_value") + private CustomValue dimensionValue; + + // builder 开始 + public DimensionValue() { + } + + public DimensionValue(Builder builder) { + /** + * API name + *

示例值:asdasdsa + */ + this.dimensionApiName = builder.dimensionApiName; + /** + * 查询的维度值信息 + *

示例值: + */ + this.dimensionValue = builder.dimensionValue; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getDimensionApiName() { + return this.dimensionApiName; + } + + public void setDimensionApiName(String dimensionApiName) { + this.dimensionApiName = dimensionApiName; + } + + public CustomValue getDimensionValue() { + return this.dimensionValue; + } + + public void setDimensionValue(CustomValue dimensionValue) { + this.dimensionValue = dimensionValue; + } + + public static class Builder { + /** + * API name + *

示例值:asdasdsa + */ + private String dimensionApiName; + /** + * 查询的维度值信息 + *

示例值: + */ + private CustomValue dimensionValue; + + /** + * API name + *

示例值:asdasdsa + * + * @param dimensionApiName + * @return + */ + public Builder dimensionApiName(String dimensionApiName) { + this.dimensionApiName = dimensionApiName; + return this; + } + + + /** + * 查询的维度值信息 + *

示例值: + * + * @param dimensionValue + * @return + */ + public Builder dimensionValue(CustomValue dimensionValue) { + this.dimensionValue = dimensionValue; + return this; + } + + + public DimensionValue build() { + return new DimensionValue(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/District.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/District.java new file mode 100644 index 000000000..cb28975db --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/District.java @@ -0,0 +1,197 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class District { + /** + * 区/县 ID + *

示例值:6822114462122064111 + */ + @SerializedName("district_id") + private String districtId; + /** + * 名称 + *

示例值: + */ + @SerializedName("name") + private I18n[] name; + /** + * 所属城市 ID + *

示例值:6822114062155062211 + */ + @SerializedName("city_id") + private String cityId; + /** + * 状态 + *

示例值:1 + */ + @SerializedName("status") + private Integer status; + + // builder 开始 + public District() { + } + + public District(Builder builder) { + /** + * 区/县 ID + *

示例值:6822114462122064111 + */ + this.districtId = builder.districtId; + /** + * 名称 + *

示例值: + */ + this.name = builder.name; + /** + * 所属城市 ID + *

示例值:6822114062155062211 + */ + this.cityId = builder.cityId; + /** + * 状态 + *

示例值:1 + */ + this.status = builder.status; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getDistrictId() { + return this.districtId; + } + + public void setDistrictId(String districtId) { + this.districtId = districtId; + } + + public I18n[] getName() { + return this.name; + } + + public void setName(I18n[] name) { + this.name = name; + } + + public String getCityId() { + return this.cityId; + } + + public void setCityId(String cityId) { + this.cityId = cityId; + } + + public Integer getStatus() { + return this.status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public static class Builder { + /** + * 区/县 ID + *

示例值:6822114462122064111 + */ + private String districtId; + /** + * 名称 + *

示例值: + */ + private I18n[] name; + /** + * 所属城市 ID + *

示例值:6822114062155062211 + */ + private String cityId; + /** + * 状态 + *

示例值:1 + */ + private Integer status; + + /** + * 区/县 ID + *

示例值:6822114462122064111 + * + * @param districtId + * @return + */ + public Builder districtId(String districtId) { + this.districtId = districtId; + return this; + } + + + /** + * 名称 + *

示例值: + * + * @param name + * @return + */ + public Builder name(I18n[] name) { + this.name = name; + return this; + } + + + /** + * 所属城市 ID + *

示例值:6822114062155062211 + * + * @param cityId + * @return + */ + public Builder cityId(String cityId) { + this.cityId = cityId; + return this; + } + + + /** + * 状态 + *

示例值:1 + * + * @param status + * @return + */ + public Builder status(Integer status) { + this.status = status; + return this; + } + + /** + * 状态 + *

示例值:1 + * + * @param status {@link com.lark.oapi.service.corehr.v2.enums.DistrictBasicDataObjStatusEnum} + * @return + */ + public Builder status(com.lark.oapi.service.corehr.v2.enums.DistrictBasicDataObjStatusEnum status) { + this.status = status.getValue(); + return this; + } + + + public District build() { + return new District(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Education.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Education.java new file mode 100644 index 000000000..741429b77 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Education.java @@ -0,0 +1,444 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Education { + /** + * 学校 + *

示例值: + */ + @SerializedName("school") + private I18n[] school; + /** + * 学历 + *

示例值: + */ + @SerializedName("level_of_education") + private Enum levelOfEducation; + /** + * 开始日期 + *

示例值:2011-09-01 + */ + @SerializedName("start_date") + private String startDate; + /** + * 结束日期 + *

示例值:2015-06-30 + */ + @SerializedName("end_date") + private String endDate; + /** + * 专业 + *

示例值: + */ + @SerializedName("field_of_study") + private I18n[] fieldOfStudy; + /** + * 学位 + *

示例值: + */ + @SerializedName("degree") + private Enum degree; + /** + * 学校名称 + *

示例值: + */ + @SerializedName("school_name") + private Enum schoolName; + /** + * 专业名称 + *

示例值: + */ + @SerializedName("field_of_study_name") + private Enum fieldOfStudyName; + /** + * 国家地区ID + *

示例值:1 + */ + @SerializedName("country_region_id") + private String countryRegionId; + /** + * 预期结束日期 + *

示例值:2011-09-01 + */ + @SerializedName("expected_end_date") + private String expectedEndDate; + /** + * 自定义字段 + *

示例值: + */ + @SerializedName("custom_fields") + private CustomFieldData[] customFields; + + // builder 开始 + public Education() { + } + + public Education(Builder builder) { + /** + * 学校 + *

示例值: + */ + this.school = builder.school; + /** + * 学历 + *

示例值: + */ + this.levelOfEducation = builder.levelOfEducation; + /** + * 开始日期 + *

示例值:2011-09-01 + */ + this.startDate = builder.startDate; + /** + * 结束日期 + *

示例值:2015-06-30 + */ + this.endDate = builder.endDate; + /** + * 专业 + *

示例值: + */ + this.fieldOfStudy = builder.fieldOfStudy; + /** + * 学位 + *

示例值: + */ + this.degree = builder.degree; + /** + * 学校名称 + *

示例值: + */ + this.schoolName = builder.schoolName; + /** + * 专业名称 + *

示例值: + */ + this.fieldOfStudyName = builder.fieldOfStudyName; + /** + * 国家地区ID + *

示例值:1 + */ + this.countryRegionId = builder.countryRegionId; + /** + * 预期结束日期 + *

示例值:2011-09-01 + */ + this.expectedEndDate = builder.expectedEndDate; + /** + * 自定义字段 + *

示例值: + */ + this.customFields = builder.customFields; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public I18n[] getSchool() { + return this.school; + } + + public void setSchool(I18n[] school) { + this.school = school; + } + + public Enum getLevelOfEducation() { + return this.levelOfEducation; + } + + public void setLevelOfEducation(Enum levelOfEducation) { + this.levelOfEducation = levelOfEducation; + } + + public String getStartDate() { + return this.startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return this.endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public I18n[] getFieldOfStudy() { + return this.fieldOfStudy; + } + + public void setFieldOfStudy(I18n[] fieldOfStudy) { + this.fieldOfStudy = fieldOfStudy; + } + + public Enum getDegree() { + return this.degree; + } + + public void setDegree(Enum degree) { + this.degree = degree; + } + + public Enum getSchoolName() { + return this.schoolName; + } + + public void setSchoolName(Enum schoolName) { + this.schoolName = schoolName; + } + + public Enum getFieldOfStudyName() { + return this.fieldOfStudyName; + } + + public void setFieldOfStudyName(Enum fieldOfStudyName) { + this.fieldOfStudyName = fieldOfStudyName; + } + + public String getCountryRegionId() { + return this.countryRegionId; + } + + public void setCountryRegionId(String countryRegionId) { + this.countryRegionId = countryRegionId; + } + + public String getExpectedEndDate() { + return this.expectedEndDate; + } + + public void setExpectedEndDate(String expectedEndDate) { + this.expectedEndDate = expectedEndDate; + } + + public CustomFieldData[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(CustomFieldData[] customFields) { + this.customFields = customFields; + } + + public static class Builder { + /** + * 学校 + *

示例值: + */ + private I18n[] school; + /** + * 学历 + *

示例值: + */ + private Enum levelOfEducation; + /** + * 开始日期 + *

示例值:2011-09-01 + */ + private String startDate; + /** + * 结束日期 + *

示例值:2015-06-30 + */ + private String endDate; + /** + * 专业 + *

示例值: + */ + private I18n[] fieldOfStudy; + /** + * 学位 + *

示例值: + */ + private Enum degree; + /** + * 学校名称 + *

示例值: + */ + private Enum schoolName; + /** + * 专业名称 + *

示例值: + */ + private Enum fieldOfStudyName; + /** + * 国家地区ID + *

示例值:1 + */ + private String countryRegionId; + /** + * 预期结束日期 + *

示例值:2011-09-01 + */ + private String expectedEndDate; + /** + * 自定义字段 + *

示例值: + */ + private CustomFieldData[] customFields; + + /** + * 学校 + *

示例值: + * + * @param school + * @return + */ + public Builder school(I18n[] school) { + this.school = school; + return this; + } + + + /** + * 学历 + *

示例值: + * + * @param levelOfEducation + * @return + */ + public Builder levelOfEducation(Enum levelOfEducation) { + this.levelOfEducation = levelOfEducation; + return this; + } + + + /** + * 开始日期 + *

示例值:2011-09-01 + * + * @param startDate + * @return + */ + public Builder startDate(String startDate) { + this.startDate = startDate; + return this; + } + + + /** + * 结束日期 + *

示例值:2015-06-30 + * + * @param endDate + * @return + */ + public Builder endDate(String endDate) { + this.endDate = endDate; + return this; + } + + + /** + * 专业 + *

示例值: + * + * @param fieldOfStudy + * @return + */ + public Builder fieldOfStudy(I18n[] fieldOfStudy) { + this.fieldOfStudy = fieldOfStudy; + return this; + } + + + /** + * 学位 + *

示例值: + * + * @param degree + * @return + */ + public Builder degree(Enum degree) { + this.degree = degree; + return this; + } + + + /** + * 学校名称 + *

示例值: + * + * @param schoolName + * @return + */ + public Builder schoolName(Enum schoolName) { + this.schoolName = schoolName; + return this; + } + + + /** + * 专业名称 + *

示例值: + * + * @param fieldOfStudyName + * @return + */ + public Builder fieldOfStudyName(Enum fieldOfStudyName) { + this.fieldOfStudyName = fieldOfStudyName; + return this; + } + + + /** + * 国家地区ID + *

示例值:1 + * + * @param countryRegionId + * @return + */ + public Builder countryRegionId(String countryRegionId) { + this.countryRegionId = countryRegionId; + return this; + } + + + /** + * 预期结束日期 + *

示例值:2011-09-01 + * + * @param expectedEndDate + * @return + */ + public Builder expectedEndDate(String expectedEndDate) { + this.expectedEndDate = expectedEndDate; + return this; + } + + + /** + * 自定义字段 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(CustomFieldData[] customFields) { + this.customFields = customFields; + return this; + } + + + public Education build() { + return new Education(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EducationInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EducationInfo.java new file mode 100644 index 000000000..bd48d94c8 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EducationInfo.java @@ -0,0 +1,222 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class EducationInfo { + /** + * 学校名称 + *

示例值:长安大学 + */ + @SerializedName("school_name") + private String schoolName; + /** + * 学历 + *

示例值:phd + */ + @SerializedName("education") + private String education; + /** + * 开始时间 + *

示例值:2017-04-01 + */ + @SerializedName("start_time") + private String startTime; + /** + * 结束时间 + *

示例值:2018-04-01 + */ + @SerializedName("end_time") + private String endTime; + /** + * 专业 + *

示例值:医学影像技术 + */ + @SerializedName("field_of_study") + private String fieldOfStudy; + + // builder 开始 + public EducationInfo() { + } + + public EducationInfo(Builder builder) { + /** + * 学校名称 + *

示例值:长安大学 + */ + this.schoolName = builder.schoolName; + /** + * 学历 + *

示例值:phd + */ + this.education = builder.education; + /** + * 开始时间 + *

示例值:2017-04-01 + */ + this.startTime = builder.startTime; + /** + * 结束时间 + *

示例值:2018-04-01 + */ + this.endTime = builder.endTime; + /** + * 专业 + *

示例值:医学影像技术 + */ + this.fieldOfStudy = builder.fieldOfStudy; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getSchoolName() { + return this.schoolName; + } + + public void setSchoolName(String schoolName) { + this.schoolName = schoolName; + } + + public String getEducation() { + return this.education; + } + + public void setEducation(String education) { + this.education = education; + } + + public String getStartTime() { + return this.startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return this.endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public String getFieldOfStudy() { + return this.fieldOfStudy; + } + + public void setFieldOfStudy(String fieldOfStudy) { + this.fieldOfStudy = fieldOfStudy; + } + + public static class Builder { + /** + * 学校名称 + *

示例值:长安大学 + */ + private String schoolName; + /** + * 学历 + *

示例值:phd + */ + private String education; + /** + * 开始时间 + *

示例值:2017-04-01 + */ + private String startTime; + /** + * 结束时间 + *

示例值:2018-04-01 + */ + private String endTime; + /** + * 专业 + *

示例值:医学影像技术 + */ + private String fieldOfStudy; + + /** + * 学校名称 + *

示例值:长安大学 + * + * @param schoolName + * @return + */ + public Builder schoolName(String schoolName) { + this.schoolName = schoolName; + return this; + } + + + /** + * 学历 + *

示例值:phd + * + * @param education + * @return + */ + public Builder education(String education) { + this.education = education; + return this; + } + + + /** + * 开始时间 + *

示例值:2017-04-01 + * + * @param startTime + * @return + */ + public Builder startTime(String startTime) { + this.startTime = startTime; + return this; + } + + + /** + * 结束时间 + *

示例值:2018-04-01 + * + * @param endTime + * @return + */ + public Builder endTime(String endTime) { + this.endTime = endTime; + return this; + } + + + /** + * 专业 + *

示例值:医学影像技术 + * + * @param fieldOfStudy + * @return + */ + public Builder fieldOfStudy(String fieldOfStudy) { + this.fieldOfStudy = fieldOfStudy; + return this; + } + + + public EducationInfo build() { + return new EducationInfo(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Email.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Email.java new file mode 100644 index 000000000..ecfac6e92 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Email.java @@ -0,0 +1,185 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Email { + /** + * 邮箱地址 + *

示例值:1234567@bytedance.com + */ + @SerializedName("email") + private String email; + /** + * 是否为主要邮箱 + *

示例值:true + */ + @SerializedName("is_primary") + private Boolean isPrimary; + /** + * 是否为公开邮箱 + *

示例值:true + */ + @SerializedName("is_public") + private Boolean isPublic; + /** + * 邮箱用途,枚举值可通过文档【飞书人事枚举常量】邮箱用途(email_usage)枚举定义获得 + *

示例值: + */ + @SerializedName("email_usage") + private Enum emailUsage; + + // builder 开始 + public Email() { + } + + public Email(Builder builder) { + /** + * 邮箱地址 + *

示例值:1234567@bytedance.com + */ + this.email = builder.email; + /** + * 是否为主要邮箱 + *

示例值:true + */ + this.isPrimary = builder.isPrimary; + /** + * 是否为公开邮箱 + *

示例值:true + */ + this.isPublic = builder.isPublic; + /** + * 邮箱用途,枚举值可通过文档【飞书人事枚举常量】邮箱用途(email_usage)枚举定义获得 + *

示例值: + */ + this.emailUsage = builder.emailUsage; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getEmail() { + return this.email; + } + + public void setEmail(String email) { + this.email = email; + } + + public Boolean getIsPrimary() { + return this.isPrimary; + } + + public void setIsPrimary(Boolean isPrimary) { + this.isPrimary = isPrimary; + } + + public Boolean getIsPublic() { + return this.isPublic; + } + + public void setIsPublic(Boolean isPublic) { + this.isPublic = isPublic; + } + + public Enum getEmailUsage() { + return this.emailUsage; + } + + public void setEmailUsage(Enum emailUsage) { + this.emailUsage = emailUsage; + } + + public static class Builder { + /** + * 邮箱地址 + *

示例值:1234567@bytedance.com + */ + private String email; + /** + * 是否为主要邮箱 + *

示例值:true + */ + private Boolean isPrimary; + /** + * 是否为公开邮箱 + *

示例值:true + */ + private Boolean isPublic; + /** + * 邮箱用途,枚举值可通过文档【飞书人事枚举常量】邮箱用途(email_usage)枚举定义获得 + *

示例值: + */ + private Enum emailUsage; + + /** + * 邮箱地址 + *

示例值:1234567@bytedance.com + * + * @param email + * @return + */ + public Builder email(String email) { + this.email = email; + return this; + } + + + /** + * 是否为主要邮箱 + *

示例值:true + * + * @param isPrimary + * @return + */ + public Builder isPrimary(Boolean isPrimary) { + this.isPrimary = isPrimary; + return this; + } + + + /** + * 是否为公开邮箱 + *

示例值:true + * + * @param isPublic + * @return + */ + public Builder isPublic(Boolean isPublic) { + this.isPublic = isPublic; + return this; + } + + + /** + * 邮箱用途,枚举值可通过文档【飞书人事枚举常量】邮箱用途(email_usage)枚举定义获得 + *

示例值: + * + * @param emailUsage + * @return + */ + public Builder emailUsage(Enum emailUsage) { + this.emailUsage = emailUsage; + return this; + } + + + public Email build() { + return new Email(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EmergencyContact.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EmergencyContact.java new file mode 100644 index 000000000..7501a7294 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EmergencyContact.java @@ -0,0 +1,259 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class EmergencyContact { + /** + * 姓名 + *

示例值: + */ + @SerializedName("name") + private PersonName name; + /** + * 关系 + *

示例值: + */ + @SerializedName("relationship") + private Enum relationship; + /** + * 电话 + *

示例值: + */ + @SerializedName("phone_ist") + private Phone[] phoneIst; + /** + * 电话 + *

示例值: + */ + @SerializedName("phone_list") + private Phone[] phoneList; + /** + * 法定姓名 + *

示例值:张三 + */ + @SerializedName("legal_name") + private String legalName; + /** + * 自定义字段 + *

示例值: + */ + @SerializedName("custom_fields") + private CustomFieldData[] customFields; + + // builder 开始 + public EmergencyContact() { + } + + public EmergencyContact(Builder builder) { + /** + * 姓名 + *

示例值: + */ + this.name = builder.name; + /** + * 关系 + *

示例值: + */ + this.relationship = builder.relationship; + /** + * 电话 + *

示例值: + */ + this.phoneIst = builder.phoneIst; + /** + * 电话 + *

示例值: + */ + this.phoneList = builder.phoneList; + /** + * 法定姓名 + *

示例值:张三 + */ + this.legalName = builder.legalName; + /** + * 自定义字段 + *

示例值: + */ + this.customFields = builder.customFields; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public PersonName getName() { + return this.name; + } + + public void setName(PersonName name) { + this.name = name; + } + + public Enum getRelationship() { + return this.relationship; + } + + public void setRelationship(Enum relationship) { + this.relationship = relationship; + } + + public Phone[] getPhoneIst() { + return this.phoneIst; + } + + public void setPhoneIst(Phone[] phoneIst) { + this.phoneIst = phoneIst; + } + + public Phone[] getPhoneList() { + return this.phoneList; + } + + public void setPhoneList(Phone[] phoneList) { + this.phoneList = phoneList; + } + + public String getLegalName() { + return this.legalName; + } + + public void setLegalName(String legalName) { + this.legalName = legalName; + } + + public CustomFieldData[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(CustomFieldData[] customFields) { + this.customFields = customFields; + } + + public static class Builder { + /** + * 姓名 + *

示例值: + */ + private PersonName name; + /** + * 关系 + *

示例值: + */ + private Enum relationship; + /** + * 电话 + *

示例值: + */ + private Phone[] phoneIst; + /** + * 电话 + *

示例值: + */ + private Phone[] phoneList; + /** + * 法定姓名 + *

示例值:张三 + */ + private String legalName; + /** + * 自定义字段 + *

示例值: + */ + private CustomFieldData[] customFields; + + /** + * 姓名 + *

示例值: + * + * @param name + * @return + */ + public Builder name(PersonName name) { + this.name = name; + return this; + } + + + /** + * 关系 + *

示例值: + * + * @param relationship + * @return + */ + public Builder relationship(Enum relationship) { + this.relationship = relationship; + return this; + } + + + /** + * 电话 + *

示例值: + * + * @param phoneIst + * @return + */ + public Builder phoneIst(Phone[] phoneIst) { + this.phoneIst = phoneIst; + return this; + } + + + /** + * 电话 + *

示例值: + * + * @param phoneList + * @return + */ + public Builder phoneList(Phone[] phoneList) { + this.phoneList = phoneList; + return this; + } + + + /** + * 法定姓名 + *

示例值:张三 + * + * @param legalName + * @return + */ + public Builder legalName(String legalName) { + this.legalName = legalName; + return this; + } + + + /** + * 自定义字段 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(CustomFieldData[] customFields) { + this.customFields = customFields; + return this; + } + + + public EmergencyContact build() { + return new EmergencyContact(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Employee.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Employee.java new file mode 100644 index 000000000..9cd4a624f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Employee.java @@ -0,0 +1,1924 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Employee { + /** + * 雇佣 ID + *

示例值:6893014062142064135 + */ + @SerializedName("employment_id") + private String employmentId; + /** + * 招聘投递 ID ,详细信息可以通过【获取投递信息】接口查询获得 + *

示例值:6838119494196871234 + */ + @SerializedName("ats_application_id") + private String atsApplicationId; + /** + * 待入职 ID + *

示例值:7023239238976141133 + */ + @SerializedName("prehire_id") + private String prehireId; + /** + * 工号 + *

示例值:1000000 + */ + @SerializedName("employee_number") + private String employeeNumber; + /** + * 人员类型 ID,详细信息可通过【查询单个人员类型】接口获得 + *

示例值:6971090097697521314 + */ + @SerializedName("employee_type_id") + private String employeeTypeId; + /** + * 部门 ID,详细信息可通过【查询单个部门】接口获得 + *

示例值:6893014062142064135 + */ + @SerializedName("department_id") + private String departmentId; + /** + * 职级 ID,详细信息可通过【查询单个职务级别】接口获得 + *

示例值:6893014062142064135 + */ + @SerializedName("job_level_id") + private String jobLevelId; + /** + * 职等 ID + *

示例值:6893014062142064135 + */ + @SerializedName("job_grade_id") + private String jobGradeId; + /** + * 工作地点 ID,详细信息可通过【查询单个地点】接口获得 + *

示例值:6893014062142064135 + */ + @SerializedName("work_location_id") + private String workLocationId; + /** + * 序列 ID,详细信息可通过【查询单个职务序列】接口获得 + *

示例值:6893014062142064135 + */ + @SerializedName("job_family_id") + private String jobFamilyId; + /** + * 职务 ID,详细信息可通过【查询单个职务】接口获得 + *

示例值:6893014062142064135 + */ + @SerializedName("job_id") + private String jobId; + /** + * 所属公司 ID,详细信息可通过【查询单个公司】接口获得 + *

示例值:6893014062142064135 + */ + @SerializedName("company_id") + private String companyId; + /** + * 工时制度 ID,详细信息可通过【查询单个工时制度】接口获得 + *

示例值:6893014062142064135 + */ + @SerializedName("working_hours_type_id") + private String workingHoursTypeId; + /** + * 司龄 + *

示例值:0.01 + */ + @SerializedName("tenure") + private String tenure; + /** + * 资历起算日期 + *

示例值:2021-03-16 + */ + @SerializedName("seniority_date") + private String seniorityDate; + /** + * 当前雇佣记录的入职日期 + *

示例值:2021-03-16 + */ + @SerializedName("effective_date") + private String effectiveDate; + /** + * 是否是主雇佣信息 + *

示例值:true + */ + @SerializedName("primary_employment") + private Boolean primaryEmployment; + /** + * 试用期时长(月) + *

示例值:16 + */ + @SerializedName("probation_period") + private Integer probationPeriod; + /** + * 是否在试用期中 + *

示例值:true + */ + @SerializedName("on_probation") + private Boolean onProbation; + /** + * 试用期结束日期(实际结束日期) + *

示例值:2022-08-01 + */ + @SerializedName("probation_end_date") + private String probationEndDate; + /** + * 直接上级的雇佣 ID + *

示例值:7027024823985411287 + */ + @SerializedName("direct_manager_id") + private String directManagerId; + /** + * 虚线上级的雇佣 ID + *

示例值:7027024823985411782 + */ + @SerializedName("dotted_line_manager_id") + private String dottedLineManagerId; + /** + * 雇佣类型,枚举值可通过文档【飞书人事枚举常量】雇佣类型(employment_type)枚举定义获得 + *

示例值: + */ + @SerializedName("employment_type") + private Enum employmentType; + /** + * 雇佣状态,枚举值可通过文档【飞书人事枚举常量】雇员状态(employment_status)枚举定义获得 + *

示例值: + */ + @SerializedName("employment_status") + private Enum employmentStatus; + /** + * 离职日期,即员工的最后一个工作日,最后一个工作日时员工的雇佣状态仍为“在职”,次日凌晨将更改为“离职” + *

示例值:2022-08-16 + */ + @SerializedName("expiration_date") + private String expirationDate; + /** + * 离职原因,枚举值可通过文档【飞书人事枚举常量】离职原因(reason_for_offboarding)枚举定义部分获得 + *

示例值: + */ + @SerializedName("reason_for_offboarding") + private Enum reasonForOffboarding; + /** + * 邮箱地址 + *

示例值:test@163.com + */ + @SerializedName("email_address") + private String emailAddress; + /** + * 工作邮箱列表,只有当邮箱满足下面所有条件时,才在个人信息页面可见 + *

示例值: + */ + @SerializedName("work_email_list") + private WorkEmail[] workEmailList; + /** + * 成本中心列表 + *

示例值: + */ + @SerializedName("cost_center_list") + private JobDataCostCenter[] costCenterList; + /** + * 是否离职重聘 + *

示例值: + */ + @SerializedName("rehire") + private Enum rehire; + /** + * 历史雇佣信息 ID,可以通过【查询单个雇佣信息】查询详细信息 + *

示例值:7164286667866966659 + */ + @SerializedName("rehire_employment_id") + private String rehireEmploymentId; + /** + * 基本个人信息 + *

示例值: + */ + @SerializedName("person_info") + private PersonInfo personInfo; + /** + * 自定义字段 + *

示例值: + */ + @SerializedName("custom_fields") + private CustomFieldData[] customFields; + /** + * 竞业状态,枚举值包括:1.竞业中;2.未竞业 + *

示例值: + */ + @SerializedName("noncompete_status") + private Enum noncompeteStatus; + /** + * 是否历史离职人员 + *

示例值:true + */ + @SerializedName("past_offboarding") + private Boolean pastOffboarding; + /** + * 转正式日期 + *

示例值:2020-01-01 + */ + @SerializedName("regular_employee_start_date") + private String regularEmployeeStartDate; + /** + * 外部系统 ID , 可存储租户系统中的员工 ID + *

示例值:10000000 + */ + @SerializedName("external_id") + private String externalId; + /** + * 入职次数 + *

示例值:16 + */ + @SerializedName("times_employed") + private Integer timesEmployed; + /** + * 招聘来源,枚举值 api_name 可通过【获取自定义字段详情】接口查询 + *

示例值: + */ + @SerializedName("recruitment_type") + private Enum recruitmentType; + /** + * 员工头像 + *

示例值:https://internal-api-lark-file.feishu-boe.cn/static-resource/v1/v2_a550d36b-28ef-48ad-9e50-58004beb386j~?image_size=noop&cut_type=&quality=&format=png&sticker_format=.webp + */ + @SerializedName("avatar_url") + private String avatarUrl; + /** + * 主合同 ID + *

示例值:7164286667866966659 + */ + @SerializedName("primary_contract_id") + private String primaryContractId; + /** + * 主合同开始日期 + *

示例值:2020-01-01 + */ + @SerializedName("contract_start_date") + private String contractStartDate; + /** + * 主合同到期日期 + *

示例值:2020-01-01 + */ + @SerializedName("contract_end_date") + private String contractEndDate; + /** + * 主合同预计到期日期 + *

示例值:2020-01-01 + */ + @SerializedName("contract_expected_end_date") + private String contractExpectedEndDate; + /** + * 所属薪资组 ID + *

示例值:7164286667866966659 + */ + @SerializedName("pay_group_id") + private String payGroupId; + /** + * 是否外派 + *

示例值:true + */ + @SerializedName("international_assignment") + private Boolean internationalAssignment; + /** + * 工作日历 ID + *

示例值:7164286667866966659 + */ + @SerializedName("work_calendar_id") + private String workCalendarId; + /** + * 部门基本信息 + *

示例值: + */ + @SerializedName("department") + private BasicDepartment department; + /** + * 直接上级基本信息 + *

示例值: + */ + @SerializedName("direct_manager") + private BasicEmployee directManager; + /** + * 虚线上级基本信息 + *

示例值: + */ + @SerializedName("dotted_line_manager") + private BasicEmployee dottedLineManager; + /** + * 时区 + *

示例值:Asia/Shanghai + */ + @SerializedName("time_zone") + private String timeZone; + + // builder 开始 + public Employee() { + } + + public Employee(Builder builder) { + /** + * 雇佣 ID + *

示例值:6893014062142064135 + */ + this.employmentId = builder.employmentId; + /** + * 招聘投递 ID ,详细信息可以通过【获取投递信息】接口查询获得 + *

示例值:6838119494196871234 + */ + this.atsApplicationId = builder.atsApplicationId; + /** + * 待入职 ID + *

示例值:7023239238976141133 + */ + this.prehireId = builder.prehireId; + /** + * 工号 + *

示例值:1000000 + */ + this.employeeNumber = builder.employeeNumber; + /** + * 人员类型 ID,详细信息可通过【查询单个人员类型】接口获得 + *

示例值:6971090097697521314 + */ + this.employeeTypeId = builder.employeeTypeId; + /** + * 部门 ID,详细信息可通过【查询单个部门】接口获得 + *

示例值:6893014062142064135 + */ + this.departmentId = builder.departmentId; + /** + * 职级 ID,详细信息可通过【查询单个职务级别】接口获得 + *

示例值:6893014062142064135 + */ + this.jobLevelId = builder.jobLevelId; + /** + * 职等 ID + *

示例值:6893014062142064135 + */ + this.jobGradeId = builder.jobGradeId; + /** + * 工作地点 ID,详细信息可通过【查询单个地点】接口获得 + *

示例值:6893014062142064135 + */ + this.workLocationId = builder.workLocationId; + /** + * 序列 ID,详细信息可通过【查询单个职务序列】接口获得 + *

示例值:6893014062142064135 + */ + this.jobFamilyId = builder.jobFamilyId; + /** + * 职务 ID,详细信息可通过【查询单个职务】接口获得 + *

示例值:6893014062142064135 + */ + this.jobId = builder.jobId; + /** + * 所属公司 ID,详细信息可通过【查询单个公司】接口获得 + *

示例值:6893014062142064135 + */ + this.companyId = builder.companyId; + /** + * 工时制度 ID,详细信息可通过【查询单个工时制度】接口获得 + *

示例值:6893014062142064135 + */ + this.workingHoursTypeId = builder.workingHoursTypeId; + /** + * 司龄 + *

示例值:0.01 + */ + this.tenure = builder.tenure; + /** + * 资历起算日期 + *

示例值:2021-03-16 + */ + this.seniorityDate = builder.seniorityDate; + /** + * 当前雇佣记录的入职日期 + *

示例值:2021-03-16 + */ + this.effectiveDate = builder.effectiveDate; + /** + * 是否是主雇佣信息 + *

示例值:true + */ + this.primaryEmployment = builder.primaryEmployment; + /** + * 试用期时长(月) + *

示例值:16 + */ + this.probationPeriod = builder.probationPeriod; + /** + * 是否在试用期中 + *

示例值:true + */ + this.onProbation = builder.onProbation; + /** + * 试用期结束日期(实际结束日期) + *

示例值:2022-08-01 + */ + this.probationEndDate = builder.probationEndDate; + /** + * 直接上级的雇佣 ID + *

示例值:7027024823985411287 + */ + this.directManagerId = builder.directManagerId; + /** + * 虚线上级的雇佣 ID + *

示例值:7027024823985411782 + */ + this.dottedLineManagerId = builder.dottedLineManagerId; + /** + * 雇佣类型,枚举值可通过文档【飞书人事枚举常量】雇佣类型(employment_type)枚举定义获得 + *

示例值: + */ + this.employmentType = builder.employmentType; + /** + * 雇佣状态,枚举值可通过文档【飞书人事枚举常量】雇员状态(employment_status)枚举定义获得 + *

示例值: + */ + this.employmentStatus = builder.employmentStatus; + /** + * 离职日期,即员工的最后一个工作日,最后一个工作日时员工的雇佣状态仍为“在职”,次日凌晨将更改为“离职” + *

示例值:2022-08-16 + */ + this.expirationDate = builder.expirationDate; + /** + * 离职原因,枚举值可通过文档【飞书人事枚举常量】离职原因(reason_for_offboarding)枚举定义部分获得 + *

示例值: + */ + this.reasonForOffboarding = builder.reasonForOffboarding; + /** + * 邮箱地址 + *

示例值:test@163.com + */ + this.emailAddress = builder.emailAddress; + /** + * 工作邮箱列表,只有当邮箱满足下面所有条件时,才在个人信息页面可见 + *

示例值: + */ + this.workEmailList = builder.workEmailList; + /** + * 成本中心列表 + *

示例值: + */ + this.costCenterList = builder.costCenterList; + /** + * 是否离职重聘 + *

示例值: + */ + this.rehire = builder.rehire; + /** + * 历史雇佣信息 ID,可以通过【查询单个雇佣信息】查询详细信息 + *

示例值:7164286667866966659 + */ + this.rehireEmploymentId = builder.rehireEmploymentId; + /** + * 基本个人信息 + *

示例值: + */ + this.personInfo = builder.personInfo; + /** + * 自定义字段 + *

示例值: + */ + this.customFields = builder.customFields; + /** + * 竞业状态,枚举值包括:1.竞业中;2.未竞业 + *

示例值: + */ + this.noncompeteStatus = builder.noncompeteStatus; + /** + * 是否历史离职人员 + *

示例值:true + */ + this.pastOffboarding = builder.pastOffboarding; + /** + * 转正式日期 + *

示例值:2020-01-01 + */ + this.regularEmployeeStartDate = builder.regularEmployeeStartDate; + /** + * 外部系统 ID , 可存储租户系统中的员工 ID + *

示例值:10000000 + */ + this.externalId = builder.externalId; + /** + * 入职次数 + *

示例值:16 + */ + this.timesEmployed = builder.timesEmployed; + /** + * 招聘来源,枚举值 api_name 可通过【获取自定义字段详情】接口查询 + *

示例值: + */ + this.recruitmentType = builder.recruitmentType; + /** + * 员工头像 + *

示例值:https://internal-api-lark-file.feishu-boe.cn/static-resource/v1/v2_a550d36b-28ef-48ad-9e50-58004beb386j~?image_size=noop&cut_type=&quality=&format=png&sticker_format=.webp + */ + this.avatarUrl = builder.avatarUrl; + /** + * 主合同 ID + *

示例值:7164286667866966659 + */ + this.primaryContractId = builder.primaryContractId; + /** + * 主合同开始日期 + *

示例值:2020-01-01 + */ + this.contractStartDate = builder.contractStartDate; + /** + * 主合同到期日期 + *

示例值:2020-01-01 + */ + this.contractEndDate = builder.contractEndDate; + /** + * 主合同预计到期日期 + *

示例值:2020-01-01 + */ + this.contractExpectedEndDate = builder.contractExpectedEndDate; + /** + * 所属薪资组 ID + *

示例值:7164286667866966659 + */ + this.payGroupId = builder.payGroupId; + /** + * 是否外派 + *

示例值:true + */ + this.internationalAssignment = builder.internationalAssignment; + /** + * 工作日历 ID + *

示例值:7164286667866966659 + */ + this.workCalendarId = builder.workCalendarId; + /** + * 部门基本信息 + *

示例值: + */ + this.department = builder.department; + /** + * 直接上级基本信息 + *

示例值: + */ + this.directManager = builder.directManager; + /** + * 虚线上级基本信息 + *

示例值: + */ + this.dottedLineManager = builder.dottedLineManager; + /** + * 时区 + *

示例值:Asia/Shanghai + */ + this.timeZone = builder.timeZone; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getEmploymentId() { + return this.employmentId; + } + + public void setEmploymentId(String employmentId) { + this.employmentId = employmentId; + } + + public String getAtsApplicationId() { + return this.atsApplicationId; + } + + public void setAtsApplicationId(String atsApplicationId) { + this.atsApplicationId = atsApplicationId; + } + + public String getPrehireId() { + return this.prehireId; + } + + public void setPrehireId(String prehireId) { + this.prehireId = prehireId; + } + + public String getEmployeeNumber() { + return this.employeeNumber; + } + + public void setEmployeeNumber(String employeeNumber) { + this.employeeNumber = employeeNumber; + } + + public String getEmployeeTypeId() { + return this.employeeTypeId; + } + + public void setEmployeeTypeId(String employeeTypeId) { + this.employeeTypeId = employeeTypeId; + } + + public String getDepartmentId() { + return this.departmentId; + } + + public void setDepartmentId(String departmentId) { + this.departmentId = departmentId; + } + + public String getJobLevelId() { + return this.jobLevelId; + } + + public void setJobLevelId(String jobLevelId) { + this.jobLevelId = jobLevelId; + } + + public String getJobGradeId() { + return this.jobGradeId; + } + + public void setJobGradeId(String jobGradeId) { + this.jobGradeId = jobGradeId; + } + + public String getWorkLocationId() { + return this.workLocationId; + } + + public void setWorkLocationId(String workLocationId) { + this.workLocationId = workLocationId; + } + + public String getJobFamilyId() { + return this.jobFamilyId; + } + + public void setJobFamilyId(String jobFamilyId) { + this.jobFamilyId = jobFamilyId; + } + + public String getJobId() { + return this.jobId; + } + + public void setJobId(String jobId) { + this.jobId = jobId; + } + + public String getCompanyId() { + return this.companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + public String getWorkingHoursTypeId() { + return this.workingHoursTypeId; + } + + public void setWorkingHoursTypeId(String workingHoursTypeId) { + this.workingHoursTypeId = workingHoursTypeId; + } + + public String getTenure() { + return this.tenure; + } + + public void setTenure(String tenure) { + this.tenure = tenure; + } + + public String getSeniorityDate() { + return this.seniorityDate; + } + + public void setSeniorityDate(String seniorityDate) { + this.seniorityDate = seniorityDate; + } + + public String getEffectiveDate() { + return this.effectiveDate; + } + + public void setEffectiveDate(String effectiveDate) { + this.effectiveDate = effectiveDate; + } + + public Boolean getPrimaryEmployment() { + return this.primaryEmployment; + } + + public void setPrimaryEmployment(Boolean primaryEmployment) { + this.primaryEmployment = primaryEmployment; + } + + public Integer getProbationPeriod() { + return this.probationPeriod; + } + + public void setProbationPeriod(Integer probationPeriod) { + this.probationPeriod = probationPeriod; + } + + public Boolean getOnProbation() { + return this.onProbation; + } + + public void setOnProbation(Boolean onProbation) { + this.onProbation = onProbation; + } + + public String getProbationEndDate() { + return this.probationEndDate; + } + + public void setProbationEndDate(String probationEndDate) { + this.probationEndDate = probationEndDate; + } + + public String getDirectManagerId() { + return this.directManagerId; + } + + public void setDirectManagerId(String directManagerId) { + this.directManagerId = directManagerId; + } + + public String getDottedLineManagerId() { + return this.dottedLineManagerId; + } + + public void setDottedLineManagerId(String dottedLineManagerId) { + this.dottedLineManagerId = dottedLineManagerId; + } + + public Enum getEmploymentType() { + return this.employmentType; + } + + public void setEmploymentType(Enum employmentType) { + this.employmentType = employmentType; + } + + public Enum getEmploymentStatus() { + return this.employmentStatus; + } + + public void setEmploymentStatus(Enum employmentStatus) { + this.employmentStatus = employmentStatus; + } + + public String getExpirationDate() { + return this.expirationDate; + } + + public void setExpirationDate(String expirationDate) { + this.expirationDate = expirationDate; + } + + public Enum getReasonForOffboarding() { + return this.reasonForOffboarding; + } + + public void setReasonForOffboarding(Enum reasonForOffboarding) { + this.reasonForOffboarding = reasonForOffboarding; + } + + public String getEmailAddress() { + return this.emailAddress; + } + + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + + public WorkEmail[] getWorkEmailList() { + return this.workEmailList; + } + + public void setWorkEmailList(WorkEmail[] workEmailList) { + this.workEmailList = workEmailList; + } + + public JobDataCostCenter[] getCostCenterList() { + return this.costCenterList; + } + + public void setCostCenterList(JobDataCostCenter[] costCenterList) { + this.costCenterList = costCenterList; + } + + public Enum getRehire() { + return this.rehire; + } + + public void setRehire(Enum rehire) { + this.rehire = rehire; + } + + public String getRehireEmploymentId() { + return this.rehireEmploymentId; + } + + public void setRehireEmploymentId(String rehireEmploymentId) { + this.rehireEmploymentId = rehireEmploymentId; + } + + public PersonInfo getPersonInfo() { + return this.personInfo; + } + + public void setPersonInfo(PersonInfo personInfo) { + this.personInfo = personInfo; + } + + public CustomFieldData[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(CustomFieldData[] customFields) { + this.customFields = customFields; + } + + public Enum getNoncompeteStatus() { + return this.noncompeteStatus; + } + + public void setNoncompeteStatus(Enum noncompeteStatus) { + this.noncompeteStatus = noncompeteStatus; + } + + public Boolean getPastOffboarding() { + return this.pastOffboarding; + } + + public void setPastOffboarding(Boolean pastOffboarding) { + this.pastOffboarding = pastOffboarding; + } + + public String getRegularEmployeeStartDate() { + return this.regularEmployeeStartDate; + } + + public void setRegularEmployeeStartDate(String regularEmployeeStartDate) { + this.regularEmployeeStartDate = regularEmployeeStartDate; + } + + public String getExternalId() { + return this.externalId; + } + + public void setExternalId(String externalId) { + this.externalId = externalId; + } + + public Integer getTimesEmployed() { + return this.timesEmployed; + } + + public void setTimesEmployed(Integer timesEmployed) { + this.timesEmployed = timesEmployed; + } + + public Enum getRecruitmentType() { + return this.recruitmentType; + } + + public void setRecruitmentType(Enum recruitmentType) { + this.recruitmentType = recruitmentType; + } + + public String getAvatarUrl() { + return this.avatarUrl; + } + + public void setAvatarUrl(String avatarUrl) { + this.avatarUrl = avatarUrl; + } + + public String getPrimaryContractId() { + return this.primaryContractId; + } + + public void setPrimaryContractId(String primaryContractId) { + this.primaryContractId = primaryContractId; + } + + public String getContractStartDate() { + return this.contractStartDate; + } + + public void setContractStartDate(String contractStartDate) { + this.contractStartDate = contractStartDate; + } + + public String getContractEndDate() { + return this.contractEndDate; + } + + public void setContractEndDate(String contractEndDate) { + this.contractEndDate = contractEndDate; + } + + public String getContractExpectedEndDate() { + return this.contractExpectedEndDate; + } + + public void setContractExpectedEndDate(String contractExpectedEndDate) { + this.contractExpectedEndDate = contractExpectedEndDate; + } + + public String getPayGroupId() { + return this.payGroupId; + } + + public void setPayGroupId(String payGroupId) { + this.payGroupId = payGroupId; + } + + public Boolean getInternationalAssignment() { + return this.internationalAssignment; + } + + public void setInternationalAssignment(Boolean internationalAssignment) { + this.internationalAssignment = internationalAssignment; + } + + public String getWorkCalendarId() { + return this.workCalendarId; + } + + public void setWorkCalendarId(String workCalendarId) { + this.workCalendarId = workCalendarId; + } + + public BasicDepartment getDepartment() { + return this.department; + } + + public void setDepartment(BasicDepartment department) { + this.department = department; + } + + public BasicEmployee getDirectManager() { + return this.directManager; + } + + public void setDirectManager(BasicEmployee directManager) { + this.directManager = directManager; + } + + public BasicEmployee getDottedLineManager() { + return this.dottedLineManager; + } + + public void setDottedLineManager(BasicEmployee dottedLineManager) { + this.dottedLineManager = dottedLineManager; + } + + public String getTimeZone() { + return this.timeZone; + } + + public void setTimeZone(String timeZone) { + this.timeZone = timeZone; + } + + public static class Builder { + /** + * 雇佣 ID + *

示例值:6893014062142064135 + */ + private String employmentId; + /** + * 招聘投递 ID ,详细信息可以通过【获取投递信息】接口查询获得 + *

示例值:6838119494196871234 + */ + private String atsApplicationId; + /** + * 待入职 ID + *

示例值:7023239238976141133 + */ + private String prehireId; + /** + * 工号 + *

示例值:1000000 + */ + private String employeeNumber; + /** + * 人员类型 ID,详细信息可通过【查询单个人员类型】接口获得 + *

示例值:6971090097697521314 + */ + private String employeeTypeId; + /** + * 部门 ID,详细信息可通过【查询单个部门】接口获得 + *

示例值:6893014062142064135 + */ + private String departmentId; + /** + * 职级 ID,详细信息可通过【查询单个职务级别】接口获得 + *

示例值:6893014062142064135 + */ + private String jobLevelId; + /** + * 职等 ID + *

示例值:6893014062142064135 + */ + private String jobGradeId; + /** + * 工作地点 ID,详细信息可通过【查询单个地点】接口获得 + *

示例值:6893014062142064135 + */ + private String workLocationId; + /** + * 序列 ID,详细信息可通过【查询单个职务序列】接口获得 + *

示例值:6893014062142064135 + */ + private String jobFamilyId; + /** + * 职务 ID,详细信息可通过【查询单个职务】接口获得 + *

示例值:6893014062142064135 + */ + private String jobId; + /** + * 所属公司 ID,详细信息可通过【查询单个公司】接口获得 + *

示例值:6893014062142064135 + */ + private String companyId; + /** + * 工时制度 ID,详细信息可通过【查询单个工时制度】接口获得 + *

示例值:6893014062142064135 + */ + private String workingHoursTypeId; + /** + * 司龄 + *

示例值:0.01 + */ + private String tenure; + /** + * 资历起算日期 + *

示例值:2021-03-16 + */ + private String seniorityDate; + /** + * 当前雇佣记录的入职日期 + *

示例值:2021-03-16 + */ + private String effectiveDate; + /** + * 是否是主雇佣信息 + *

示例值:true + */ + private Boolean primaryEmployment; + /** + * 试用期时长(月) + *

示例值:16 + */ + private Integer probationPeriod; + /** + * 是否在试用期中 + *

示例值:true + */ + private Boolean onProbation; + /** + * 试用期结束日期(实际结束日期) + *

示例值:2022-08-01 + */ + private String probationEndDate; + /** + * 直接上级的雇佣 ID + *

示例值:7027024823985411287 + */ + private String directManagerId; + /** + * 虚线上级的雇佣 ID + *

示例值:7027024823985411782 + */ + private String dottedLineManagerId; + /** + * 雇佣类型,枚举值可通过文档【飞书人事枚举常量】雇佣类型(employment_type)枚举定义获得 + *

示例值: + */ + private Enum employmentType; + /** + * 雇佣状态,枚举值可通过文档【飞书人事枚举常量】雇员状态(employment_status)枚举定义获得 + *

示例值: + */ + private Enum employmentStatus; + /** + * 离职日期,即员工的最后一个工作日,最后一个工作日时员工的雇佣状态仍为“在职”,次日凌晨将更改为“离职” + *

示例值:2022-08-16 + */ + private String expirationDate; + /** + * 离职原因,枚举值可通过文档【飞书人事枚举常量】离职原因(reason_for_offboarding)枚举定义部分获得 + *

示例值: + */ + private Enum reasonForOffboarding; + /** + * 邮箱地址 + *

示例值:test@163.com + */ + private String emailAddress; + /** + * 工作邮箱列表,只有当邮箱满足下面所有条件时,才在个人信息页面可见 + *

示例值: + */ + private WorkEmail[] workEmailList; + /** + * 成本中心列表 + *

示例值: + */ + private JobDataCostCenter[] costCenterList; + /** + * 是否离职重聘 + *

示例值: + */ + private Enum rehire; + /** + * 历史雇佣信息 ID,可以通过【查询单个雇佣信息】查询详细信息 + *

示例值:7164286667866966659 + */ + private String rehireEmploymentId; + /** + * 基本个人信息 + *

示例值: + */ + private PersonInfo personInfo; + /** + * 自定义字段 + *

示例值: + */ + private CustomFieldData[] customFields; + /** + * 竞业状态,枚举值包括:1.竞业中;2.未竞业 + *

示例值: + */ + private Enum noncompeteStatus; + /** + * 是否历史离职人员 + *

示例值:true + */ + private Boolean pastOffboarding; + /** + * 转正式日期 + *

示例值:2020-01-01 + */ + private String regularEmployeeStartDate; + /** + * 外部系统 ID , 可存储租户系统中的员工 ID + *

示例值:10000000 + */ + private String externalId; + /** + * 入职次数 + *

示例值:16 + */ + private Integer timesEmployed; + /** + * 招聘来源,枚举值 api_name 可通过【获取自定义字段详情】接口查询 + *

示例值: + */ + private Enum recruitmentType; + /** + * 员工头像 + *

示例值:https://internal-api-lark-file.feishu-boe.cn/static-resource/v1/v2_a550d36b-28ef-48ad-9e50-58004beb386j~?image_size=noop&cut_type=&quality=&format=png&sticker_format=.webp + */ + private String avatarUrl; + /** + * 主合同 ID + *

示例值:7164286667866966659 + */ + private String primaryContractId; + /** + * 主合同开始日期 + *

示例值:2020-01-01 + */ + private String contractStartDate; + /** + * 主合同到期日期 + *

示例值:2020-01-01 + */ + private String contractEndDate; + /** + * 主合同预计到期日期 + *

示例值:2020-01-01 + */ + private String contractExpectedEndDate; + /** + * 所属薪资组 ID + *

示例值:7164286667866966659 + */ + private String payGroupId; + /** + * 是否外派 + *

示例值:true + */ + private Boolean internationalAssignment; + /** + * 工作日历 ID + *

示例值:7164286667866966659 + */ + private String workCalendarId; + /** + * 部门基本信息 + *

示例值: + */ + private BasicDepartment department; + /** + * 直接上级基本信息 + *

示例值: + */ + private BasicEmployee directManager; + /** + * 虚线上级基本信息 + *

示例值: + */ + private BasicEmployee dottedLineManager; + /** + * 时区 + *

示例值:Asia/Shanghai + */ + private String timeZone; + + /** + * 雇佣 ID + *

示例值:6893014062142064135 + * + * @param employmentId + * @return + */ + public Builder employmentId(String employmentId) { + this.employmentId = employmentId; + return this; + } + + + /** + * 招聘投递 ID ,详细信息可以通过【获取投递信息】接口查询获得 + *

示例值:6838119494196871234 + * + * @param atsApplicationId + * @return + */ + public Builder atsApplicationId(String atsApplicationId) { + this.atsApplicationId = atsApplicationId; + return this; + } + + + /** + * 待入职 ID + *

示例值:7023239238976141133 + * + * @param prehireId + * @return + */ + public Builder prehireId(String prehireId) { + this.prehireId = prehireId; + return this; + } + + + /** + * 工号 + *

示例值:1000000 + * + * @param employeeNumber + * @return + */ + public Builder employeeNumber(String employeeNumber) { + this.employeeNumber = employeeNumber; + return this; + } + + + /** + * 人员类型 ID,详细信息可通过【查询单个人员类型】接口获得 + *

示例值:6971090097697521314 + * + * @param employeeTypeId + * @return + */ + public Builder employeeTypeId(String employeeTypeId) { + this.employeeTypeId = employeeTypeId; + return this; + } + + + /** + * 部门 ID,详细信息可通过【查询单个部门】接口获得 + *

示例值:6893014062142064135 + * + * @param departmentId + * @return + */ + public Builder departmentId(String departmentId) { + this.departmentId = departmentId; + return this; + } + + + /** + * 职级 ID,详细信息可通过【查询单个职务级别】接口获得 + *

示例值:6893014062142064135 + * + * @param jobLevelId + * @return + */ + public Builder jobLevelId(String jobLevelId) { + this.jobLevelId = jobLevelId; + return this; + } + + + /** + * 职等 ID + *

示例值:6893014062142064135 + * + * @param jobGradeId + * @return + */ + public Builder jobGradeId(String jobGradeId) { + this.jobGradeId = jobGradeId; + return this; + } + + + /** + * 工作地点 ID,详细信息可通过【查询单个地点】接口获得 + *

示例值:6893014062142064135 + * + * @param workLocationId + * @return + */ + public Builder workLocationId(String workLocationId) { + this.workLocationId = workLocationId; + return this; + } + + + /** + * 序列 ID,详细信息可通过【查询单个职务序列】接口获得 + *

示例值:6893014062142064135 + * + * @param jobFamilyId + * @return + */ + public Builder jobFamilyId(String jobFamilyId) { + this.jobFamilyId = jobFamilyId; + return this; + } + + + /** + * 职务 ID,详细信息可通过【查询单个职务】接口获得 + *

示例值:6893014062142064135 + * + * @param jobId + * @return + */ + public Builder jobId(String jobId) { + this.jobId = jobId; + return this; + } + + + /** + * 所属公司 ID,详细信息可通过【查询单个公司】接口获得 + *

示例值:6893014062142064135 + * + * @param companyId + * @return + */ + public Builder companyId(String companyId) { + this.companyId = companyId; + return this; + } + + + /** + * 工时制度 ID,详细信息可通过【查询单个工时制度】接口获得 + *

示例值:6893014062142064135 + * + * @param workingHoursTypeId + * @return + */ + public Builder workingHoursTypeId(String workingHoursTypeId) { + this.workingHoursTypeId = workingHoursTypeId; + return this; + } + + + /** + * 司龄 + *

示例值:0.01 + * + * @param tenure + * @return + */ + public Builder tenure(String tenure) { + this.tenure = tenure; + return this; + } + + + /** + * 资历起算日期 + *

示例值:2021-03-16 + * + * @param seniorityDate + * @return + */ + public Builder seniorityDate(String seniorityDate) { + this.seniorityDate = seniorityDate; + return this; + } + + + /** + * 当前雇佣记录的入职日期 + *

示例值:2021-03-16 + * + * @param effectiveDate + * @return + */ + public Builder effectiveDate(String effectiveDate) { + this.effectiveDate = effectiveDate; + return this; + } + + + /** + * 是否是主雇佣信息 + *

示例值:true + * + * @param primaryEmployment + * @return + */ + public Builder primaryEmployment(Boolean primaryEmployment) { + this.primaryEmployment = primaryEmployment; + return this; + } + + + /** + * 试用期时长(月) + *

示例值:16 + * + * @param probationPeriod + * @return + */ + public Builder probationPeriod(Integer probationPeriod) { + this.probationPeriod = probationPeriod; + return this; + } + + + /** + * 是否在试用期中 + *

示例值:true + * + * @param onProbation + * @return + */ + public Builder onProbation(Boolean onProbation) { + this.onProbation = onProbation; + return this; + } + + + /** + * 试用期结束日期(实际结束日期) + *

示例值:2022-08-01 + * + * @param probationEndDate + * @return + */ + public Builder probationEndDate(String probationEndDate) { + this.probationEndDate = probationEndDate; + return this; + } + + + /** + * 直接上级的雇佣 ID + *

示例值:7027024823985411287 + * + * @param directManagerId + * @return + */ + public Builder directManagerId(String directManagerId) { + this.directManagerId = directManagerId; + return this; + } + + + /** + * 虚线上级的雇佣 ID + *

示例值:7027024823985411782 + * + * @param dottedLineManagerId + * @return + */ + public Builder dottedLineManagerId(String dottedLineManagerId) { + this.dottedLineManagerId = dottedLineManagerId; + return this; + } + + + /** + * 雇佣类型,枚举值可通过文档【飞书人事枚举常量】雇佣类型(employment_type)枚举定义获得 + *

示例值: + * + * @param employmentType + * @return + */ + public Builder employmentType(Enum employmentType) { + this.employmentType = employmentType; + return this; + } + + + /** + * 雇佣状态,枚举值可通过文档【飞书人事枚举常量】雇员状态(employment_status)枚举定义获得 + *

示例值: + * + * @param employmentStatus + * @return + */ + public Builder employmentStatus(Enum employmentStatus) { + this.employmentStatus = employmentStatus; + return this; + } + + + /** + * 离职日期,即员工的最后一个工作日,最后一个工作日时员工的雇佣状态仍为“在职”,次日凌晨将更改为“离职” + *

示例值:2022-08-16 + * + * @param expirationDate + * @return + */ + public Builder expirationDate(String expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + + /** + * 离职原因,枚举值可通过文档【飞书人事枚举常量】离职原因(reason_for_offboarding)枚举定义部分获得 + *

示例值: + * + * @param reasonForOffboarding + * @return + */ + public Builder reasonForOffboarding(Enum reasonForOffboarding) { + this.reasonForOffboarding = reasonForOffboarding; + return this; + } + + + /** + * 邮箱地址 + *

示例值:test@163.com + * + * @param emailAddress + * @return + */ + public Builder emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + + /** + * 工作邮箱列表,只有当邮箱满足下面所有条件时,才在个人信息页面可见 + *

示例值: + * + * @param workEmailList + * @return + */ + public Builder workEmailList(WorkEmail[] workEmailList) { + this.workEmailList = workEmailList; + return this; + } + + + /** + * 成本中心列表 + *

示例值: + * + * @param costCenterList + * @return + */ + public Builder costCenterList(JobDataCostCenter[] costCenterList) { + this.costCenterList = costCenterList; + return this; + } + + + /** + * 是否离职重聘 + *

示例值: + * + * @param rehire + * @return + */ + public Builder rehire(Enum rehire) { + this.rehire = rehire; + return this; + } + + + /** + * 历史雇佣信息 ID,可以通过【查询单个雇佣信息】查询详细信息 + *

示例值:7164286667866966659 + * + * @param rehireEmploymentId + * @return + */ + public Builder rehireEmploymentId(String rehireEmploymentId) { + this.rehireEmploymentId = rehireEmploymentId; + return this; + } + + + /** + * 基本个人信息 + *

示例值: + * + * @param personInfo + * @return + */ + public Builder personInfo(PersonInfo personInfo) { + this.personInfo = personInfo; + return this; + } + + + /** + * 自定义字段 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(CustomFieldData[] customFields) { + this.customFields = customFields; + return this; + } + + + /** + * 竞业状态,枚举值包括:1.竞业中;2.未竞业 + *

示例值: + * + * @param noncompeteStatus + * @return + */ + public Builder noncompeteStatus(Enum noncompeteStatus) { + this.noncompeteStatus = noncompeteStatus; + return this; + } + + + /** + * 是否历史离职人员 + *

示例值:true + * + * @param pastOffboarding + * @return + */ + public Builder pastOffboarding(Boolean pastOffboarding) { + this.pastOffboarding = pastOffboarding; + return this; + } + + + /** + * 转正式日期 + *

示例值:2020-01-01 + * + * @param regularEmployeeStartDate + * @return + */ + public Builder regularEmployeeStartDate(String regularEmployeeStartDate) { + this.regularEmployeeStartDate = regularEmployeeStartDate; + return this; + } + + + /** + * 外部系统 ID , 可存储租户系统中的员工 ID + *

示例值:10000000 + * + * @param externalId + * @return + */ + public Builder externalId(String externalId) { + this.externalId = externalId; + return this; + } + + + /** + * 入职次数 + *

示例值:16 + * + * @param timesEmployed + * @return + */ + public Builder timesEmployed(Integer timesEmployed) { + this.timesEmployed = timesEmployed; + return this; + } + + + /** + * 招聘来源,枚举值 api_name 可通过【获取自定义字段详情】接口查询 + *

示例值: + * + * @param recruitmentType + * @return + */ + public Builder recruitmentType(Enum recruitmentType) { + this.recruitmentType = recruitmentType; + return this; + } + + + /** + * 员工头像 + *

示例值:https://internal-api-lark-file.feishu-boe.cn/static-resource/v1/v2_a550d36b-28ef-48ad-9e50-58004beb386j~?image_size=noop&cut_type=&quality=&format=png&sticker_format=.webp + * + * @param avatarUrl + * @return + */ + public Builder avatarUrl(String avatarUrl) { + this.avatarUrl = avatarUrl; + return this; + } + + + /** + * 主合同 ID + *

示例值:7164286667866966659 + * + * @param primaryContractId + * @return + */ + public Builder primaryContractId(String primaryContractId) { + this.primaryContractId = primaryContractId; + return this; + } + + + /** + * 主合同开始日期 + *

示例值:2020-01-01 + * + * @param contractStartDate + * @return + */ + public Builder contractStartDate(String contractStartDate) { + this.contractStartDate = contractStartDate; + return this; + } + + + /** + * 主合同到期日期 + *

示例值:2020-01-01 + * + * @param contractEndDate + * @return + */ + public Builder contractEndDate(String contractEndDate) { + this.contractEndDate = contractEndDate; + return this; + } + + + /** + * 主合同预计到期日期 + *

示例值:2020-01-01 + * + * @param contractExpectedEndDate + * @return + */ + public Builder contractExpectedEndDate(String contractExpectedEndDate) { + this.contractExpectedEndDate = contractExpectedEndDate; + return this; + } + + + /** + * 所属薪资组 ID + *

示例值:7164286667866966659 + * + * @param payGroupId + * @return + */ + public Builder payGroupId(String payGroupId) { + this.payGroupId = payGroupId; + return this; + } + + + /** + * 是否外派 + *

示例值:true + * + * @param internationalAssignment + * @return + */ + public Builder internationalAssignment(Boolean internationalAssignment) { + this.internationalAssignment = internationalAssignment; + return this; + } + + + /** + * 工作日历 ID + *

示例值:7164286667866966659 + * + * @param workCalendarId + * @return + */ + public Builder workCalendarId(String workCalendarId) { + this.workCalendarId = workCalendarId; + return this; + } + + + /** + * 部门基本信息 + *

示例值: + * + * @param department + * @return + */ + public Builder department(BasicDepartment department) { + this.department = department; + return this; + } + + + /** + * 直接上级基本信息 + *

示例值: + * + * @param directManager + * @return + */ + public Builder directManager(BasicEmployee directManager) { + this.directManager = directManager; + return this; + } + + + /** + * 虚线上级基本信息 + *

示例值: + * + * @param dottedLineManager + * @return + */ + public Builder dottedLineManager(BasicEmployee dottedLineManager) { + this.dottedLineManager = dottedLineManager; + return this; + } + + + /** + * 时区 + *

示例值:Asia/Shanghai + * + * @param timeZone + * @return + */ + public Builder timeZone(String timeZone) { + this.timeZone = timeZone; + return this; + } + + + public Employee build() { + return new Employee(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EmployeeInternationalAssignment.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EmployeeInternationalAssignment.java new file mode 100644 index 000000000..b1a3935ed --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EmployeeInternationalAssignment.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class EmployeeInternationalAssignment { + /** + * Employment ID + *

示例值:6893014062142064135 + */ + @SerializedName("employment_id") + private String employmentId; + /** + * 派驻信息列表 + *

示例值: + */ + @SerializedName("international_assignments") + private InternationalAssignmentV2[] internationalAssignments; + + // builder 开始 + public EmployeeInternationalAssignment() { + } + + public EmployeeInternationalAssignment(Builder builder) { + /** + * Employment ID + *

示例值:6893014062142064135 + */ + this.employmentId = builder.employmentId; + /** + * 派驻信息列表 + *

示例值: + */ + this.internationalAssignments = builder.internationalAssignments; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getEmploymentId() { + return this.employmentId; + } + + public void setEmploymentId(String employmentId) { + this.employmentId = employmentId; + } + + public InternationalAssignmentV2[] getInternationalAssignments() { + return this.internationalAssignments; + } + + public void setInternationalAssignments(InternationalAssignmentV2[] internationalAssignments) { + this.internationalAssignments = internationalAssignments; + } + + public static class Builder { + /** + * Employment ID + *

示例值:6893014062142064135 + */ + private String employmentId; + /** + * 派驻信息列表 + *

示例值: + */ + private InternationalAssignmentV2[] internationalAssignments; + + /** + * Employment ID + *

示例值:6893014062142064135 + * + * @param employmentId + * @return + */ + public Builder employmentId(String employmentId) { + this.employmentId = employmentId; + return this; + } + + + /** + * 派驻信息列表 + *

示例值: + * + * @param internationalAssignments + * @return + */ + public Builder internationalAssignments(InternationalAssignmentV2[] internationalAssignments) { + this.internationalAssignments = internationalAssignments; + return this; + } + + + public EmployeeInternationalAssignment build() { + return new EmployeeInternationalAssignment(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EmployeeJobData.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EmployeeJobData.java new file mode 100644 index 000000000..4570850a6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EmployeeJobData.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class EmployeeJobData { + /** + * Employment ID + *

示例值:6893014062142064135 + */ + @SerializedName("employment_id") + private String employmentId; + /** + * 实体在 CoreHR 内部的唯一键 + *

示例值:6890452208593372679 + */ + @SerializedName("job_datas") + private JobData[] jobDatas; + + // builder 开始 + public EmployeeJobData() { + } + + public EmployeeJobData(Builder builder) { + /** + * Employment ID + *

示例值:6893014062142064135 + */ + this.employmentId = builder.employmentId; + /** + * 实体在 CoreHR 内部的唯一键 + *

示例值:6890452208593372679 + */ + this.jobDatas = builder.jobDatas; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getEmploymentId() { + return this.employmentId; + } + + public void setEmploymentId(String employmentId) { + this.employmentId = employmentId; + } + + public JobData[] getJobDatas() { + return this.jobDatas; + } + + public void setJobDatas(JobData[] jobDatas) { + this.jobDatas = jobDatas; + } + + public static class Builder { + /** + * Employment ID + *

示例值:6893014062142064135 + */ + private String employmentId; + /** + * 实体在 CoreHR 内部的唯一键 + *

示例值:6890452208593372679 + */ + private JobData[] jobDatas; + + /** + * Employment ID + *

示例值:6893014062142064135 + * + * @param employmentId + * @return + */ + public Builder employmentId(String employmentId) { + this.employmentId = employmentId; + return this; + } + + + /** + * 实体在 CoreHR 内部的唯一键 + *

示例值:6890452208593372679 + * + * @param jobDatas + * @return + */ + public Builder jobDatas(JobData[] jobDatas) { + this.jobDatas = jobDatas; + return this; + } + + + public EmployeeJobData build() { + return new EmployeeJobData(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Employment.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Employment.java new file mode 100644 index 000000000..60ea365e8 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Employment.java @@ -0,0 +1,1073 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Employment { + /** + * 待入职 ID + *

示例值:1 + */ + @SerializedName("prehire_id") + private String prehireId; + /** + * 人员类型 + *

示例值:1 + */ + @SerializedName("employee_type_id") + private String employeeTypeId; + /** + * 司龄 + *

示例值:1 + */ + @SerializedName("tenure") + private String tenure; + /** + * 部门 ID,枚举值及详细信息可通过【批量查询部门】接口查询获得 + *

示例值:6893014062142064135 + */ + @SerializedName("department_id") + private String departmentId; + /** + * 职级 ID,枚举值及详细信息可通过【批量查询职务级别】接口查询获得 + *

示例值:6893014062142064135 + */ + @SerializedName("job_level_id") + private String jobLevelId; + /** + * 工作地点 ID,枚举值及详细信息可通过【批量查询地点】接口查询获得 + *

示例值:6893014062142064135 + */ + @SerializedName("work_location_id") + private String workLocationId; + /** + * 职务序列 ID,枚举值及详细信息可通过【批量查询职务序列】接口查询获得 + *

示例值:6893014062142064135 + */ + @SerializedName("job_family_id") + private String jobFamilyId; + /** + * 职务 ID,枚举值及详细信息可通过【批量查询职务】接口查询获得 + *

示例值:6893014062142064135 + */ + @SerializedName("job_id") + private String jobId; + /** + * 法人主体 ID,枚举值及详细信息可通过【批量查询公司】接口查询获得 + *

示例值:6893014062142064135 + */ + @SerializedName("company_id") + private String companyId; + /** + * 工时制度 ID,枚举值及详细信息可通过【批量查询工时制度】接口查询获得 + *

示例值:6893014062142064135 + */ + @SerializedName("working_hours_type_id") + private String workingHoursTypeId; + /** + * 实体在飞书人事(企业版)内部的唯一键 + *

示例值:6893014062142064135 + */ + @SerializedName("id") + private String id; + /** + * 资历起算日期 + *

示例值:2020-01-01 + */ + @SerializedName("seniority_date") + private String seniorityDate; + /** + * 员工编号 + *

示例值:1000000 + */ + @SerializedName("employee_number") + private String employeeNumber; + /** + * 当前雇佣记录的入职日期 + *

示例值:2020-01-01 + */ + @SerializedName("effective_date") + private String effectiveDate; + /** + * 离职日期,即员工的最后一个工作日,最后一个工作日时员工的雇佣状态仍为“在职”,次日凌晨将更改为“离职” + *

示例值:2021-01-01 + */ + @SerializedName("expiration_date") + private String expirationDate; + /** + * 雇佣类型 + *

示例值: + */ + @SerializedName("employment_type") + private Enum employmentType; + /** + * 人员信息,引用 Person 的 ID + *

示例值:6919733936050406926 + */ + @SerializedName("person_id") + private String personId; + /** + * 试用期时长(月),试用期结束日期 - 试用期开始日期后取月数 + *

示例值:9999 + */ + @SerializedName("probation_period") + private Integer probationPeriod; + /** + * 是否在试用期中 + *

示例值:true + */ + @SerializedName("on_probation") + private String onProbation; + /** + * 试用期结束日期 + *

示例值:2022-01-01 + */ + @SerializedName("probation_end_date") + private String probationEndDate; + /** + * 是否是主雇佣信息 + *

示例值:true + */ + @SerializedName("primary_employment") + private Boolean primaryEmployment; + /** + * 雇员状态 + *

示例值: + */ + @SerializedName("employment_status") + private Enum employmentStatus; + /** + * 工作邮箱列表 + *

示例值: + */ + @SerializedName("work_email_list") + private Email[] workEmailList; + /** + * 邮箱 + *

示例值:test@163.com + */ + @SerializedName("email_address") + private String emailAddress; + /** + * 离职原因 + *

示例值: + */ + @SerializedName("reason_for_offboarding") + private Enum reasonForOffboarding; + /** + * 成本中心列表 + *

示例值: + */ + @SerializedName("cost_center_list") + private JobDataCostCenter[] costCenterList; + /** + * 招聘应用 ID + *

示例值:6838119494196871234 + */ + @SerializedName("ats_application_id") + private String atsApplicationId; + /** + * 自定义字段 + *

示例值: + */ + @SerializedName("custom_fields") + private ObjectFieldData[] customFields; + + // builder 开始 + public Employment() { + } + + public Employment(Builder builder) { + /** + * 待入职 ID + *

示例值:1 + */ + this.prehireId = builder.prehireId; + /** + * 人员类型 + *

示例值:1 + */ + this.employeeTypeId = builder.employeeTypeId; + /** + * 司龄 + *

示例值:1 + */ + this.tenure = builder.tenure; + /** + * 部门 ID,枚举值及详细信息可通过【批量查询部门】接口查询获得 + *

示例值:6893014062142064135 + */ + this.departmentId = builder.departmentId; + /** + * 职级 ID,枚举值及详细信息可通过【批量查询职务级别】接口查询获得 + *

示例值:6893014062142064135 + */ + this.jobLevelId = builder.jobLevelId; + /** + * 工作地点 ID,枚举值及详细信息可通过【批量查询地点】接口查询获得 + *

示例值:6893014062142064135 + */ + this.workLocationId = builder.workLocationId; + /** + * 职务序列 ID,枚举值及详细信息可通过【批量查询职务序列】接口查询获得 + *

示例值:6893014062142064135 + */ + this.jobFamilyId = builder.jobFamilyId; + /** + * 职务 ID,枚举值及详细信息可通过【批量查询职务】接口查询获得 + *

示例值:6893014062142064135 + */ + this.jobId = builder.jobId; + /** + * 法人主体 ID,枚举值及详细信息可通过【批量查询公司】接口查询获得 + *

示例值:6893014062142064135 + */ + this.companyId = builder.companyId; + /** + * 工时制度 ID,枚举值及详细信息可通过【批量查询工时制度】接口查询获得 + *

示例值:6893014062142064135 + */ + this.workingHoursTypeId = builder.workingHoursTypeId; + /** + * 实体在飞书人事(企业版)内部的唯一键 + *

示例值:6893014062142064135 + */ + this.id = builder.id; + /** + * 资历起算日期 + *

示例值:2020-01-01 + */ + this.seniorityDate = builder.seniorityDate; + /** + * 员工编号 + *

示例值:1000000 + */ + this.employeeNumber = builder.employeeNumber; + /** + * 当前雇佣记录的入职日期 + *

示例值:2020-01-01 + */ + this.effectiveDate = builder.effectiveDate; + /** + * 离职日期,即员工的最后一个工作日,最后一个工作日时员工的雇佣状态仍为“在职”,次日凌晨将更改为“离职” + *

示例值:2021-01-01 + */ + this.expirationDate = builder.expirationDate; + /** + * 雇佣类型 + *

示例值: + */ + this.employmentType = builder.employmentType; + /** + * 人员信息,引用 Person 的 ID + *

示例值:6919733936050406926 + */ + this.personId = builder.personId; + /** + * 试用期时长(月),试用期结束日期 - 试用期开始日期后取月数 + *

示例值:9999 + */ + this.probationPeriod = builder.probationPeriod; + /** + * 是否在试用期中 + *

示例值:true + */ + this.onProbation = builder.onProbation; + /** + * 试用期结束日期 + *

示例值:2022-01-01 + */ + this.probationEndDate = builder.probationEndDate; + /** + * 是否是主雇佣信息 + *

示例值:true + */ + this.primaryEmployment = builder.primaryEmployment; + /** + * 雇员状态 + *

示例值: + */ + this.employmentStatus = builder.employmentStatus; + /** + * 工作邮箱列表 + *

示例值: + */ + this.workEmailList = builder.workEmailList; + /** + * 邮箱 + *

示例值:test@163.com + */ + this.emailAddress = builder.emailAddress; + /** + * 离职原因 + *

示例值: + */ + this.reasonForOffboarding = builder.reasonForOffboarding; + /** + * 成本中心列表 + *

示例值: + */ + this.costCenterList = builder.costCenterList; + /** + * 招聘应用 ID + *

示例值:6838119494196871234 + */ + this.atsApplicationId = builder.atsApplicationId; + /** + * 自定义字段 + *

示例值: + */ + this.customFields = builder.customFields; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getPrehireId() { + return this.prehireId; + } + + public void setPrehireId(String prehireId) { + this.prehireId = prehireId; + } + + public String getEmployeeTypeId() { + return this.employeeTypeId; + } + + public void setEmployeeTypeId(String employeeTypeId) { + this.employeeTypeId = employeeTypeId; + } + + public String getTenure() { + return this.tenure; + } + + public void setTenure(String tenure) { + this.tenure = tenure; + } + + public String getDepartmentId() { + return this.departmentId; + } + + public void setDepartmentId(String departmentId) { + this.departmentId = departmentId; + } + + public String getJobLevelId() { + return this.jobLevelId; + } + + public void setJobLevelId(String jobLevelId) { + this.jobLevelId = jobLevelId; + } + + public String getWorkLocationId() { + return this.workLocationId; + } + + public void setWorkLocationId(String workLocationId) { + this.workLocationId = workLocationId; + } + + public String getJobFamilyId() { + return this.jobFamilyId; + } + + public void setJobFamilyId(String jobFamilyId) { + this.jobFamilyId = jobFamilyId; + } + + public String getJobId() { + return this.jobId; + } + + public void setJobId(String jobId) { + this.jobId = jobId; + } + + public String getCompanyId() { + return this.companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + public String getWorkingHoursTypeId() { + return this.workingHoursTypeId; + } + + public void setWorkingHoursTypeId(String workingHoursTypeId) { + this.workingHoursTypeId = workingHoursTypeId; + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public String getSeniorityDate() { + return this.seniorityDate; + } + + public void setSeniorityDate(String seniorityDate) { + this.seniorityDate = seniorityDate; + } + + public String getEmployeeNumber() { + return this.employeeNumber; + } + + public void setEmployeeNumber(String employeeNumber) { + this.employeeNumber = employeeNumber; + } + + public String getEffectiveDate() { + return this.effectiveDate; + } + + public void setEffectiveDate(String effectiveDate) { + this.effectiveDate = effectiveDate; + } + + public String getExpirationDate() { + return this.expirationDate; + } + + public void setExpirationDate(String expirationDate) { + this.expirationDate = expirationDate; + } + + public Enum getEmploymentType() { + return this.employmentType; + } + + public void setEmploymentType(Enum employmentType) { + this.employmentType = employmentType; + } + + public String getPersonId() { + return this.personId; + } + + public void setPersonId(String personId) { + this.personId = personId; + } + + public Integer getProbationPeriod() { + return this.probationPeriod; + } + + public void setProbationPeriod(Integer probationPeriod) { + this.probationPeriod = probationPeriod; + } + + public String getOnProbation() { + return this.onProbation; + } + + public void setOnProbation(String onProbation) { + this.onProbation = onProbation; + } + + public String getProbationEndDate() { + return this.probationEndDate; + } + + public void setProbationEndDate(String probationEndDate) { + this.probationEndDate = probationEndDate; + } + + public Boolean getPrimaryEmployment() { + return this.primaryEmployment; + } + + public void setPrimaryEmployment(Boolean primaryEmployment) { + this.primaryEmployment = primaryEmployment; + } + + public Enum getEmploymentStatus() { + return this.employmentStatus; + } + + public void setEmploymentStatus(Enum employmentStatus) { + this.employmentStatus = employmentStatus; + } + + public Email[] getWorkEmailList() { + return this.workEmailList; + } + + public void setWorkEmailList(Email[] workEmailList) { + this.workEmailList = workEmailList; + } + + public String getEmailAddress() { + return this.emailAddress; + } + + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + + public Enum getReasonForOffboarding() { + return this.reasonForOffboarding; + } + + public void setReasonForOffboarding(Enum reasonForOffboarding) { + this.reasonForOffboarding = reasonForOffboarding; + } + + public JobDataCostCenter[] getCostCenterList() { + return this.costCenterList; + } + + public void setCostCenterList(JobDataCostCenter[] costCenterList) { + this.costCenterList = costCenterList; + } + + public String getAtsApplicationId() { + return this.atsApplicationId; + } + + public void setAtsApplicationId(String atsApplicationId) { + this.atsApplicationId = atsApplicationId; + } + + public ObjectFieldData[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(ObjectFieldData[] customFields) { + this.customFields = customFields; + } + + public static class Builder { + /** + * 待入职 ID + *

示例值:1 + */ + private String prehireId; + /** + * 人员类型 + *

示例值:1 + */ + private String employeeTypeId; + /** + * 司龄 + *

示例值:1 + */ + private String tenure; + /** + * 部门 ID,枚举值及详细信息可通过【批量查询部门】接口查询获得 + *

示例值:6893014062142064135 + */ + private String departmentId; + /** + * 职级 ID,枚举值及详细信息可通过【批量查询职务级别】接口查询获得 + *

示例值:6893014062142064135 + */ + private String jobLevelId; + /** + * 工作地点 ID,枚举值及详细信息可通过【批量查询地点】接口查询获得 + *

示例值:6893014062142064135 + */ + private String workLocationId; + /** + * 职务序列 ID,枚举值及详细信息可通过【批量查询职务序列】接口查询获得 + *

示例值:6893014062142064135 + */ + private String jobFamilyId; + /** + * 职务 ID,枚举值及详细信息可通过【批量查询职务】接口查询获得 + *

示例值:6893014062142064135 + */ + private String jobId; + /** + * 法人主体 ID,枚举值及详细信息可通过【批量查询公司】接口查询获得 + *

示例值:6893014062142064135 + */ + private String companyId; + /** + * 工时制度 ID,枚举值及详细信息可通过【批量查询工时制度】接口查询获得 + *

示例值:6893014062142064135 + */ + private String workingHoursTypeId; + /** + * 实体在飞书人事(企业版)内部的唯一键 + *

示例值:6893014062142064135 + */ + private String id; + /** + * 资历起算日期 + *

示例值:2020-01-01 + */ + private String seniorityDate; + /** + * 员工编号 + *

示例值:1000000 + */ + private String employeeNumber; + /** + * 当前雇佣记录的入职日期 + *

示例值:2020-01-01 + */ + private String effectiveDate; + /** + * 离职日期,即员工的最后一个工作日,最后一个工作日时员工的雇佣状态仍为“在职”,次日凌晨将更改为“离职” + *

示例值:2021-01-01 + */ + private String expirationDate; + /** + * 雇佣类型 + *

示例值: + */ + private Enum employmentType; + /** + * 人员信息,引用 Person 的 ID + *

示例值:6919733936050406926 + */ + private String personId; + /** + * 试用期时长(月),试用期结束日期 - 试用期开始日期后取月数 + *

示例值:9999 + */ + private Integer probationPeriod; + /** + * 是否在试用期中 + *

示例值:true + */ + private String onProbation; + /** + * 试用期结束日期 + *

示例值:2022-01-01 + */ + private String probationEndDate; + /** + * 是否是主雇佣信息 + *

示例值:true + */ + private Boolean primaryEmployment; + /** + * 雇员状态 + *

示例值: + */ + private Enum employmentStatus; + /** + * 工作邮箱列表 + *

示例值: + */ + private Email[] workEmailList; + /** + * 邮箱 + *

示例值:test@163.com + */ + private String emailAddress; + /** + * 离职原因 + *

示例值: + */ + private Enum reasonForOffboarding; + /** + * 成本中心列表 + *

示例值: + */ + private JobDataCostCenter[] costCenterList; + /** + * 招聘应用 ID + *

示例值:6838119494196871234 + */ + private String atsApplicationId; + /** + * 自定义字段 + *

示例值: + */ + private ObjectFieldData[] customFields; + + /** + * 待入职 ID + *

示例值:1 + * + * @param prehireId + * @return + */ + public Builder prehireId(String prehireId) { + this.prehireId = prehireId; + return this; + } + + + /** + * 人员类型 + *

示例值:1 + * + * @param employeeTypeId + * @return + */ + public Builder employeeTypeId(String employeeTypeId) { + this.employeeTypeId = employeeTypeId; + return this; + } + + + /** + * 司龄 + *

示例值:1 + * + * @param tenure + * @return + */ + public Builder tenure(String tenure) { + this.tenure = tenure; + return this; + } + + + /** + * 部门 ID,枚举值及详细信息可通过【批量查询部门】接口查询获得 + *

示例值:6893014062142064135 + * + * @param departmentId + * @return + */ + public Builder departmentId(String departmentId) { + this.departmentId = departmentId; + return this; + } + + + /** + * 职级 ID,枚举值及详细信息可通过【批量查询职务级别】接口查询获得 + *

示例值:6893014062142064135 + * + * @param jobLevelId + * @return + */ + public Builder jobLevelId(String jobLevelId) { + this.jobLevelId = jobLevelId; + return this; + } + + + /** + * 工作地点 ID,枚举值及详细信息可通过【批量查询地点】接口查询获得 + *

示例值:6893014062142064135 + * + * @param workLocationId + * @return + */ + public Builder workLocationId(String workLocationId) { + this.workLocationId = workLocationId; + return this; + } + + + /** + * 职务序列 ID,枚举值及详细信息可通过【批量查询职务序列】接口查询获得 + *

示例值:6893014062142064135 + * + * @param jobFamilyId + * @return + */ + public Builder jobFamilyId(String jobFamilyId) { + this.jobFamilyId = jobFamilyId; + return this; + } + + + /** + * 职务 ID,枚举值及详细信息可通过【批量查询职务】接口查询获得 + *

示例值:6893014062142064135 + * + * @param jobId + * @return + */ + public Builder jobId(String jobId) { + this.jobId = jobId; + return this; + } + + + /** + * 法人主体 ID,枚举值及详细信息可通过【批量查询公司】接口查询获得 + *

示例值:6893014062142064135 + * + * @param companyId + * @return + */ + public Builder companyId(String companyId) { + this.companyId = companyId; + return this; + } + + + /** + * 工时制度 ID,枚举值及详细信息可通过【批量查询工时制度】接口查询获得 + *

示例值:6893014062142064135 + * + * @param workingHoursTypeId + * @return + */ + public Builder workingHoursTypeId(String workingHoursTypeId) { + this.workingHoursTypeId = workingHoursTypeId; + return this; + } + + + /** + * 实体在飞书人事(企业版)内部的唯一键 + *

示例值:6893014062142064135 + * + * @param id + * @return + */ + public Builder id(String id) { + this.id = id; + return this; + } + + + /** + * 资历起算日期 + *

示例值:2020-01-01 + * + * @param seniorityDate + * @return + */ + public Builder seniorityDate(String seniorityDate) { + this.seniorityDate = seniorityDate; + return this; + } + + + /** + * 员工编号 + *

示例值:1000000 + * + * @param employeeNumber + * @return + */ + public Builder employeeNumber(String employeeNumber) { + this.employeeNumber = employeeNumber; + return this; + } + + + /** + * 当前雇佣记录的入职日期 + *

示例值:2020-01-01 + * + * @param effectiveDate + * @return + */ + public Builder effectiveDate(String effectiveDate) { + this.effectiveDate = effectiveDate; + return this; + } + + + /** + * 离职日期,即员工的最后一个工作日,最后一个工作日时员工的雇佣状态仍为“在职”,次日凌晨将更改为“离职” + *

示例值:2021-01-01 + * + * @param expirationDate + * @return + */ + public Builder expirationDate(String expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + + /** + * 雇佣类型 + *

示例值: + * + * @param employmentType + * @return + */ + public Builder employmentType(Enum employmentType) { + this.employmentType = employmentType; + return this; + } + + + /** + * 人员信息,引用 Person 的 ID + *

示例值:6919733936050406926 + * + * @param personId + * @return + */ + public Builder personId(String personId) { + this.personId = personId; + return this; + } + + + /** + * 试用期时长(月),试用期结束日期 - 试用期开始日期后取月数 + *

示例值:9999 + * + * @param probationPeriod + * @return + */ + public Builder probationPeriod(Integer probationPeriod) { + this.probationPeriod = probationPeriod; + return this; + } + + + /** + * 是否在试用期中 + *

示例值:true + * + * @param onProbation + * @return + */ + public Builder onProbation(String onProbation) { + this.onProbation = onProbation; + return this; + } + + + /** + * 试用期结束日期 + *

示例值:2022-01-01 + * + * @param probationEndDate + * @return + */ + public Builder probationEndDate(String probationEndDate) { + this.probationEndDate = probationEndDate; + return this; + } + + + /** + * 是否是主雇佣信息 + *

示例值:true + * + * @param primaryEmployment + * @return + */ + public Builder primaryEmployment(Boolean primaryEmployment) { + this.primaryEmployment = primaryEmployment; + return this; + } + + + /** + * 雇员状态 + *

示例值: + * + * @param employmentStatus + * @return + */ + public Builder employmentStatus(Enum employmentStatus) { + this.employmentStatus = employmentStatus; + return this; + } + + + /** + * 工作邮箱列表 + *

示例值: + * + * @param workEmailList + * @return + */ + public Builder workEmailList(Email[] workEmailList) { + this.workEmailList = workEmailList; + return this; + } + + + /** + * 邮箱 + *

示例值:test@163.com + * + * @param emailAddress + * @return + */ + public Builder emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + + /** + * 离职原因 + *

示例值: + * + * @param reasonForOffboarding + * @return + */ + public Builder reasonForOffboarding(Enum reasonForOffboarding) { + this.reasonForOffboarding = reasonForOffboarding; + return this; + } + + + /** + * 成本中心列表 + *

示例值: + * + * @param costCenterList + * @return + */ + public Builder costCenterList(JobDataCostCenter[] costCenterList) { + this.costCenterList = costCenterList; + return this; + } + + + /** + * 招聘应用 ID + *

示例值:6838119494196871234 + * + * @param atsApplicationId + * @return + */ + public Builder atsApplicationId(String atsApplicationId) { + this.atsApplicationId = atsApplicationId; + return this; + } + + + /** + * 自定义字段 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(ObjectFieldData[] customFields) { + this.customFields = customFields; + return this; + } + + + public Employment build() { + return new Employment(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EmploymentBp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EmploymentBp.java new file mode 100644 index 000000000..dcfb3803b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EmploymentBp.java @@ -0,0 +1,148 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class EmploymentBp { + /** + * 员工雇佣 ID + *

示例值:6863326262618752123 + */ + @SerializedName("employment_id") + private String employmentId; + /** + * 部门 hrbp 雇佣 ID 列表 + *

示例值: + */ + @SerializedName("hrbp_ids") + private String[] hrbpIds; + /** + * 属地 bp 雇佣 ID 列表 + *

示例值: + */ + @SerializedName("location_bp_ids") + private String[] locationBpIds; + + // builder 开始 + public EmploymentBp() { + } + + public EmploymentBp(Builder builder) { + /** + * 员工雇佣 ID + *

示例值:6863326262618752123 + */ + this.employmentId = builder.employmentId; + /** + * 部门 hrbp 雇佣 ID 列表 + *

示例值: + */ + this.hrbpIds = builder.hrbpIds; + /** + * 属地 bp 雇佣 ID 列表 + *

示例值: + */ + this.locationBpIds = builder.locationBpIds; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getEmploymentId() { + return this.employmentId; + } + + public void setEmploymentId(String employmentId) { + this.employmentId = employmentId; + } + + public String[] getHrbpIds() { + return this.hrbpIds; + } + + public void setHrbpIds(String[] hrbpIds) { + this.hrbpIds = hrbpIds; + } + + public String[] getLocationBpIds() { + return this.locationBpIds; + } + + public void setLocationBpIds(String[] locationBpIds) { + this.locationBpIds = locationBpIds; + } + + public static class Builder { + /** + * 员工雇佣 ID + *

示例值:6863326262618752123 + */ + private String employmentId; + /** + * 部门 hrbp 雇佣 ID 列表 + *

示例值: + */ + private String[] hrbpIds; + /** + * 属地 bp 雇佣 ID 列表 + *

示例值: + */ + private String[] locationBpIds; + + /** + * 员工雇佣 ID + *

示例值:6863326262618752123 + * + * @param employmentId + * @return + */ + public Builder employmentId(String employmentId) { + this.employmentId = employmentId; + return this; + } + + + /** + * 部门 hrbp 雇佣 ID 列表 + *

示例值: + * + * @param hrbpIds + * @return + */ + public Builder hrbpIds(String[] hrbpIds) { + this.hrbpIds = hrbpIds; + return this; + } + + + /** + * 属地 bp 雇佣 ID 列表 + *

示例值: + * + * @param locationBpIds + * @return + */ + public Builder locationBpIds(String[] locationBpIds) { + this.locationBpIds = locationBpIds; + return this; + } + + + public EmploymentBp build() { + return new EmploymentBp(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EnableDisableAssessmentProbationReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EnableDisableAssessmentProbationReq.java new file mode 100644 index 000000000..4638a940e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EnableDisableAssessmentProbationReq.java @@ -0,0 +1,65 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.annotation.Body; + +public class EnableDisableAssessmentProbationReq { + @Body + private EnableDisableAssessmentProbationReqBody body; + + // builder 开始 + public EnableDisableAssessmentProbationReq() { + } + + public EnableDisableAssessmentProbationReq(Builder builder) { + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public EnableDisableAssessmentProbationReqBody getEnableDisableAssessmentProbationReqBody() { + return this.body; + } + + public void setEnableDisableAssessmentProbationReqBody(EnableDisableAssessmentProbationReqBody body) { + this.body = body; + } + + public static class Builder { + + private EnableDisableAssessmentProbationReqBody body; + + public EnableDisableAssessmentProbationReqBody getEnableDisableAssessmentProbationReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder enableDisableAssessmentProbationReqBody(EnableDisableAssessmentProbationReqBody body) { + this.body = body; + return this; + } + + public EnableDisableAssessmentProbationReq build() { + return new EnableDisableAssessmentProbationReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EnableDisableAssessmentProbationReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EnableDisableAssessmentProbationReqBody.java new file mode 100644 index 000000000..918e8f71e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EnableDisableAssessmentProbationReqBody.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class EnableDisableAssessmentProbationReqBody { + /** + * 启用 / 停用状态。启用后可在试用期管理页面中可见试用期考核相关的字段。 + *

示例值:true + */ + @SerializedName("active") + private Boolean active; + /** + * 试用期考核系统入口链接,当启用功能时该字段必填。 + *

示例值:https://qwe111.feishuapp.bytedance.net/ae/ui/apps/176612345027111/appPages/l11bsrwss13yt?dataGrid%41pye4fsbajo21l=%7B%7D&key=ffm41o1&dataGrid%41wmv98t29vif3kj=%1B%7D + */ + @SerializedName("app_url") + private String appUrl; + + // builder 开始 + public EnableDisableAssessmentProbationReqBody() { + } + + public EnableDisableAssessmentProbationReqBody(Builder builder) { + /** + * 启用 / 停用状态。启用后可在试用期管理页面中可见试用期考核相关的字段。 + *

示例值:true + */ + this.active = builder.active; + /** + * 试用期考核系统入口链接,当启用功能时该字段必填。 + *

示例值:https://qwe111.feishuapp.bytedance.net/ae/ui/apps/176612345027111/appPages/l11bsrwss13yt?dataGrid%41pye4fsbajo21l=%7B%7D&key=ffm41o1&dataGrid%41wmv98t29vif3kj=%1B%7D + */ + this.appUrl = builder.appUrl; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Boolean getActive() { + return this.active; + } + + public void setActive(Boolean active) { + this.active = active; + } + + public String getAppUrl() { + return this.appUrl; + } + + public void setAppUrl(String appUrl) { + this.appUrl = appUrl; + } + + public static class Builder { + /** + * 启用 / 停用状态。启用后可在试用期管理页面中可见试用期考核相关的字段。 + *

示例值:true + */ + private Boolean active; + /** + * 试用期考核系统入口链接,当启用功能时该字段必填。 + *

示例值:https://qwe111.feishuapp.bytedance.net/ae/ui/apps/176612345027111/appPages/l11bsrwss13yt?dataGrid%41pye4fsbajo21l=%7B%7D&key=ffm41o1&dataGrid%41wmv98t29vif3kj=%1B%7D + */ + private String appUrl; + + /** + * 启用 / 停用状态。启用后可在试用期管理页面中可见试用期考核相关的字段。 + *

示例值:true + * + * @param active + * @return + */ + public Builder active(Boolean active) { + this.active = active; + return this; + } + + + /** + * 试用期考核系统入口链接,当启用功能时该字段必填。 + *

示例值:https://qwe111.feishuapp.bytedance.net/ae/ui/apps/176612345027111/appPages/l11bsrwss13yt?dataGrid%41pye4fsbajo21l=%7B%7D&key=ffm41o1&dataGrid%41wmv98t29vif3kj=%1B%7D + * + * @param appUrl + * @return + */ + public Builder appUrl(String appUrl) { + this.appUrl = appUrl; + return this; + } + + + public EnableDisableAssessmentProbationReqBody build() { + return new EnableDisableAssessmentProbationReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EnableDisableAssessmentProbationResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EnableDisableAssessmentProbationResp.java new file mode 100644 index 000000000..b90e8c98f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/EnableDisableAssessmentProbationResp.java @@ -0,0 +1,20 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; +import com.lark.oapi.core.response.EmptyData; + +public class EnableDisableAssessmentProbationResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Enum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Enum.java new file mode 100644 index 000000000..3891c4c0d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Enum.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Enum { + /** + * 枚举值 + *

示例值:phone_type + */ + @SerializedName("enum_name") + private String enumName; + /** + * 枚举多语展示 + *

示例值: + */ + @SerializedName("display") + private I18n[] display; + + // builder 开始 + public Enum() { + } + + public Enum(Builder builder) { + /** + * 枚举值 + *

示例值:phone_type + */ + this.enumName = builder.enumName; + /** + * 枚举多语展示 + *

示例值: + */ + this.display = builder.display; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getEnumName() { + return this.enumName; + } + + public void setEnumName(String enumName) { + this.enumName = enumName; + } + + public I18n[] getDisplay() { + return this.display; + } + + public void setDisplay(I18n[] display) { + this.display = display; + } + + public static class Builder { + /** + * 枚举值 + *

示例值:phone_type + */ + private String enumName; + /** + * 枚举多语展示 + *

示例值: + */ + private I18n[] display; + + /** + * 枚举值 + *

示例值:phone_type + * + * @param enumName + * @return + */ + public Builder enumName(String enumName) { + this.enumName = enumName; + return this; + } + + + /** + * 枚举多语展示 + *

示例值: + * + * @param display + * @return + */ + public Builder display(I18n[] display) { + this.display = display; + return this; + } + + + public Enum build() { + return new Enum(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/File.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/File.java new file mode 100644 index 000000000..1640489aa --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/File.java @@ -0,0 +1,74 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class File { + /** + * 上传文件ID + *

示例值:150018109586e8ea745e47ae8feb3722dbe1d03a181336393633393133303431393831343930373235150200 + */ + @SerializedName("id") + private String id; + + // builder 开始 + public File() { + } + + public File(Builder builder) { + /** + * 上传文件ID + *

示例值:150018109586e8ea745e47ae8feb3722dbe1d03a181336393633393133303431393831343930373235150200 + */ + this.id = builder.id; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public static class Builder { + /** + * 上传文件ID + *

示例值:150018109586e8ea745e47ae8feb3722dbe1d03a181336393633393133303431393831343930373235150200 + */ + private String id; + + /** + * 上传文件ID + *

示例值:150018109586e8ea745e47ae8feb3722dbe1d03a181336393633393133303431393831343930373235150200 + * + * @param id + * @return + */ + public Builder id(String id) { + this.id = id; + return this; + } + + + public File build() { + return new File(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetByDepartmentBpReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetByDepartmentBpReq.java new file mode 100644 index 000000000..42c16d57c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetByDepartmentBpReq.java @@ -0,0 +1,156 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Query; + +public class GetByDepartmentBpReq { + /** + * 用户 ID 类型 + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + */ + @Query + @SerializedName("department_id_type") + private String departmentIdType; + @Body + private GetByDepartmentBpReqBody body; + + // builder 开始 + public GetByDepartmentBpReq() { + } + + public GetByDepartmentBpReq(Builder builder) { + /** + * 用户 ID 类型 + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + */ + this.departmentIdType = builder.departmentIdType; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getDepartmentIdType() { + return this.departmentIdType; + } + + public void setDepartmentIdType(String departmentIdType) { + this.departmentIdType = departmentIdType; + } + + public GetByDepartmentBpReqBody getGetByDepartmentBpReqBody() { + return this.body; + } + + public void setGetByDepartmentBpReqBody(GetByDepartmentBpReqBody body) { + this.body = body; + } + + public static class Builder { + private String userIdType; // 用户 ID 类型 + private String departmentIdType; // 此次调用中使用的部门 ID 类型 + private GetByDepartmentBpReqBody body; + + /** + * 用户 ID 类型 + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 用户 ID 类型 + *

示例值:open_id + * + * @param userIdType {@link com.lark.oapi.service.corehr.v2.enums.GetByDepartmentBpUserIdTypeEnum} + * @return + */ + public Builder userIdType(com.lark.oapi.service.corehr.v2.enums.GetByDepartmentBpUserIdTypeEnum userIdType) { + this.userIdType = userIdType.getValue(); + return this; + } + + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + * + * @param departmentIdType + * @return + */ + public Builder departmentIdType(String departmentIdType) { + this.departmentIdType = departmentIdType; + return this; + } + + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + * + * @param departmentIdType {@link com.lark.oapi.service.corehr.v2.enums.GetByDepartmentBpDepartmentIdTypeEnum} + * @return + */ + public Builder departmentIdType(com.lark.oapi.service.corehr.v2.enums.GetByDepartmentBpDepartmentIdTypeEnum departmentIdType) { + this.departmentIdType = departmentIdType.getValue(); + return this; + } + + public GetByDepartmentBpReqBody getGetByDepartmentBpReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder getByDepartmentBpReqBody(GetByDepartmentBpReqBody body) { + this.body = body; + return this; + } + + public GetByDepartmentBpReq build() { + return new GetByDepartmentBpReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetByDepartmentBpReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetByDepartmentBpReqBody.java new file mode 100644 index 000000000..ba3639105 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetByDepartmentBpReqBody.java @@ -0,0 +1,74 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class GetByDepartmentBpReqBody { + /** + * 部门 ID + *

示例值:6893014062142064111 + */ + @SerializedName("department_id") + private String departmentId; + + // builder 开始 + public GetByDepartmentBpReqBody() { + } + + public GetByDepartmentBpReqBody(Builder builder) { + /** + * 部门 ID + *

示例值:6893014062142064111 + */ + this.departmentId = builder.departmentId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getDepartmentId() { + return this.departmentId; + } + + public void setDepartmentId(String departmentId) { + this.departmentId = departmentId; + } + + public static class Builder { + /** + * 部门 ID + *

示例值:6893014062142064111 + */ + private String departmentId; + + /** + * 部门 ID + *

示例值:6893014062142064111 + * + * @param departmentId + * @return + */ + public Builder departmentId(String departmentId) { + this.departmentId = departmentId; + return this; + } + + + public GetByDepartmentBpReqBody build() { + return new GetByDepartmentBpReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetByDepartmentBpResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetByDepartmentBpResp.java new file mode 100644 index 000000000..de512e65b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetByDepartmentBpResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class GetByDepartmentBpResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetByDepartmentBpRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetByDepartmentBpRespBody.java new file mode 100644 index 000000000..5ad282243 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetByDepartmentBpRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class GetByDepartmentBpRespBody { + /** + * 部门 HRBP 信息,依次为部门及各层级上级部门 + *

示例值: + */ + @SerializedName("items") + private DepartmentHrbp[] items; + + public DepartmentHrbp[] getItems() { + return this.items; + } + + public void setItems(DepartmentHrbp[] items) { + this.items = items; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetJobReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetJobReq.java new file mode 100644 index 000000000..eda336b40 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetJobReq.java @@ -0,0 +1,72 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Path; + +public class GetJobReq { + /** + * 序列级别ID + *

示例值:151515 + */ + @Path + @SerializedName("job_id") + private String jobId; + + // builder 开始 + public GetJobReq() { + } + + public GetJobReq(Builder builder) { + /** + * 序列级别ID + *

示例值:151515 + */ + this.jobId = builder.jobId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getJobId() { + return this.jobId; + } + + public void setJobId(String jobId) { + this.jobId = jobId; + } + + public static class Builder { + + private String jobId; // 序列级别ID + + /** + * 序列级别ID + *

示例值:151515 + * + * @param jobId + * @return + */ + public Builder jobId(String jobId) { + this.jobId = jobId; + return this; + } + + public GetJobReq build() { + return new GetJobReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetJobResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetJobResp.java new file mode 100644 index 000000000..35dd0be36 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetJobResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class GetJobResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetJobRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetJobRespBody.java new file mode 100644 index 000000000..02f03b247 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetJobRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class GetJobRespBody { + /** + * 职务信息 + *

示例值: + */ + @SerializedName("job") + private Job job; + + public Job getJob() { + return this.job; + } + + public void setJob(Job job) { + this.job = job; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetProcessReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetProcessReq.java new file mode 100644 index 000000000..5b0f92473 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetProcessReq.java @@ -0,0 +1,117 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class GetProcessReq { + /** + * 用户 ID 类型 + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 流程ID + *

示例值:7278949005675988535 + */ + @Path + @SerializedName("process_id") + private String processId; + + // builder 开始 + public GetProcessReq() { + } + + public GetProcessReq(Builder builder) { + /** + * 用户 ID 类型 + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 流程ID + *

示例值:7278949005675988535 + */ + this.processId = builder.processId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getProcessId() { + return this.processId; + } + + public void setProcessId(String processId) { + this.processId = processId; + } + + public static class Builder { + private String userIdType; // 用户 ID 类型 + private String processId; // 流程ID + + /** + * 用户 ID 类型 + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 用户 ID 类型 + *

示例值:open_id + * + * @param userIdType {@link com.lark.oapi.service.corehr.v2.enums.GetProcessUserIdTypeEnum} + * @return + */ + public Builder userIdType(com.lark.oapi.service.corehr.v2.enums.GetProcessUserIdTypeEnum userIdType) { + this.userIdType = userIdType.getValue(); + return this; + } + + /** + * 流程ID + *

示例值:7278949005675988535 + * + * @param processId + * @return + */ + public Builder processId(String processId) { + this.processId = processId; + return this; + } + + public GetProcessReq build() { + return new GetProcessReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetProcessResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetProcessResp.java new file mode 100644 index 000000000..c40ff55e3 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetProcessResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class GetProcessResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetProcessRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetProcessRespBody.java new file mode 100644 index 000000000..4aa8f9789 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/GetProcessRespBody.java @@ -0,0 +1,230 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class GetProcessRespBody { + /** + * 流程实例ID + *

示例值:7278949005675988535 + */ + @SerializedName("process_id") + private String processId; + /** + * 流程状态 + *

示例值:1 + */ + @SerializedName("status") + private Integer status; + /** + * 业务类型ID + *

示例值:leave + */ + @SerializedName("flow_template_id") + private String flowTemplateId; + /** + * 业务类型名称 + *

示例值: + */ + @SerializedName("flow_template_name") + private DataengineI18n flowTemplateName; + /** + * 流程定义ID + *

示例值:people_6961286846093788680_7081951411982077732 + */ + @SerializedName("flow_definition_id") + private String flowDefinitionId; + /** + * 流程定义名称 + *

示例值: + */ + @SerializedName("flow_definition_name") + private DataengineI18n flowDefinitionName; + /** + * 流程发起人ID + *

示例值:7124991993901827628 + */ + @SerializedName("initiator_id") + private String initiatorId; + /** + * 流程发起人姓名 + *

示例值: + */ + @SerializedName("initiator_name") + private DataengineI18n initiatorName; + /** + * 流程发起时间,Unix毫秒时间戳 + *

示例值:1694769814036 + */ + @SerializedName("create_time") + private String createTime; + /** + * 流程结束时间,Unix毫秒时间戳 + *

示例值:1694769814036 + */ + @SerializedName("complete_time") + private String completeTime; + /** + * 发起单据地址 + *

示例值: + */ + @SerializedName("start_links") + private ProcessLink startLinks; + /** + * 流程摘要,会随着流程流转发生变化 + *

示例值: + */ + @SerializedName("abstracts") + private ProcessAbstractItem[] abstracts; + /** + * 待办列表 + *

示例值: + */ + @SerializedName("todos") + private ProcessTodoItem[] todos; + /** + * 抄送列表 + *

示例值: + */ + @SerializedName("cc_list") + private ProcessCcItem[] ccList; + /** + * 已办列表 + *

示例值: + */ + @SerializedName("done_list") + private ProcessDoneItem[] doneList; + + public String getProcessId() { + return this.processId; + } + + public void setProcessId(String processId) { + this.processId = processId; + } + + public Integer getStatus() { + return this.status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getFlowTemplateId() { + return this.flowTemplateId; + } + + public void setFlowTemplateId(String flowTemplateId) { + this.flowTemplateId = flowTemplateId; + } + + public DataengineI18n getFlowTemplateName() { + return this.flowTemplateName; + } + + public void setFlowTemplateName(DataengineI18n flowTemplateName) { + this.flowTemplateName = flowTemplateName; + } + + public String getFlowDefinitionId() { + return this.flowDefinitionId; + } + + public void setFlowDefinitionId(String flowDefinitionId) { + this.flowDefinitionId = flowDefinitionId; + } + + public DataengineI18n getFlowDefinitionName() { + return this.flowDefinitionName; + } + + public void setFlowDefinitionName(DataengineI18n flowDefinitionName) { + this.flowDefinitionName = flowDefinitionName; + } + + public String getInitiatorId() { + return this.initiatorId; + } + + public void setInitiatorId(String initiatorId) { + this.initiatorId = initiatorId; + } + + public DataengineI18n getInitiatorName() { + return this.initiatorName; + } + + public void setInitiatorName(DataengineI18n initiatorName) { + this.initiatorName = initiatorName; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getCompleteTime() { + return this.completeTime; + } + + public void setCompleteTime(String completeTime) { + this.completeTime = completeTime; + } + + public ProcessLink getStartLinks() { + return this.startLinks; + } + + public void setStartLinks(ProcessLink startLinks) { + this.startLinks = startLinks; + } + + public ProcessAbstractItem[] getAbstracts() { + return this.abstracts; + } + + public void setAbstracts(ProcessAbstractItem[] abstracts) { + this.abstracts = abstracts; + } + + public ProcessTodoItem[] getTodos() { + return this.todos; + } + + public void setTodos(ProcessTodoItem[] todos) { + this.todos = todos; + } + + public ProcessCcItem[] getCcList() { + return this.ccList; + } + + public void setCcList(ProcessCcItem[] ccList) { + this.ccList = ccList; + } + + public ProcessDoneItem[] getDoneList() { + return this.doneList; + } + + public void setDoneList(ProcessDoneItem[] doneList) { + this.doneList = doneList; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/HiberarchyCommon.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/HiberarchyCommon.java new file mode 100644 index 000000000..486d5c5a7 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/HiberarchyCommon.java @@ -0,0 +1,444 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class HiberarchyCommon { + /** + * 上级组织 + *

示例值:4719168654814483759 + */ + @SerializedName("parent_id") + private String parentId; + /** + * 名称 + *

示例值: + */ + @SerializedName("name") + private I18n[] name; + /** + * 组织类型 + *

示例值: + */ + @SerializedName("type") + private Enum type; + /** + * 启用 + *

示例值:true + */ + @SerializedName("active") + private Boolean active; + /** + * 生效时间 + *

示例值:2020-05-01 00:00:00 + */ + @SerializedName("effective_time") + private String effectiveTime; + /** + * 失效时间 + *

示例值:2020-05-02 00:00:00 + */ + @SerializedName("expiration_time") + private String expirationTime; + /** + * 编码 + *

示例值:12456 + */ + @SerializedName("code") + private String code; + /** + * 描述 + *

示例值: + */ + @SerializedName("description") + private I18n[] description; + /** + * 树形排序,代表同层级的部门排序序号 + *

示例值:123 + */ + @SerializedName("tree_order") + private String treeOrder; + /** + * 列表排序,代表所有部门的混排序号 + *

示例值:123 + */ + @SerializedName("list_order") + private String listOrder; + /** + * 自定义字段 + *

示例值: + */ + @SerializedName("custom_fields") + private ObjectFieldData[] customFields; + + // builder 开始 + public HiberarchyCommon() { + } + + public HiberarchyCommon(Builder builder) { + /** + * 上级组织 + *

示例值:4719168654814483759 + */ + this.parentId = builder.parentId; + /** + * 名称 + *

示例值: + */ + this.name = builder.name; + /** + * 组织类型 + *

示例值: + */ + this.type = builder.type; + /** + * 启用 + *

示例值:true + */ + this.active = builder.active; + /** + * 生效时间 + *

示例值:2020-05-01 00:00:00 + */ + this.effectiveTime = builder.effectiveTime; + /** + * 失效时间 + *

示例值:2020-05-02 00:00:00 + */ + this.expirationTime = builder.expirationTime; + /** + * 编码 + *

示例值:12456 + */ + this.code = builder.code; + /** + * 描述 + *

示例值: + */ + this.description = builder.description; + /** + * 树形排序,代表同层级的部门排序序号 + *

示例值:123 + */ + this.treeOrder = builder.treeOrder; + /** + * 列表排序,代表所有部门的混排序号 + *

示例值:123 + */ + this.listOrder = builder.listOrder; + /** + * 自定义字段 + *

示例值: + */ + this.customFields = builder.customFields; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getParentId() { + return this.parentId; + } + + public void setParentId(String parentId) { + this.parentId = parentId; + } + + public I18n[] getName() { + return this.name; + } + + public void setName(I18n[] name) { + this.name = name; + } + + public Enum getType() { + return this.type; + } + + public void setType(Enum type) { + this.type = type; + } + + public Boolean getActive() { + return this.active; + } + + public void setActive(Boolean active) { + this.active = active; + } + + public String getEffectiveTime() { + return this.effectiveTime; + } + + public void setEffectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + } + + public String getExpirationTime() { + return this.expirationTime; + } + + public void setExpirationTime(String expirationTime) { + this.expirationTime = expirationTime; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public I18n[] getDescription() { + return this.description; + } + + public void setDescription(I18n[] description) { + this.description = description; + } + + public String getTreeOrder() { + return this.treeOrder; + } + + public void setTreeOrder(String treeOrder) { + this.treeOrder = treeOrder; + } + + public String getListOrder() { + return this.listOrder; + } + + public void setListOrder(String listOrder) { + this.listOrder = listOrder; + } + + public ObjectFieldData[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(ObjectFieldData[] customFields) { + this.customFields = customFields; + } + + public static class Builder { + /** + * 上级组织 + *

示例值:4719168654814483759 + */ + private String parentId; + /** + * 名称 + *

示例值: + */ + private I18n[] name; + /** + * 组织类型 + *

示例值: + */ + private Enum type; + /** + * 启用 + *

示例值:true + */ + private Boolean active; + /** + * 生效时间 + *

示例值:2020-05-01 00:00:00 + */ + private String effectiveTime; + /** + * 失效时间 + *

示例值:2020-05-02 00:00:00 + */ + private String expirationTime; + /** + * 编码 + *

示例值:12456 + */ + private String code; + /** + * 描述 + *

示例值: + */ + private I18n[] description; + /** + * 树形排序,代表同层级的部门排序序号 + *

示例值:123 + */ + private String treeOrder; + /** + * 列表排序,代表所有部门的混排序号 + *

示例值:123 + */ + private String listOrder; + /** + * 自定义字段 + *

示例值: + */ + private ObjectFieldData[] customFields; + + /** + * 上级组织 + *

示例值:4719168654814483759 + * + * @param parentId + * @return + */ + public Builder parentId(String parentId) { + this.parentId = parentId; + return this; + } + + + /** + * 名称 + *

示例值: + * + * @param name + * @return + */ + public Builder name(I18n[] name) { + this.name = name; + return this; + } + + + /** + * 组织类型 + *

示例值: + * + * @param type + * @return + */ + public Builder type(Enum type) { + this.type = type; + return this; + } + + + /** + * 启用 + *

示例值:true + * + * @param active + * @return + */ + public Builder active(Boolean active) { + this.active = active; + return this; + } + + + /** + * 生效时间 + *

示例值:2020-05-01 00:00:00 + * + * @param effectiveTime + * @return + */ + public Builder effectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + return this; + } + + + /** + * 失效时间 + *

示例值:2020-05-02 00:00:00 + * + * @param expirationTime + * @return + */ + public Builder expirationTime(String expirationTime) { + this.expirationTime = expirationTime; + return this; + } + + + /** + * 编码 + *

示例值:12456 + * + * @param code + * @return + */ + public Builder code(String code) { + this.code = code; + return this; + } + + + /** + * 描述 + *

示例值: + * + * @param description + * @return + */ + public Builder description(I18n[] description) { + this.description = description; + return this; + } + + + /** + * 树形排序,代表同层级的部门排序序号 + *

示例值:123 + * + * @param treeOrder + * @return + */ + public Builder treeOrder(String treeOrder) { + this.treeOrder = treeOrder; + return this; + } + + + /** + * 列表排序,代表所有部门的混排序号 + *

示例值:123 + * + * @param listOrder + * @return + */ + public Builder listOrder(String listOrder) { + this.listOrder = listOrder; + return this; + } + + + /** + * 自定义字段 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(ObjectFieldData[] customFields) { + this.customFields = customFields; + return this; + } + + + public HiberarchyCommon build() { + return new HiberarchyCommon(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/I18n.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/I18n.java new file mode 100644 index 000000000..594fbccbc --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/I18n.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class I18n { + /** + * 语言 + *

示例值:zh-CN + */ + @SerializedName("lang") + private String lang; + /** + * 内容 + *

示例值:张三 + */ + @SerializedName("value") + private String value; + + // builder 开始 + public I18n() { + } + + public I18n(Builder builder) { + /** + * 语言 + *

示例值:zh-CN + */ + this.lang = builder.lang; + /** + * 内容 + *

示例值:张三 + */ + this.value = builder.value; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getLang() { + return this.lang; + } + + public void setLang(String lang) { + this.lang = lang; + } + + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + public static class Builder { + /** + * 语言 + *

示例值:zh-CN + */ + private String lang; + /** + * 内容 + *

示例值:张三 + */ + private String value; + + /** + * 语言 + *

示例值:zh-CN + * + * @param lang + * @return + */ + public Builder lang(String lang) { + this.lang = lang; + return this; + } + + + /** + * 内容 + *

示例值:张三 + * + * @param value + * @return + */ + public Builder value(String value) { + this.value = value; + return this; + } + + + public I18n build() { + return new I18n(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/I18nV2.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/I18nV2.java new file mode 100644 index 000000000..8a289fa0f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/I18nV2.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class I18nV2 { + /** + * zh-CN + *

示例值:王冰 + */ + @SerializedName("zh_cn") + private String zhCn; + /** + * en-US + *

示例值:Bob + */ + @SerializedName("en_us") + private String enUs; + + // builder 开始 + public I18nV2() { + } + + public I18nV2(Builder builder) { + /** + * zh-CN + *

示例值:王冰 + */ + this.zhCn = builder.zhCn; + /** + * en-US + *

示例值:Bob + */ + this.enUs = builder.enUs; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getZhCn() { + return this.zhCn; + } + + public void setZhCn(String zhCn) { + this.zhCn = zhCn; + } + + public String getEnUs() { + return this.enUs; + } + + public void setEnUs(String enUs) { + this.enUs = enUs; + } + + public static class Builder { + /** + * zh-CN + *

示例值:王冰 + */ + private String zhCn; + /** + * en-US + *

示例值:Bob + */ + private String enUs; + + /** + * zh-CN + *

示例值:王冰 + * + * @param zhCn + * @return + */ + public Builder zhCn(String zhCn) { + this.zhCn = zhCn; + return this; + } + + + /** + * en-US + *

示例值:Bob + * + * @param enUs + * @return + */ + public Builder enUs(String enUs) { + this.enUs = enUs; + return this; + } + + + public I18nV2 build() { + return new I18nV2(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/InternationalAssignment.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/InternationalAssignment.java new file mode 100644 index 000000000..6cfd56d18 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/InternationalAssignment.java @@ -0,0 +1,444 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class InternationalAssignment { + /** + * 当前生效的外派记录ID + *

示例值:7046599238679447000 + */ + @SerializedName("id") + private String id; + /** + * 当前生效外派记录的外派城市(派驻地)ID + *

示例值:7046599238679447084 + */ + @SerializedName("assignment_city_id") + private String assignmentCityId; + /** + * 当前生效外派记录的外派公司ID + *

示例值:7046599238679447084 + */ + @SerializedName("assignment_company_id") + private String assignmentCompanyId; + /** + * 当前生效外派记录的外派国家ID + *

示例值:7046599238679447084 + */ + @SerializedName("assignment_country_id") + private String assignmentCountryId; + /** + * 当前生效外派记录的外派原因 + *

示例值: + */ + @SerializedName("assignment_reason") + private I18n assignmentReason; + /** + * 当前生效外派记录的生效时间 + *

示例值:2023-08-29 + */ + @SerializedName("effective_time") + private String effectiveTime; + /** + * 当前生效外派记录的开始外派流程 ID + *

示例值:111111 + */ + @SerializedName("start_assignment_process_id") + private String startAssignmentProcessId; + /** + * 当前生效外派记录的结束外派流程 ID + *

示例值:1111111 + */ + @SerializedName("end_assignment_process_id") + private String endAssignmentProcessId; + /** + * 当前生效外派记录的失效时间 + *

示例值:2023-12-29 + */ + @SerializedName("expiration_time") + private String expirationTime; + /** + * -| 当前生效外派记录的外派状态 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_status - object_api_name:international_assignment + *

示例值: + */ + @SerializedName("international_assignment_status") + private Enum internationalAssignmentStatus; + /** + * -| 当前生效外派记录的外派类型 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_type - object_api_name:international_assignment + *

示例值: + */ + @SerializedName("international_assignment_type") + private Enum internationalAssignmentType; + + // builder 开始 + public InternationalAssignment() { + } + + public InternationalAssignment(Builder builder) { + /** + * 当前生效的外派记录ID + *

示例值:7046599238679447000 + */ + this.id = builder.id; + /** + * 当前生效外派记录的外派城市(派驻地)ID + *

示例值:7046599238679447084 + */ + this.assignmentCityId = builder.assignmentCityId; + /** + * 当前生效外派记录的外派公司ID + *

示例值:7046599238679447084 + */ + this.assignmentCompanyId = builder.assignmentCompanyId; + /** + * 当前生效外派记录的外派国家ID + *

示例值:7046599238679447084 + */ + this.assignmentCountryId = builder.assignmentCountryId; + /** + * 当前生效外派记录的外派原因 + *

示例值: + */ + this.assignmentReason = builder.assignmentReason; + /** + * 当前生效外派记录的生效时间 + *

示例值:2023-08-29 + */ + this.effectiveTime = builder.effectiveTime; + /** + * 当前生效外派记录的开始外派流程 ID + *

示例值:111111 + */ + this.startAssignmentProcessId = builder.startAssignmentProcessId; + /** + * 当前生效外派记录的结束外派流程 ID + *

示例值:1111111 + */ + this.endAssignmentProcessId = builder.endAssignmentProcessId; + /** + * 当前生效外派记录的失效时间 + *

示例值:2023-12-29 + */ + this.expirationTime = builder.expirationTime; + /** + * -| 当前生效外派记录的外派状态 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_status - object_api_name:international_assignment + *

示例值: + */ + this.internationalAssignmentStatus = builder.internationalAssignmentStatus; + /** + * -| 当前生效外派记录的外派类型 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_type - object_api_name:international_assignment + *

示例值: + */ + this.internationalAssignmentType = builder.internationalAssignmentType; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public String getAssignmentCityId() { + return this.assignmentCityId; + } + + public void setAssignmentCityId(String assignmentCityId) { + this.assignmentCityId = assignmentCityId; + } + + public String getAssignmentCompanyId() { + return this.assignmentCompanyId; + } + + public void setAssignmentCompanyId(String assignmentCompanyId) { + this.assignmentCompanyId = assignmentCompanyId; + } + + public String getAssignmentCountryId() { + return this.assignmentCountryId; + } + + public void setAssignmentCountryId(String assignmentCountryId) { + this.assignmentCountryId = assignmentCountryId; + } + + public I18n getAssignmentReason() { + return this.assignmentReason; + } + + public void setAssignmentReason(I18n assignmentReason) { + this.assignmentReason = assignmentReason; + } + + public String getEffectiveTime() { + return this.effectiveTime; + } + + public void setEffectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + } + + public String getStartAssignmentProcessId() { + return this.startAssignmentProcessId; + } + + public void setStartAssignmentProcessId(String startAssignmentProcessId) { + this.startAssignmentProcessId = startAssignmentProcessId; + } + + public String getEndAssignmentProcessId() { + return this.endAssignmentProcessId; + } + + public void setEndAssignmentProcessId(String endAssignmentProcessId) { + this.endAssignmentProcessId = endAssignmentProcessId; + } + + public String getExpirationTime() { + return this.expirationTime; + } + + public void setExpirationTime(String expirationTime) { + this.expirationTime = expirationTime; + } + + public Enum getInternationalAssignmentStatus() { + return this.internationalAssignmentStatus; + } + + public void setInternationalAssignmentStatus(Enum internationalAssignmentStatus) { + this.internationalAssignmentStatus = internationalAssignmentStatus; + } + + public Enum getInternationalAssignmentType() { + return this.internationalAssignmentType; + } + + public void setInternationalAssignmentType(Enum internationalAssignmentType) { + this.internationalAssignmentType = internationalAssignmentType; + } + + public static class Builder { + /** + * 当前生效的外派记录ID + *

示例值:7046599238679447000 + */ + private String id; + /** + * 当前生效外派记录的外派城市(派驻地)ID + *

示例值:7046599238679447084 + */ + private String assignmentCityId; + /** + * 当前生效外派记录的外派公司ID + *

示例值:7046599238679447084 + */ + private String assignmentCompanyId; + /** + * 当前生效外派记录的外派国家ID + *

示例值:7046599238679447084 + */ + private String assignmentCountryId; + /** + * 当前生效外派记录的外派原因 + *

示例值: + */ + private I18n assignmentReason; + /** + * 当前生效外派记录的生效时间 + *

示例值:2023-08-29 + */ + private String effectiveTime; + /** + * 当前生效外派记录的开始外派流程 ID + *

示例值:111111 + */ + private String startAssignmentProcessId; + /** + * 当前生效外派记录的结束外派流程 ID + *

示例值:1111111 + */ + private String endAssignmentProcessId; + /** + * 当前生效外派记录的失效时间 + *

示例值:2023-12-29 + */ + private String expirationTime; + /** + * -| 当前生效外派记录的外派状态 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_status - object_api_name:international_assignment + *

示例值: + */ + private Enum internationalAssignmentStatus; + /** + * -| 当前生效外派记录的外派类型 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_type - object_api_name:international_assignment + *

示例值: + */ + private Enum internationalAssignmentType; + + /** + * 当前生效的外派记录ID + *

示例值:7046599238679447000 + * + * @param id + * @return + */ + public Builder id(String id) { + this.id = id; + return this; + } + + + /** + * 当前生效外派记录的外派城市(派驻地)ID + *

示例值:7046599238679447084 + * + * @param assignmentCityId + * @return + */ + public Builder assignmentCityId(String assignmentCityId) { + this.assignmentCityId = assignmentCityId; + return this; + } + + + /** + * 当前生效外派记录的外派公司ID + *

示例值:7046599238679447084 + * + * @param assignmentCompanyId + * @return + */ + public Builder assignmentCompanyId(String assignmentCompanyId) { + this.assignmentCompanyId = assignmentCompanyId; + return this; + } + + + /** + * 当前生效外派记录的外派国家ID + *

示例值:7046599238679447084 + * + * @param assignmentCountryId + * @return + */ + public Builder assignmentCountryId(String assignmentCountryId) { + this.assignmentCountryId = assignmentCountryId; + return this; + } + + + /** + * 当前生效外派记录的外派原因 + *

示例值: + * + * @param assignmentReason + * @return + */ + public Builder assignmentReason(I18n assignmentReason) { + this.assignmentReason = assignmentReason; + return this; + } + + + /** + * 当前生效外派记录的生效时间 + *

示例值:2023-08-29 + * + * @param effectiveTime + * @return + */ + public Builder effectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + return this; + } + + + /** + * 当前生效外派记录的开始外派流程 ID + *

示例值:111111 + * + * @param startAssignmentProcessId + * @return + */ + public Builder startAssignmentProcessId(String startAssignmentProcessId) { + this.startAssignmentProcessId = startAssignmentProcessId; + return this; + } + + + /** + * 当前生效外派记录的结束外派流程 ID + *

示例值:1111111 + * + * @param endAssignmentProcessId + * @return + */ + public Builder endAssignmentProcessId(String endAssignmentProcessId) { + this.endAssignmentProcessId = endAssignmentProcessId; + return this; + } + + + /** + * 当前生效外派记录的失效时间 + *

示例值:2023-12-29 + * + * @param expirationTime + * @return + */ + public Builder expirationTime(String expirationTime) { + this.expirationTime = expirationTime; + return this; + } + + + /** + * -| 当前生效外派记录的外派状态 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_status - object_api_name:international_assignment + *

示例值: + * + * @param internationalAssignmentStatus + * @return + */ + public Builder internationalAssignmentStatus(Enum internationalAssignmentStatus) { + this.internationalAssignmentStatus = internationalAssignmentStatus; + return this; + } + + + /** + * -| 当前生效外派记录的外派类型 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_type - object_api_name:international_assignment + *

示例值: + * + * @param internationalAssignmentType + * @return + */ + public Builder internationalAssignmentType(Enum internationalAssignmentType) { + this.internationalAssignmentType = internationalAssignmentType; + return this; + } + + + public InternationalAssignment build() { + return new InternationalAssignment(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/InternationalAssignmentV2.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/InternationalAssignmentV2.java new file mode 100644 index 000000000..758c9bd77 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/InternationalAssignmentV2.java @@ -0,0 +1,703 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class InternationalAssignmentV2 { + /** + * 派驻信息ID + *

示例值:7046599238679447000 + */ + @SerializedName("id") + private String id; + /** + * Employment ID + *

示例值:7046599238679447000 + */ + @SerializedName("employment_id") + private String employmentId; + /** + * 创建人 + *

示例值:7046599238679447000 + */ + @SerializedName("created_by") + private String createdBy; + /** + * 创建时间 + *

示例值:2021-08-18 16:04:21 + */ + @SerializedName("created_at") + private String createdAt; + /** + * 生效时间 + *

示例值:2023-08-29 + */ + @SerializedName("effective_time") + private String effectiveTime; + /** + * 预计结束日期 + *

示例值:2023-12-29 + */ + @SerializedName("international_assignment_expected_end_date") + private String internationalAssignmentExpectedEndDate; + /** + * 失效时间 + *

示例值:2023-12-29 + */ + @SerializedName("expiration_time") + private String expirationTime; + /** + * 删除时间 + *

示例值:2021-08-18 16:04:21 + */ + @SerializedName("deleted_at") + private String deletedAt; + /** + * 更新时间 + *

示例值:2021-08-18 16:04:21 + */ + @SerializedName("updated_at") + private String updatedAt; + /** + * 更新人 + *

示例值:7046599238679447000 + */ + @SerializedName("updated_by") + private String updatedBy; + /** + * 外派国家ID + *

示例值:7046599238679447084 + */ + @SerializedName("assignment_country") + private String assignmentCountry; + /** + * 外派城市ID + *

示例值:7046599238679447084 + */ + @SerializedName("assignment_city") + private String assignmentCity; + /** + * 外派公司ID + *

示例值:7046599238679447084 + */ + @SerializedName("assignment_company") + private String assignmentCompany; + /** + * 当前生效外派记录的外派状态 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_status - object_api_name:international_assignment + *

示例值: + */ + @SerializedName("international_assignment_status") + private Enum internationalAssignmentStatus; + /** + * 当前生效外派记录的外派类型 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_type - object_api_name:international_assignment + *

示例值: + */ + @SerializedName("international_assignment_type") + private Enum internationalAssignmentType; + /** + * 是否享有派驻津贴 + *

示例值:false + */ + @SerializedName("international_assignment_allowance") + private Boolean internationalAssignmentAllowance; + /** + * 是否提供住宿 + *

示例值:false + */ + @SerializedName("accommodation") + private Boolean accommodation; + /** + * 描述 + *

示例值:外派信息的描述 + */ + @SerializedName("description") + private String description; + + // builder 开始 + public InternationalAssignmentV2() { + } + + public InternationalAssignmentV2(Builder builder) { + /** + * 派驻信息ID + *

示例值:7046599238679447000 + */ + this.id = builder.id; + /** + * Employment ID + *

示例值:7046599238679447000 + */ + this.employmentId = builder.employmentId; + /** + * 创建人 + *

示例值:7046599238679447000 + */ + this.createdBy = builder.createdBy; + /** + * 创建时间 + *

示例值:2021-08-18 16:04:21 + */ + this.createdAt = builder.createdAt; + /** + * 生效时间 + *

示例值:2023-08-29 + */ + this.effectiveTime = builder.effectiveTime; + /** + * 预计结束日期 + *

示例值:2023-12-29 + */ + this.internationalAssignmentExpectedEndDate = builder.internationalAssignmentExpectedEndDate; + /** + * 失效时间 + *

示例值:2023-12-29 + */ + this.expirationTime = builder.expirationTime; + /** + * 删除时间 + *

示例值:2021-08-18 16:04:21 + */ + this.deletedAt = builder.deletedAt; + /** + * 更新时间 + *

示例值:2021-08-18 16:04:21 + */ + this.updatedAt = builder.updatedAt; + /** + * 更新人 + *

示例值:7046599238679447000 + */ + this.updatedBy = builder.updatedBy; + /** + * 外派国家ID + *

示例值:7046599238679447084 + */ + this.assignmentCountry = builder.assignmentCountry; + /** + * 外派城市ID + *

示例值:7046599238679447084 + */ + this.assignmentCity = builder.assignmentCity; + /** + * 外派公司ID + *

示例值:7046599238679447084 + */ + this.assignmentCompany = builder.assignmentCompany; + /** + * 当前生效外派记录的外派状态 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_status - object_api_name:international_assignment + *

示例值: + */ + this.internationalAssignmentStatus = builder.internationalAssignmentStatus; + /** + * 当前生效外派记录的外派类型 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_type - object_api_name:international_assignment + *

示例值: + */ + this.internationalAssignmentType = builder.internationalAssignmentType; + /** + * 是否享有派驻津贴 + *

示例值:false + */ + this.internationalAssignmentAllowance = builder.internationalAssignmentAllowance; + /** + * 是否提供住宿 + *

示例值:false + */ + this.accommodation = builder.accommodation; + /** + * 描述 + *

示例值:外派信息的描述 + */ + this.description = builder.description; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public String getEmploymentId() { + return this.employmentId; + } + + public void setEmploymentId(String employmentId) { + this.employmentId = employmentId; + } + + public String getCreatedBy() { + return this.createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public String getCreatedAt() { + return this.createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public String getEffectiveTime() { + return this.effectiveTime; + } + + public void setEffectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + } + + public String getInternationalAssignmentExpectedEndDate() { + return this.internationalAssignmentExpectedEndDate; + } + + public void setInternationalAssignmentExpectedEndDate(String internationalAssignmentExpectedEndDate) { + this.internationalAssignmentExpectedEndDate = internationalAssignmentExpectedEndDate; + } + + public String getExpirationTime() { + return this.expirationTime; + } + + public void setExpirationTime(String expirationTime) { + this.expirationTime = expirationTime; + } + + public String getDeletedAt() { + return this.deletedAt; + } + + public void setDeletedAt(String deletedAt) { + this.deletedAt = deletedAt; + } + + public String getUpdatedAt() { + return this.updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + public String getUpdatedBy() { + return this.updatedBy; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } + + public String getAssignmentCountry() { + return this.assignmentCountry; + } + + public void setAssignmentCountry(String assignmentCountry) { + this.assignmentCountry = assignmentCountry; + } + + public String getAssignmentCity() { + return this.assignmentCity; + } + + public void setAssignmentCity(String assignmentCity) { + this.assignmentCity = assignmentCity; + } + + public String getAssignmentCompany() { + return this.assignmentCompany; + } + + public void setAssignmentCompany(String assignmentCompany) { + this.assignmentCompany = assignmentCompany; + } + + public Enum getInternationalAssignmentStatus() { + return this.internationalAssignmentStatus; + } + + public void setInternationalAssignmentStatus(Enum internationalAssignmentStatus) { + this.internationalAssignmentStatus = internationalAssignmentStatus; + } + + public Enum getInternationalAssignmentType() { + return this.internationalAssignmentType; + } + + public void setInternationalAssignmentType(Enum internationalAssignmentType) { + this.internationalAssignmentType = internationalAssignmentType; + } + + public Boolean getInternationalAssignmentAllowance() { + return this.internationalAssignmentAllowance; + } + + public void setInternationalAssignmentAllowance(Boolean internationalAssignmentAllowance) { + this.internationalAssignmentAllowance = internationalAssignmentAllowance; + } + + public Boolean getAccommodation() { + return this.accommodation; + } + + public void setAccommodation(Boolean accommodation) { + this.accommodation = accommodation; + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public static class Builder { + /** + * 派驻信息ID + *

示例值:7046599238679447000 + */ + private String id; + /** + * Employment ID + *

示例值:7046599238679447000 + */ + private String employmentId; + /** + * 创建人 + *

示例值:7046599238679447000 + */ + private String createdBy; + /** + * 创建时间 + *

示例值:2021-08-18 16:04:21 + */ + private String createdAt; + /** + * 生效时间 + *

示例值:2023-08-29 + */ + private String effectiveTime; + /** + * 预计结束日期 + *

示例值:2023-12-29 + */ + private String internationalAssignmentExpectedEndDate; + /** + * 失效时间 + *

示例值:2023-12-29 + */ + private String expirationTime; + /** + * 删除时间 + *

示例值:2021-08-18 16:04:21 + */ + private String deletedAt; + /** + * 更新时间 + *

示例值:2021-08-18 16:04:21 + */ + private String updatedAt; + /** + * 更新人 + *

示例值:7046599238679447000 + */ + private String updatedBy; + /** + * 外派国家ID + *

示例值:7046599238679447084 + */ + private String assignmentCountry; + /** + * 外派城市ID + *

示例值:7046599238679447084 + */ + private String assignmentCity; + /** + * 外派公司ID + *

示例值:7046599238679447084 + */ + private String assignmentCompany; + /** + * 当前生效外派记录的外派状态 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_status - object_api_name:international_assignment + *

示例值: + */ + private Enum internationalAssignmentStatus; + /** + * 当前生效外派记录的外派类型 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_type - object_api_name:international_assignment + *

示例值: + */ + private Enum internationalAssignmentType; + /** + * 是否享有派驻津贴 + *

示例值:false + */ + private Boolean internationalAssignmentAllowance; + /** + * 是否提供住宿 + *

示例值:false + */ + private Boolean accommodation; + /** + * 描述 + *

示例值:外派信息的描述 + */ + private String description; + + /** + * 派驻信息ID + *

示例值:7046599238679447000 + * + * @param id + * @return + */ + public Builder id(String id) { + this.id = id; + return this; + } + + + /** + * Employment ID + *

示例值:7046599238679447000 + * + * @param employmentId + * @return + */ + public Builder employmentId(String employmentId) { + this.employmentId = employmentId; + return this; + } + + + /** + * 创建人 + *

示例值:7046599238679447000 + * + * @param createdBy + * @return + */ + public Builder createdBy(String createdBy) { + this.createdBy = createdBy; + return this; + } + + + /** + * 创建时间 + *

示例值:2021-08-18 16:04:21 + * + * @param createdAt + * @return + */ + public Builder createdAt(String createdAt) { + this.createdAt = createdAt; + return this; + } + + + /** + * 生效时间 + *

示例值:2023-08-29 + * + * @param effectiveTime + * @return + */ + public Builder effectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + return this; + } + + + /** + * 预计结束日期 + *

示例值:2023-12-29 + * + * @param internationalAssignmentExpectedEndDate + * @return + */ + public Builder internationalAssignmentExpectedEndDate(String internationalAssignmentExpectedEndDate) { + this.internationalAssignmentExpectedEndDate = internationalAssignmentExpectedEndDate; + return this; + } + + + /** + * 失效时间 + *

示例值:2023-12-29 + * + * @param expirationTime + * @return + */ + public Builder expirationTime(String expirationTime) { + this.expirationTime = expirationTime; + return this; + } + + + /** + * 删除时间 + *

示例值:2021-08-18 16:04:21 + * + * @param deletedAt + * @return + */ + public Builder deletedAt(String deletedAt) { + this.deletedAt = deletedAt; + return this; + } + + + /** + * 更新时间 + *

示例值:2021-08-18 16:04:21 + * + * @param updatedAt + * @return + */ + public Builder updatedAt(String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + + /** + * 更新人 + *

示例值:7046599238679447000 + * + * @param updatedBy + * @return + */ + public Builder updatedBy(String updatedBy) { + this.updatedBy = updatedBy; + return this; + } + + + /** + * 外派国家ID + *

示例值:7046599238679447084 + * + * @param assignmentCountry + * @return + */ + public Builder assignmentCountry(String assignmentCountry) { + this.assignmentCountry = assignmentCountry; + return this; + } + + + /** + * 外派城市ID + *

示例值:7046599238679447084 + * + * @param assignmentCity + * @return + */ + public Builder assignmentCity(String assignmentCity) { + this.assignmentCity = assignmentCity; + return this; + } + + + /** + * 外派公司ID + *

示例值:7046599238679447084 + * + * @param assignmentCompany + * @return + */ + public Builder assignmentCompany(String assignmentCompany) { + this.assignmentCompany = assignmentCompany; + return this; + } + + + /** + * 当前生效外派记录的外派状态 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_status - object_api_name:international_assignment + *

示例值: + * + * @param internationalAssignmentStatus + * @return + */ + public Builder internationalAssignmentStatus(Enum internationalAssignmentStatus) { + this.internationalAssignmentStatus = internationalAssignmentStatus; + return this; + } + + + /** + * 当前生效外派记录的外派类型 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_type - object_api_name:international_assignment + *

示例值: + * + * @param internationalAssignmentType + * @return + */ + public Builder internationalAssignmentType(Enum internationalAssignmentType) { + this.internationalAssignmentType = internationalAssignmentType; + return this; + } + + + /** + * 是否享有派驻津贴 + *

示例值:false + * + * @param internationalAssignmentAllowance + * @return + */ + public Builder internationalAssignmentAllowance(Boolean internationalAssignmentAllowance) { + this.internationalAssignmentAllowance = internationalAssignmentAllowance; + return this; + } + + + /** + * 是否提供住宿 + *

示例值:false + * + * @param accommodation + * @return + */ + public Builder accommodation(Boolean accommodation) { + this.accommodation = accommodation; + return this; + } + + + /** + * 描述 + *

示例值:外派信息的描述 + * + * @param description + * @return + */ + public Builder description(String description) { + this.description = description; + return this; + } + + + public InternationalAssignmentV2 build() { + return new InternationalAssignmentV2(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/InternationalAssignmentV2ForCreate.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/InternationalAssignmentV2ForCreate.java new file mode 100644 index 000000000..d8a78b4ef --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/InternationalAssignmentV2ForCreate.java @@ -0,0 +1,481 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class InternationalAssignmentV2ForCreate { + /** + * Employment ID + *

示例值:7046599238679447000 + */ + @SerializedName("employment_id") + private String employmentId; + /** + * 生效时间 + *

示例值:2023-08-29 + */ + @SerializedName("effective_time") + private String effectiveTime; + /** + * 预计结束日期 + *

示例值:2023-12-29 + */ + @SerializedName("international_assignment_expected_end_date") + private String internationalAssignmentExpectedEndDate; + /** + * 失效时间 + *

示例值:2023-12-29 + */ + @SerializedName("expiration_time") + private String expirationTime; + /** + * 外派国家ID + *

示例值:7046599238679447084 + */ + @SerializedName("assignment_country") + private String assignmentCountry; + /** + * 外派城市ID + *

示例值:7046599238679447084 + */ + @SerializedName("assignment_city") + private String assignmentCity; + /** + * 外派公司ID + *

示例值:7046599238679447084 + */ + @SerializedName("assignment_company") + private String assignmentCompany; + /** + * 当前生效外派记录的外派状态 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_status - object_api_name:international_assignment + *

示例值: + */ + @SerializedName("international_assignment_status") + private Enum internationalAssignmentStatus; + /** + * 当前生效外派记录的外派类型 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_type - object_api_name:international_assignment + *

示例值: + */ + @SerializedName("international_assignment_type") + private Enum internationalAssignmentType; + /** + * 是否享有派驻津贴 + *

示例值:true + */ + @SerializedName("international_assignment_allowance") + private Boolean internationalAssignmentAllowance; + /** + * 是否提供住宿 + *

示例值:true + */ + @SerializedName("accommodation") + private Boolean accommodation; + /** + * 描述 + *

示例值:外派信息的描述 + */ + @SerializedName("description") + private String description; + + // builder 开始 + public InternationalAssignmentV2ForCreate() { + } + + public InternationalAssignmentV2ForCreate(Builder builder) { + /** + * Employment ID + *

示例值:7046599238679447000 + */ + this.employmentId = builder.employmentId; + /** + * 生效时间 + *

示例值:2023-08-29 + */ + this.effectiveTime = builder.effectiveTime; + /** + * 预计结束日期 + *

示例值:2023-12-29 + */ + this.internationalAssignmentExpectedEndDate = builder.internationalAssignmentExpectedEndDate; + /** + * 失效时间 + *

示例值:2023-12-29 + */ + this.expirationTime = builder.expirationTime; + /** + * 外派国家ID + *

示例值:7046599238679447084 + */ + this.assignmentCountry = builder.assignmentCountry; + /** + * 外派城市ID + *

示例值:7046599238679447084 + */ + this.assignmentCity = builder.assignmentCity; + /** + * 外派公司ID + *

示例值:7046599238679447084 + */ + this.assignmentCompany = builder.assignmentCompany; + /** + * 当前生效外派记录的外派状态 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_status - object_api_name:international_assignment + *

示例值: + */ + this.internationalAssignmentStatus = builder.internationalAssignmentStatus; + /** + * 当前生效外派记录的外派类型 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_type - object_api_name:international_assignment + *

示例值: + */ + this.internationalAssignmentType = builder.internationalAssignmentType; + /** + * 是否享有派驻津贴 + *

示例值:true + */ + this.internationalAssignmentAllowance = builder.internationalAssignmentAllowance; + /** + * 是否提供住宿 + *

示例值:true + */ + this.accommodation = builder.accommodation; + /** + * 描述 + *

示例值:外派信息的描述 + */ + this.description = builder.description; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getEmploymentId() { + return this.employmentId; + } + + public void setEmploymentId(String employmentId) { + this.employmentId = employmentId; + } + + public String getEffectiveTime() { + return this.effectiveTime; + } + + public void setEffectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + } + + public String getInternationalAssignmentExpectedEndDate() { + return this.internationalAssignmentExpectedEndDate; + } + + public void setInternationalAssignmentExpectedEndDate(String internationalAssignmentExpectedEndDate) { + this.internationalAssignmentExpectedEndDate = internationalAssignmentExpectedEndDate; + } + + public String getExpirationTime() { + return this.expirationTime; + } + + public void setExpirationTime(String expirationTime) { + this.expirationTime = expirationTime; + } + + public String getAssignmentCountry() { + return this.assignmentCountry; + } + + public void setAssignmentCountry(String assignmentCountry) { + this.assignmentCountry = assignmentCountry; + } + + public String getAssignmentCity() { + return this.assignmentCity; + } + + public void setAssignmentCity(String assignmentCity) { + this.assignmentCity = assignmentCity; + } + + public String getAssignmentCompany() { + return this.assignmentCompany; + } + + public void setAssignmentCompany(String assignmentCompany) { + this.assignmentCompany = assignmentCompany; + } + + public Enum getInternationalAssignmentStatus() { + return this.internationalAssignmentStatus; + } + + public void setInternationalAssignmentStatus(Enum internationalAssignmentStatus) { + this.internationalAssignmentStatus = internationalAssignmentStatus; + } + + public Enum getInternationalAssignmentType() { + return this.internationalAssignmentType; + } + + public void setInternationalAssignmentType(Enum internationalAssignmentType) { + this.internationalAssignmentType = internationalAssignmentType; + } + + public Boolean getInternationalAssignmentAllowance() { + return this.internationalAssignmentAllowance; + } + + public void setInternationalAssignmentAllowance(Boolean internationalAssignmentAllowance) { + this.internationalAssignmentAllowance = internationalAssignmentAllowance; + } + + public Boolean getAccommodation() { + return this.accommodation; + } + + public void setAccommodation(Boolean accommodation) { + this.accommodation = accommodation; + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public static class Builder { + /** + * Employment ID + *

示例值:7046599238679447000 + */ + private String employmentId; + /** + * 生效时间 + *

示例值:2023-08-29 + */ + private String effectiveTime; + /** + * 预计结束日期 + *

示例值:2023-12-29 + */ + private String internationalAssignmentExpectedEndDate; + /** + * 失效时间 + *

示例值:2023-12-29 + */ + private String expirationTime; + /** + * 外派国家ID + *

示例值:7046599238679447084 + */ + private String assignmentCountry; + /** + * 外派城市ID + *

示例值:7046599238679447084 + */ + private String assignmentCity; + /** + * 外派公司ID + *

示例值:7046599238679447084 + */ + private String assignmentCompany; + /** + * 当前生效外派记录的外派状态 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_status - object_api_name:international_assignment + *

示例值: + */ + private Enum internationalAssignmentStatus; + /** + * 当前生效外派记录的外派类型 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_type - object_api_name:international_assignment + *

示例值: + */ + private Enum internationalAssignmentType; + /** + * 是否享有派驻津贴 + *

示例值:true + */ + private Boolean internationalAssignmentAllowance; + /** + * 是否提供住宿 + *

示例值:true + */ + private Boolean accommodation; + /** + * 描述 + *

示例值:外派信息的描述 + */ + private String description; + + /** + * Employment ID + *

示例值:7046599238679447000 + * + * @param employmentId + * @return + */ + public Builder employmentId(String employmentId) { + this.employmentId = employmentId; + return this; + } + + + /** + * 生效时间 + *

示例值:2023-08-29 + * + * @param effectiveTime + * @return + */ + public Builder effectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + return this; + } + + + /** + * 预计结束日期 + *

示例值:2023-12-29 + * + * @param internationalAssignmentExpectedEndDate + * @return + */ + public Builder internationalAssignmentExpectedEndDate(String internationalAssignmentExpectedEndDate) { + this.internationalAssignmentExpectedEndDate = internationalAssignmentExpectedEndDate; + return this; + } + + + /** + * 失效时间 + *

示例值:2023-12-29 + * + * @param expirationTime + * @return + */ + public Builder expirationTime(String expirationTime) { + this.expirationTime = expirationTime; + return this; + } + + + /** + * 外派国家ID + *

示例值:7046599238679447084 + * + * @param assignmentCountry + * @return + */ + public Builder assignmentCountry(String assignmentCountry) { + this.assignmentCountry = assignmentCountry; + return this; + } + + + /** + * 外派城市ID + *

示例值:7046599238679447084 + * + * @param assignmentCity + * @return + */ + public Builder assignmentCity(String assignmentCity) { + this.assignmentCity = assignmentCity; + return this; + } + + + /** + * 外派公司ID + *

示例值:7046599238679447084 + * + * @param assignmentCompany + * @return + */ + public Builder assignmentCompany(String assignmentCompany) { + this.assignmentCompany = assignmentCompany; + return this; + } + + + /** + * 当前生效外派记录的外派状态 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_status - object_api_name:international_assignment + *

示例值: + * + * @param internationalAssignmentStatus + * @return + */ + public Builder internationalAssignmentStatus(Enum internationalAssignmentStatus) { + this.internationalAssignmentStatus = internationalAssignmentStatus; + return this; + } + + + /** + * 当前生效外派记录的外派类型 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_type - object_api_name:international_assignment + *

示例值: + * + * @param internationalAssignmentType + * @return + */ + public Builder internationalAssignmentType(Enum internationalAssignmentType) { + this.internationalAssignmentType = internationalAssignmentType; + return this; + } + + + /** + * 是否享有派驻津贴 + *

示例值:true + * + * @param internationalAssignmentAllowance + * @return + */ + public Builder internationalAssignmentAllowance(Boolean internationalAssignmentAllowance) { + this.internationalAssignmentAllowance = internationalAssignmentAllowance; + return this; + } + + + /** + * 是否提供住宿 + *

示例值:true + * + * @param accommodation + * @return + */ + public Builder accommodation(Boolean accommodation) { + this.accommodation = accommodation; + return this; + } + + + /** + * 描述 + *

示例值:外派信息的描述 + * + * @param description + * @return + */ + public Builder description(String description) { + this.description = description; + return this; + } + + + public InternationalAssignmentV2ForCreate build() { + return new InternationalAssignmentV2ForCreate(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/InternationalAssignmentV2ForPatch.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/InternationalAssignmentV2ForPatch.java new file mode 100644 index 000000000..73138732d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/InternationalAssignmentV2ForPatch.java @@ -0,0 +1,444 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class InternationalAssignmentV2ForPatch { + /** + * 生效时间 + *

示例值:2023-08-29 + */ + @SerializedName("effective_time") + private String effectiveTime; + /** + * 预计结束日期 + *

示例值:2023-12-29 + */ + @SerializedName("international_assignment_expected_end_date") + private String internationalAssignmentExpectedEndDate; + /** + * 失效时间 + *

示例值:2023-12-29 + */ + @SerializedName("expiration_time") + private String expirationTime; + /** + * 外派国家ID + *

示例值:7046599238679447084 + */ + @SerializedName("assignment_country") + private String assignmentCountry; + /** + * 外派城市ID + *

示例值:7046599238679447084 + */ + @SerializedName("assignment_city") + private String assignmentCity; + /** + * 外派公司ID + *

示例值:7046599238679447084 + */ + @SerializedName("assignment_company") + private String assignmentCompany; + /** + * 当前生效外派记录的外派状态 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_status - object_api_name:international_assignment + *

示例值: + */ + @SerializedName("international_assignment_status") + private Enum internationalAssignmentStatus; + /** + * 当前生效外派记录的外派类型 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_type - object_api_name:international_assignment + *

示例值: + */ + @SerializedName("international_assignment_type") + private Enum internationalAssignmentType; + /** + * 是否享有派驻津贴 + *

示例值:true + */ + @SerializedName("international_assignment_allowance") + private Boolean internationalAssignmentAllowance; + /** + * 是否提供住宿 + *

示例值:true + */ + @SerializedName("accommodation") + private Boolean accommodation; + /** + * 描述 + *

示例值:外派信息的描述 + */ + @SerializedName("description") + private String description; + + // builder 开始 + public InternationalAssignmentV2ForPatch() { + } + + public InternationalAssignmentV2ForPatch(Builder builder) { + /** + * 生效时间 + *

示例值:2023-08-29 + */ + this.effectiveTime = builder.effectiveTime; + /** + * 预计结束日期 + *

示例值:2023-12-29 + */ + this.internationalAssignmentExpectedEndDate = builder.internationalAssignmentExpectedEndDate; + /** + * 失效时间 + *

示例值:2023-12-29 + */ + this.expirationTime = builder.expirationTime; + /** + * 外派国家ID + *

示例值:7046599238679447084 + */ + this.assignmentCountry = builder.assignmentCountry; + /** + * 外派城市ID + *

示例值:7046599238679447084 + */ + this.assignmentCity = builder.assignmentCity; + /** + * 外派公司ID + *

示例值:7046599238679447084 + */ + this.assignmentCompany = builder.assignmentCompany; + /** + * 当前生效外派记录的外派状态 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_status - object_api_name:international_assignment + *

示例值: + */ + this.internationalAssignmentStatus = builder.internationalAssignmentStatus; + /** + * 当前生效外派记录的外派类型 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_type - object_api_name:international_assignment + *

示例值: + */ + this.internationalAssignmentType = builder.internationalAssignmentType; + /** + * 是否享有派驻津贴 + *

示例值:true + */ + this.internationalAssignmentAllowance = builder.internationalAssignmentAllowance; + /** + * 是否提供住宿 + *

示例值:true + */ + this.accommodation = builder.accommodation; + /** + * 描述 + *

示例值:外派信息的描述 + */ + this.description = builder.description; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getEffectiveTime() { + return this.effectiveTime; + } + + public void setEffectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + } + + public String getInternationalAssignmentExpectedEndDate() { + return this.internationalAssignmentExpectedEndDate; + } + + public void setInternationalAssignmentExpectedEndDate(String internationalAssignmentExpectedEndDate) { + this.internationalAssignmentExpectedEndDate = internationalAssignmentExpectedEndDate; + } + + public String getExpirationTime() { + return this.expirationTime; + } + + public void setExpirationTime(String expirationTime) { + this.expirationTime = expirationTime; + } + + public String getAssignmentCountry() { + return this.assignmentCountry; + } + + public void setAssignmentCountry(String assignmentCountry) { + this.assignmentCountry = assignmentCountry; + } + + public String getAssignmentCity() { + return this.assignmentCity; + } + + public void setAssignmentCity(String assignmentCity) { + this.assignmentCity = assignmentCity; + } + + public String getAssignmentCompany() { + return this.assignmentCompany; + } + + public void setAssignmentCompany(String assignmentCompany) { + this.assignmentCompany = assignmentCompany; + } + + public Enum getInternationalAssignmentStatus() { + return this.internationalAssignmentStatus; + } + + public void setInternationalAssignmentStatus(Enum internationalAssignmentStatus) { + this.internationalAssignmentStatus = internationalAssignmentStatus; + } + + public Enum getInternationalAssignmentType() { + return this.internationalAssignmentType; + } + + public void setInternationalAssignmentType(Enum internationalAssignmentType) { + this.internationalAssignmentType = internationalAssignmentType; + } + + public Boolean getInternationalAssignmentAllowance() { + return this.internationalAssignmentAllowance; + } + + public void setInternationalAssignmentAllowance(Boolean internationalAssignmentAllowance) { + this.internationalAssignmentAllowance = internationalAssignmentAllowance; + } + + public Boolean getAccommodation() { + return this.accommodation; + } + + public void setAccommodation(Boolean accommodation) { + this.accommodation = accommodation; + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public static class Builder { + /** + * 生效时间 + *

示例值:2023-08-29 + */ + private String effectiveTime; + /** + * 预计结束日期 + *

示例值:2023-12-29 + */ + private String internationalAssignmentExpectedEndDate; + /** + * 失效时间 + *

示例值:2023-12-29 + */ + private String expirationTime; + /** + * 外派国家ID + *

示例值:7046599238679447084 + */ + private String assignmentCountry; + /** + * 外派城市ID + *

示例值:7046599238679447084 + */ + private String assignmentCity; + /** + * 外派公司ID + *

示例值:7046599238679447084 + */ + private String assignmentCompany; + /** + * 当前生效外派记录的外派状态 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_status - object_api_name:international_assignment + *

示例值: + */ + private Enum internationalAssignmentStatus; + /** + * 当前生效外派记录的外派类型 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_type - object_api_name:international_assignment + *

示例值: + */ + private Enum internationalAssignmentType; + /** + * 是否享有派驻津贴 + *

示例值:true + */ + private Boolean internationalAssignmentAllowance; + /** + * 是否提供住宿 + *

示例值:true + */ + private Boolean accommodation; + /** + * 描述 + *

示例值:外派信息的描述 + */ + private String description; + + /** + * 生效时间 + *

示例值:2023-08-29 + * + * @param effectiveTime + * @return + */ + public Builder effectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + return this; + } + + + /** + * 预计结束日期 + *

示例值:2023-12-29 + * + * @param internationalAssignmentExpectedEndDate + * @return + */ + public Builder internationalAssignmentExpectedEndDate(String internationalAssignmentExpectedEndDate) { + this.internationalAssignmentExpectedEndDate = internationalAssignmentExpectedEndDate; + return this; + } + + + /** + * 失效时间 + *

示例值:2023-12-29 + * + * @param expirationTime + * @return + */ + public Builder expirationTime(String expirationTime) { + this.expirationTime = expirationTime; + return this; + } + + + /** + * 外派国家ID + *

示例值:7046599238679447084 + * + * @param assignmentCountry + * @return + */ + public Builder assignmentCountry(String assignmentCountry) { + this.assignmentCountry = assignmentCountry; + return this; + } + + + /** + * 外派城市ID + *

示例值:7046599238679447084 + * + * @param assignmentCity + * @return + */ + public Builder assignmentCity(String assignmentCity) { + this.assignmentCity = assignmentCity; + return this; + } + + + /** + * 外派公司ID + *

示例值:7046599238679447084 + * + * @param assignmentCompany + * @return + */ + public Builder assignmentCompany(String assignmentCompany) { + this.assignmentCompany = assignmentCompany; + return this; + } + + + /** + * 当前生效外派记录的外派状态 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_status - object_api_name:international_assignment + *

示例值: + * + * @param internationalAssignmentStatus + * @return + */ + public Builder internationalAssignmentStatus(Enum internationalAssignmentStatus) { + this.internationalAssignmentStatus = internationalAssignmentStatus; + return this; + } + + + /** + * 当前生效外派记录的外派类型 - 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:international_assignment_type - object_api_name:international_assignment + *

示例值: + * + * @param internationalAssignmentType + * @return + */ + public Builder internationalAssignmentType(Enum internationalAssignmentType) { + this.internationalAssignmentType = internationalAssignmentType; + return this; + } + + + /** + * 是否享有派驻津贴 + *

示例值:true + * + * @param internationalAssignmentAllowance + * @return + */ + public Builder internationalAssignmentAllowance(Boolean internationalAssignmentAllowance) { + this.internationalAssignmentAllowance = internationalAssignmentAllowance; + return this; + } + + + /** + * 是否提供住宿 + *

示例值:true + * + * @param accommodation + * @return + */ + public Builder accommodation(Boolean accommodation) { + this.accommodation = accommodation; + return this; + } + + + /** + * 描述 + *

示例值:外派信息的描述 + * + * @param description + * @return + */ + public Builder description(String description) { + this.description = description; + return this; + } + + + public InternationalAssignmentV2ForPatch build() { + return new InternationalAssignmentV2ForPatch(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Job.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Job.java new file mode 100644 index 000000000..aa5d48564 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Job.java @@ -0,0 +1,481 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Job { + /** + * 实体在CoreHR内部的唯一键 + *

示例值:4698040628992333549 + */ + @SerializedName("id") + private String id; + /** + * 编码 + *

示例值:JP422119 + */ + @SerializedName("code") + private String code; + /** + * 名称 + *

示例值: + */ + @SerializedName("name") + private I18n[] name; + /** + * 描述 + *

示例值: + */ + @SerializedName("description") + private I18n[] description; + /** + * 启用 + *

示例值:true + */ + @SerializedName("active") + private Boolean active; + /** + * 职务头衔 + *

示例值: + */ + @SerializedName("job_title") + private I18n[] jobTitle; + /** + * 序列 + *

示例值: + */ + @SerializedName("job_family_id_list") + private String[] jobFamilyIdList; + /** + * 职级 + *

示例值: + */ + @SerializedName("job_level_id_list") + private String[] jobLevelIdList; + /** + * 工时制度,引用WorkingHoursType的ID + *

示例值:6890452208593372679 + */ + @SerializedName("working_hours_type_id") + private String workingHoursTypeId; + /** + * 生效时间 + *

示例值:2020-01-01 00:00:00 + */ + @SerializedName("effective_time") + private String effectiveTime; + /** + * 失效时间 + *

示例值:2021-01-01 00:00:00 + */ + @SerializedName("expiration_time") + private String expirationTime; + /** + * 自定义字段 + *

示例值: + */ + @SerializedName("custom_fields") + private ObjectFieldData[] customFields; + + // builder 开始 + public Job() { + } + + public Job(Builder builder) { + /** + * 实体在CoreHR内部的唯一键 + *

示例值:4698040628992333549 + */ + this.id = builder.id; + /** + * 编码 + *

示例值:JP422119 + */ + this.code = builder.code; + /** + * 名称 + *

示例值: + */ + this.name = builder.name; + /** + * 描述 + *

示例值: + */ + this.description = builder.description; + /** + * 启用 + *

示例值:true + */ + this.active = builder.active; + /** + * 职务头衔 + *

示例值: + */ + this.jobTitle = builder.jobTitle; + /** + * 序列 + *

示例值: + */ + this.jobFamilyIdList = builder.jobFamilyIdList; + /** + * 职级 + *

示例值: + */ + this.jobLevelIdList = builder.jobLevelIdList; + /** + * 工时制度,引用WorkingHoursType的ID + *

示例值:6890452208593372679 + */ + this.workingHoursTypeId = builder.workingHoursTypeId; + /** + * 生效时间 + *

示例值:2020-01-01 00:00:00 + */ + this.effectiveTime = builder.effectiveTime; + /** + * 失效时间 + *

示例值:2021-01-01 00:00:00 + */ + this.expirationTime = builder.expirationTime; + /** + * 自定义字段 + *

示例值: + */ + this.customFields = builder.customFields; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public I18n[] getName() { + return this.name; + } + + public void setName(I18n[] name) { + this.name = name; + } + + public I18n[] getDescription() { + return this.description; + } + + public void setDescription(I18n[] description) { + this.description = description; + } + + public Boolean getActive() { + return this.active; + } + + public void setActive(Boolean active) { + this.active = active; + } + + public I18n[] getJobTitle() { + return this.jobTitle; + } + + public void setJobTitle(I18n[] jobTitle) { + this.jobTitle = jobTitle; + } + + public String[] getJobFamilyIdList() { + return this.jobFamilyIdList; + } + + public void setJobFamilyIdList(String[] jobFamilyIdList) { + this.jobFamilyIdList = jobFamilyIdList; + } + + public String[] getJobLevelIdList() { + return this.jobLevelIdList; + } + + public void setJobLevelIdList(String[] jobLevelIdList) { + this.jobLevelIdList = jobLevelIdList; + } + + public String getWorkingHoursTypeId() { + return this.workingHoursTypeId; + } + + public void setWorkingHoursTypeId(String workingHoursTypeId) { + this.workingHoursTypeId = workingHoursTypeId; + } + + public String getEffectiveTime() { + return this.effectiveTime; + } + + public void setEffectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + } + + public String getExpirationTime() { + return this.expirationTime; + } + + public void setExpirationTime(String expirationTime) { + this.expirationTime = expirationTime; + } + + public ObjectFieldData[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(ObjectFieldData[] customFields) { + this.customFields = customFields; + } + + public static class Builder { + /** + * 实体在CoreHR内部的唯一键 + *

示例值:4698040628992333549 + */ + private String id; + /** + * 编码 + *

示例值:JP422119 + */ + private String code; + /** + * 名称 + *

示例值: + */ + private I18n[] name; + /** + * 描述 + *

示例值: + */ + private I18n[] description; + /** + * 启用 + *

示例值:true + */ + private Boolean active; + /** + * 职务头衔 + *

示例值: + */ + private I18n[] jobTitle; + /** + * 序列 + *

示例值: + */ + private String[] jobFamilyIdList; + /** + * 职级 + *

示例值: + */ + private String[] jobLevelIdList; + /** + * 工时制度,引用WorkingHoursType的ID + *

示例值:6890452208593372679 + */ + private String workingHoursTypeId; + /** + * 生效时间 + *

示例值:2020-01-01 00:00:00 + */ + private String effectiveTime; + /** + * 失效时间 + *

示例值:2021-01-01 00:00:00 + */ + private String expirationTime; + /** + * 自定义字段 + *

示例值: + */ + private ObjectFieldData[] customFields; + + /** + * 实体在CoreHR内部的唯一键 + *

示例值:4698040628992333549 + * + * @param id + * @return + */ + public Builder id(String id) { + this.id = id; + return this; + } + + + /** + * 编码 + *

示例值:JP422119 + * + * @param code + * @return + */ + public Builder code(String code) { + this.code = code; + return this; + } + + + /** + * 名称 + *

示例值: + * + * @param name + * @return + */ + public Builder name(I18n[] name) { + this.name = name; + return this; + } + + + /** + * 描述 + *

示例值: + * + * @param description + * @return + */ + public Builder description(I18n[] description) { + this.description = description; + return this; + } + + + /** + * 启用 + *

示例值:true + * + * @param active + * @return + */ + public Builder active(Boolean active) { + this.active = active; + return this; + } + + + /** + * 职务头衔 + *

示例值: + * + * @param jobTitle + * @return + */ + public Builder jobTitle(I18n[] jobTitle) { + this.jobTitle = jobTitle; + return this; + } + + + /** + * 序列 + *

示例值: + * + * @param jobFamilyIdList + * @return + */ + public Builder jobFamilyIdList(String[] jobFamilyIdList) { + this.jobFamilyIdList = jobFamilyIdList; + return this; + } + + + /** + * 职级 + *

示例值: + * + * @param jobLevelIdList + * @return + */ + public Builder jobLevelIdList(String[] jobLevelIdList) { + this.jobLevelIdList = jobLevelIdList; + return this; + } + + + /** + * 工时制度,引用WorkingHoursType的ID + *

示例值:6890452208593372679 + * + * @param workingHoursTypeId + * @return + */ + public Builder workingHoursTypeId(String workingHoursTypeId) { + this.workingHoursTypeId = workingHoursTypeId; + return this; + } + + + /** + * 生效时间 + *

示例值:2020-01-01 00:00:00 + * + * @param effectiveTime + * @return + */ + public Builder effectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + return this; + } + + + /** + * 失效时间 + *

示例值:2021-01-01 00:00:00 + * + * @param expirationTime + * @return + */ + public Builder expirationTime(String expirationTime) { + this.expirationTime = expirationTime; + return this; + } + + + /** + * 自定义字段 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(ObjectFieldData[] customFields) { + this.customFields = customFields; + return this; + } + + + public Job build() { + return new Job(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/JobChange.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/JobChange.java new file mode 100644 index 000000000..f12019be0 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/JobChange.java @@ -0,0 +1,419 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class JobChange { + /** + * 异动记录 id + *

示例值:6991776076699549697 + */ + @SerializedName("job_change_id") + private String jobChangeId; + /** + * 雇员 id + *

示例值:ou_a294793e8fa21529f2a60e3e9de45520 + */ + @SerializedName("employment_id") + private String employmentId; + /** + * 异动状态 + *

示例值:Approved + */ + @SerializedName("status") + private String status; + /** + * 异动类型 + *

示例值:direct_leader_change + */ + @SerializedName("transfer_type_unique_identifier") + private String transferTypeUniqueIdentifier; + /** + * 异动原因 + *

示例值:involuntary_transfer + */ + @SerializedName("transfer_reason_unique_identifier") + private String transferReasonUniqueIdentifier; + /** + * 异动流程 id + *

示例值:6991776078461142564 + */ + @SerializedName("process_id") + private String processId; + /** + * 生效时间 + *

示例值:2022-03-01 + */ + @SerializedName("effective_date") + private String effectiveDate; + /** + * 创建时间 + *

示例值:1627899724000 + */ + @SerializedName("created_time") + private String createdTime; + /** + * 更新时间 + *

示例值:1647434443000 + */ + @SerializedName("updated_time") + private String updatedTime; + /** + * 异动详细信息 + *

示例值: + */ + @SerializedName("transfer_info") + private TransferInfo transferInfo; + + // builder 开始 + public JobChange() { + } + + public JobChange(Builder builder) { + /** + * 异动记录 id + *

示例值:6991776076699549697 + */ + this.jobChangeId = builder.jobChangeId; + /** + * 雇员 id + *

示例值:ou_a294793e8fa21529f2a60e3e9de45520 + */ + this.employmentId = builder.employmentId; + /** + * 异动状态 + *

示例值:Approved + */ + this.status = builder.status; + /** + * 异动类型 + *

示例值:direct_leader_change + */ + this.transferTypeUniqueIdentifier = builder.transferTypeUniqueIdentifier; + /** + * 异动原因 + *

示例值:involuntary_transfer + */ + this.transferReasonUniqueIdentifier = builder.transferReasonUniqueIdentifier; + /** + * 异动流程 id + *

示例值:6991776078461142564 + */ + this.processId = builder.processId; + /** + * 生效时间 + *

示例值:2022-03-01 + */ + this.effectiveDate = builder.effectiveDate; + /** + * 创建时间 + *

示例值:1627899724000 + */ + this.createdTime = builder.createdTime; + /** + * 更新时间 + *

示例值:1647434443000 + */ + this.updatedTime = builder.updatedTime; + /** + * 异动详细信息 + *

示例值: + */ + this.transferInfo = builder.transferInfo; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getJobChangeId() { + return this.jobChangeId; + } + + public void setJobChangeId(String jobChangeId) { + this.jobChangeId = jobChangeId; + } + + public String getEmploymentId() { + return this.employmentId; + } + + public void setEmploymentId(String employmentId) { + this.employmentId = employmentId; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getTransferTypeUniqueIdentifier() { + return this.transferTypeUniqueIdentifier; + } + + public void setTransferTypeUniqueIdentifier(String transferTypeUniqueIdentifier) { + this.transferTypeUniqueIdentifier = transferTypeUniqueIdentifier; + } + + public String getTransferReasonUniqueIdentifier() { + return this.transferReasonUniqueIdentifier; + } + + public void setTransferReasonUniqueIdentifier(String transferReasonUniqueIdentifier) { + this.transferReasonUniqueIdentifier = transferReasonUniqueIdentifier; + } + + public String getProcessId() { + return this.processId; + } + + public void setProcessId(String processId) { + this.processId = processId; + } + + public String getEffectiveDate() { + return this.effectiveDate; + } + + public void setEffectiveDate(String effectiveDate) { + this.effectiveDate = effectiveDate; + } + + public String getCreatedTime() { + return this.createdTime; + } + + public void setCreatedTime(String createdTime) { + this.createdTime = createdTime; + } + + public String getUpdatedTime() { + return this.updatedTime; + } + + public void setUpdatedTime(String updatedTime) { + this.updatedTime = updatedTime; + } + + public TransferInfo getTransferInfo() { + return this.transferInfo; + } + + public void setTransferInfo(TransferInfo transferInfo) { + this.transferInfo = transferInfo; + } + + public static class Builder { + /** + * 异动记录 id + *

示例值:6991776076699549697 + */ + private String jobChangeId; + /** + * 雇员 id + *

示例值:ou_a294793e8fa21529f2a60e3e9de45520 + */ + private String employmentId; + /** + * 异动状态 + *

示例值:Approved + */ + private String status; + /** + * 异动类型 + *

示例值:direct_leader_change + */ + private String transferTypeUniqueIdentifier; + /** + * 异动原因 + *

示例值:involuntary_transfer + */ + private String transferReasonUniqueIdentifier; + /** + * 异动流程 id + *

示例值:6991776078461142564 + */ + private String processId; + /** + * 生效时间 + *

示例值:2022-03-01 + */ + private String effectiveDate; + /** + * 创建时间 + *

示例值:1627899724000 + */ + private String createdTime; + /** + * 更新时间 + *

示例值:1647434443000 + */ + private String updatedTime; + /** + * 异动详细信息 + *

示例值: + */ + private TransferInfo transferInfo; + + /** + * 异动记录 id + *

示例值:6991776076699549697 + * + * @param jobChangeId + * @return + */ + public Builder jobChangeId(String jobChangeId) { + this.jobChangeId = jobChangeId; + return this; + } + + + /** + * 雇员 id + *

示例值:ou_a294793e8fa21529f2a60e3e9de45520 + * + * @param employmentId + * @return + */ + public Builder employmentId(String employmentId) { + this.employmentId = employmentId; + return this; + } + + + /** + * 异动状态 + *

示例值:Approved + * + * @param status + * @return + */ + public Builder status(String status) { + this.status = status; + return this; + } + + /** + * 异动状态 + *

示例值:Approved + * + * @param status {@link com.lark.oapi.service.corehr.v2.enums.JobChangeJobChangeStatusEnum} + * @return + */ + public Builder status(com.lark.oapi.service.corehr.v2.enums.JobChangeJobChangeStatusEnum status) { + this.status = status.getValue(); + return this; + } + + + /** + * 异动类型 + *

示例值:direct_leader_change + * + * @param transferTypeUniqueIdentifier + * @return + */ + public Builder transferTypeUniqueIdentifier(String transferTypeUniqueIdentifier) { + this.transferTypeUniqueIdentifier = transferTypeUniqueIdentifier; + return this; + } + + + /** + * 异动原因 + *

示例值:involuntary_transfer + * + * @param transferReasonUniqueIdentifier + * @return + */ + public Builder transferReasonUniqueIdentifier(String transferReasonUniqueIdentifier) { + this.transferReasonUniqueIdentifier = transferReasonUniqueIdentifier; + return this; + } + + + /** + * 异动流程 id + *

示例值:6991776078461142564 + * + * @param processId + * @return + */ + public Builder processId(String processId) { + this.processId = processId; + return this; + } + + + /** + * 生效时间 + *

示例值:2022-03-01 + * + * @param effectiveDate + * @return + */ + public Builder effectiveDate(String effectiveDate) { + this.effectiveDate = effectiveDate; + return this; + } + + + /** + * 创建时间 + *

示例值:1627899724000 + * + * @param createdTime + * @return + */ + public Builder createdTime(String createdTime) { + this.createdTime = createdTime; + return this; + } + + + /** + * 更新时间 + *

示例值:1647434443000 + * + * @param updatedTime + * @return + */ + public Builder updatedTime(String updatedTime) { + this.updatedTime = updatedTime; + return this; + } + + + /** + * 异动详细信息 + *

示例值: + * + * @param transferInfo + * @return + */ + public Builder transferInfo(TransferInfo transferInfo) { + this.transferInfo = transferInfo; + return this; + } + + + public JobChange build() { + return new JobChange(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/JobData.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/JobData.java new file mode 100644 index 000000000..df841227e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/JobData.java @@ -0,0 +1,925 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class JobData { + /** + * 任职信息 ID + *

示例值:6890452208593372679 + */ + @SerializedName("job_data_id") + private String jobDataId; + /** + * 任职记录版本 ID + *

示例值:6890452208593372697 + */ + @SerializedName("version_id") + private String versionId; + /** + * 人员类型 ID,枚举值及详细信息可通过【查询单个人员类型】接口查询获得 + *

示例值:6890452208593372679 + */ + @SerializedName("employee_type_id") + private String employeeTypeId; + /** + * 工时制度 ID,枚举值及详细信息可通过【查询单个工时制度】接口查询获得 + *

示例值:6890452208593372679 + */ + @SerializedName("working_hours_type_id") + private String workingHoursTypeId; + /** + * 工作地点 ID,枚举值及详细信息可通过【查询单个地点】接口查询获得 + *

示例值:6890452208593372679 + */ + @SerializedName("work_location_id") + private String workLocationId; + /** + * 部门 ID,枚举值及详细信息可通过【查询单个部门】接口查询获得 + *

示例值:6890452208593372679 + */ + @SerializedName("department_id") + private String departmentId; + /** + * 职务 ID,枚举值及详细信息可通过【查询单个职务】接口查询获得 + *

示例值:6890452208593372679 + */ + @SerializedName("job_id") + private String jobId; + /** + * 职务级别 ID,枚举值及详细信息可通过【查询单个职务级别】接口查询获得 + *

示例值:6890452208593372679 + */ + @SerializedName("job_level_id") + private String jobLevelId; + /** + * 职等 ID + *

示例值:6890452208593372679 + */ + @SerializedName("job_grade_id") + private String jobGradeId; + /** + * 职务序列 ID,枚举值及详细信息可通过【查询单个职务序列】接口查询获得 + *

示例值:1245678 + */ + @SerializedName("job_family_id") + private String jobFamilyId; + /** + * 试用期开始日期 + *

示例值:2018-03-16T00:00:00 + */ + @SerializedName("probation_start_date") + private String probationStartDate; + /** + * 试用期结束日期(实际结束日期) + *

示例值:2019-05-24T00:00:00 + */ + @SerializedName("probation_end_date") + private String probationEndDate; + /** + * 是否为主任职 + *

示例值:true + */ + @SerializedName("primary_job_data") + private Boolean primaryJobData; + /** + * 雇佣 ID + *

示例值:6893014062142064135 + */ + @SerializedName("employment_id") + private String employmentId; + /** + * 生效时间 + *

示例值:2020-05-01 00:00:00 + */ + @SerializedName("effective_time") + private String effectiveTime; + /** + * 失效时间 + *

示例值:2020-05-02 00:00:00 + */ + @SerializedName("expiration_time") + private String expirationTime; + /** + * 任职原因,枚举值可通过文档【飞书人事枚举常量】任职原因(assignment_start_reason)枚举定义部分获得 + *

示例值:onboarding + */ + @SerializedName("assignment_start_reason") + private Enum assignmentStartReason; + /** + * 预计试用期结束日期 + *

示例值:2006-01-02 + */ + @SerializedName("probation_expected_end_date") + private String probationExpectedEndDate; + /** + * 试用期结果,枚举值可通过文档【飞书人事枚举常量】试用期结果(probation_outcome)枚举定义部分获得 + *

示例值:passed + */ + @SerializedName("probation_outcome") + private Enum probationOutcome; + /** + * 直属上级 + *

示例值: + */ + @SerializedName("direct_manager") + private BasicJobData directManager; + /** + * 虚线上级 + *

示例值: + */ + @SerializedName("dotted_line_managers") + private BasicJobData[] dottedLineManagers; + /** + * 第二实线主管 + *

示例值:6890452208593372679 + */ + @SerializedName("second_direct_manager") + private BasicJobData secondDirectManager; + /** + * 成本中心分摊信息 + *

示例值: + */ + @SerializedName("cost_center_rates") + private JobDataCostCenter[] costCenterRates; + /** + * 自定义字段 + *

示例值: + */ + @SerializedName("custom_fields") + private CustomFieldData[] customFields; + + // builder 开始 + public JobData() { + } + + public JobData(Builder builder) { + /** + * 任职信息 ID + *

示例值:6890452208593372679 + */ + this.jobDataId = builder.jobDataId; + /** + * 任职记录版本 ID + *

示例值:6890452208593372697 + */ + this.versionId = builder.versionId; + /** + * 人员类型 ID,枚举值及详细信息可通过【查询单个人员类型】接口查询获得 + *

示例值:6890452208593372679 + */ + this.employeeTypeId = builder.employeeTypeId; + /** + * 工时制度 ID,枚举值及详细信息可通过【查询单个工时制度】接口查询获得 + *

示例值:6890452208593372679 + */ + this.workingHoursTypeId = builder.workingHoursTypeId; + /** + * 工作地点 ID,枚举值及详细信息可通过【查询单个地点】接口查询获得 + *

示例值:6890452208593372679 + */ + this.workLocationId = builder.workLocationId; + /** + * 部门 ID,枚举值及详细信息可通过【查询单个部门】接口查询获得 + *

示例值:6890452208593372679 + */ + this.departmentId = builder.departmentId; + /** + * 职务 ID,枚举值及详细信息可通过【查询单个职务】接口查询获得 + *

示例值:6890452208593372679 + */ + this.jobId = builder.jobId; + /** + * 职务级别 ID,枚举值及详细信息可通过【查询单个职务级别】接口查询获得 + *

示例值:6890452208593372679 + */ + this.jobLevelId = builder.jobLevelId; + /** + * 职等 ID + *

示例值:6890452208593372679 + */ + this.jobGradeId = builder.jobGradeId; + /** + * 职务序列 ID,枚举值及详细信息可通过【查询单个职务序列】接口查询获得 + *

示例值:1245678 + */ + this.jobFamilyId = builder.jobFamilyId; + /** + * 试用期开始日期 + *

示例值:2018-03-16T00:00:00 + */ + this.probationStartDate = builder.probationStartDate; + /** + * 试用期结束日期(实际结束日期) + *

示例值:2019-05-24T00:00:00 + */ + this.probationEndDate = builder.probationEndDate; + /** + * 是否为主任职 + *

示例值:true + */ + this.primaryJobData = builder.primaryJobData; + /** + * 雇佣 ID + *

示例值:6893014062142064135 + */ + this.employmentId = builder.employmentId; + /** + * 生效时间 + *

示例值:2020-05-01 00:00:00 + */ + this.effectiveTime = builder.effectiveTime; + /** + * 失效时间 + *

示例值:2020-05-02 00:00:00 + */ + this.expirationTime = builder.expirationTime; + /** + * 任职原因,枚举值可通过文档【飞书人事枚举常量】任职原因(assignment_start_reason)枚举定义部分获得 + *

示例值:onboarding + */ + this.assignmentStartReason = builder.assignmentStartReason; + /** + * 预计试用期结束日期 + *

示例值:2006-01-02 + */ + this.probationExpectedEndDate = builder.probationExpectedEndDate; + /** + * 试用期结果,枚举值可通过文档【飞书人事枚举常量】试用期结果(probation_outcome)枚举定义部分获得 + *

示例值:passed + */ + this.probationOutcome = builder.probationOutcome; + /** + * 直属上级 + *

示例值: + */ + this.directManager = builder.directManager; + /** + * 虚线上级 + *

示例值: + */ + this.dottedLineManagers = builder.dottedLineManagers; + /** + * 第二实线主管 + *

示例值:6890452208593372679 + */ + this.secondDirectManager = builder.secondDirectManager; + /** + * 成本中心分摊信息 + *

示例值: + */ + this.costCenterRates = builder.costCenterRates; + /** + * 自定义字段 + *

示例值: + */ + this.customFields = builder.customFields; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getJobDataId() { + return this.jobDataId; + } + + public void setJobDataId(String jobDataId) { + this.jobDataId = jobDataId; + } + + public String getVersionId() { + return this.versionId; + } + + public void setVersionId(String versionId) { + this.versionId = versionId; + } + + public String getEmployeeTypeId() { + return this.employeeTypeId; + } + + public void setEmployeeTypeId(String employeeTypeId) { + this.employeeTypeId = employeeTypeId; + } + + public String getWorkingHoursTypeId() { + return this.workingHoursTypeId; + } + + public void setWorkingHoursTypeId(String workingHoursTypeId) { + this.workingHoursTypeId = workingHoursTypeId; + } + + public String getWorkLocationId() { + return this.workLocationId; + } + + public void setWorkLocationId(String workLocationId) { + this.workLocationId = workLocationId; + } + + public String getDepartmentId() { + return this.departmentId; + } + + public void setDepartmentId(String departmentId) { + this.departmentId = departmentId; + } + + public String getJobId() { + return this.jobId; + } + + public void setJobId(String jobId) { + this.jobId = jobId; + } + + public String getJobLevelId() { + return this.jobLevelId; + } + + public void setJobLevelId(String jobLevelId) { + this.jobLevelId = jobLevelId; + } + + public String getJobGradeId() { + return this.jobGradeId; + } + + public void setJobGradeId(String jobGradeId) { + this.jobGradeId = jobGradeId; + } + + public String getJobFamilyId() { + return this.jobFamilyId; + } + + public void setJobFamilyId(String jobFamilyId) { + this.jobFamilyId = jobFamilyId; + } + + public String getProbationStartDate() { + return this.probationStartDate; + } + + public void setProbationStartDate(String probationStartDate) { + this.probationStartDate = probationStartDate; + } + + public String getProbationEndDate() { + return this.probationEndDate; + } + + public void setProbationEndDate(String probationEndDate) { + this.probationEndDate = probationEndDate; + } + + public Boolean getPrimaryJobData() { + return this.primaryJobData; + } + + public void setPrimaryJobData(Boolean primaryJobData) { + this.primaryJobData = primaryJobData; + } + + public String getEmploymentId() { + return this.employmentId; + } + + public void setEmploymentId(String employmentId) { + this.employmentId = employmentId; + } + + public String getEffectiveTime() { + return this.effectiveTime; + } + + public void setEffectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + } + + public String getExpirationTime() { + return this.expirationTime; + } + + public void setExpirationTime(String expirationTime) { + this.expirationTime = expirationTime; + } + + public Enum getAssignmentStartReason() { + return this.assignmentStartReason; + } + + public void setAssignmentStartReason(Enum assignmentStartReason) { + this.assignmentStartReason = assignmentStartReason; + } + + public String getProbationExpectedEndDate() { + return this.probationExpectedEndDate; + } + + public void setProbationExpectedEndDate(String probationExpectedEndDate) { + this.probationExpectedEndDate = probationExpectedEndDate; + } + + public Enum getProbationOutcome() { + return this.probationOutcome; + } + + public void setProbationOutcome(Enum probationOutcome) { + this.probationOutcome = probationOutcome; + } + + public BasicJobData getDirectManager() { + return this.directManager; + } + + public void setDirectManager(BasicJobData directManager) { + this.directManager = directManager; + } + + public BasicJobData[] getDottedLineManagers() { + return this.dottedLineManagers; + } + + public void setDottedLineManagers(BasicJobData[] dottedLineManagers) { + this.dottedLineManagers = dottedLineManagers; + } + + public BasicJobData getSecondDirectManager() { + return this.secondDirectManager; + } + + public void setSecondDirectManager(BasicJobData secondDirectManager) { + this.secondDirectManager = secondDirectManager; + } + + public JobDataCostCenter[] getCostCenterRates() { + return this.costCenterRates; + } + + public void setCostCenterRates(JobDataCostCenter[] costCenterRates) { + this.costCenterRates = costCenterRates; + } + + public CustomFieldData[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(CustomFieldData[] customFields) { + this.customFields = customFields; + } + + public static class Builder { + /** + * 任职信息 ID + *

示例值:6890452208593372679 + */ + private String jobDataId; + /** + * 任职记录版本 ID + *

示例值:6890452208593372697 + */ + private String versionId; + /** + * 人员类型 ID,枚举值及详细信息可通过【查询单个人员类型】接口查询获得 + *

示例值:6890452208593372679 + */ + private String employeeTypeId; + /** + * 工时制度 ID,枚举值及详细信息可通过【查询单个工时制度】接口查询获得 + *

示例值:6890452208593372679 + */ + private String workingHoursTypeId; + /** + * 工作地点 ID,枚举值及详细信息可通过【查询单个地点】接口查询获得 + *

示例值:6890452208593372679 + */ + private String workLocationId; + /** + * 部门 ID,枚举值及详细信息可通过【查询单个部门】接口查询获得 + *

示例值:6890452208593372679 + */ + private String departmentId; + /** + * 职务 ID,枚举值及详细信息可通过【查询单个职务】接口查询获得 + *

示例值:6890452208593372679 + */ + private String jobId; + /** + * 职务级别 ID,枚举值及详细信息可通过【查询单个职务级别】接口查询获得 + *

示例值:6890452208593372679 + */ + private String jobLevelId; + /** + * 职等 ID + *

示例值:6890452208593372679 + */ + private String jobGradeId; + /** + * 职务序列 ID,枚举值及详细信息可通过【查询单个职务序列】接口查询获得 + *

示例值:1245678 + */ + private String jobFamilyId; + /** + * 试用期开始日期 + *

示例值:2018-03-16T00:00:00 + */ + private String probationStartDate; + /** + * 试用期结束日期(实际结束日期) + *

示例值:2019-05-24T00:00:00 + */ + private String probationEndDate; + /** + * 是否为主任职 + *

示例值:true + */ + private Boolean primaryJobData; + /** + * 雇佣 ID + *

示例值:6893014062142064135 + */ + private String employmentId; + /** + * 生效时间 + *

示例值:2020-05-01 00:00:00 + */ + private String effectiveTime; + /** + * 失效时间 + *

示例值:2020-05-02 00:00:00 + */ + private String expirationTime; + /** + * 任职原因,枚举值可通过文档【飞书人事枚举常量】任职原因(assignment_start_reason)枚举定义部分获得 + *

示例值:onboarding + */ + private Enum assignmentStartReason; + /** + * 预计试用期结束日期 + *

示例值:2006-01-02 + */ + private String probationExpectedEndDate; + /** + * 试用期结果,枚举值可通过文档【飞书人事枚举常量】试用期结果(probation_outcome)枚举定义部分获得 + *

示例值:passed + */ + private Enum probationOutcome; + /** + * 直属上级 + *

示例值: + */ + private BasicJobData directManager; + /** + * 虚线上级 + *

示例值: + */ + private BasicJobData[] dottedLineManagers; + /** + * 第二实线主管 + *

示例值:6890452208593372679 + */ + private BasicJobData secondDirectManager; + /** + * 成本中心分摊信息 + *

示例值: + */ + private JobDataCostCenter[] costCenterRates; + /** + * 自定义字段 + *

示例值: + */ + private CustomFieldData[] customFields; + + /** + * 任职信息 ID + *

示例值:6890452208593372679 + * + * @param jobDataId + * @return + */ + public Builder jobDataId(String jobDataId) { + this.jobDataId = jobDataId; + return this; + } + + + /** + * 任职记录版本 ID + *

示例值:6890452208593372697 + * + * @param versionId + * @return + */ + public Builder versionId(String versionId) { + this.versionId = versionId; + return this; + } + + + /** + * 人员类型 ID,枚举值及详细信息可通过【查询单个人员类型】接口查询获得 + *

示例值:6890452208593372679 + * + * @param employeeTypeId + * @return + */ + public Builder employeeTypeId(String employeeTypeId) { + this.employeeTypeId = employeeTypeId; + return this; + } + + + /** + * 工时制度 ID,枚举值及详细信息可通过【查询单个工时制度】接口查询获得 + *

示例值:6890452208593372679 + * + * @param workingHoursTypeId + * @return + */ + public Builder workingHoursTypeId(String workingHoursTypeId) { + this.workingHoursTypeId = workingHoursTypeId; + return this; + } + + + /** + * 工作地点 ID,枚举值及详细信息可通过【查询单个地点】接口查询获得 + *

示例值:6890452208593372679 + * + * @param workLocationId + * @return + */ + public Builder workLocationId(String workLocationId) { + this.workLocationId = workLocationId; + return this; + } + + + /** + * 部门 ID,枚举值及详细信息可通过【查询单个部门】接口查询获得 + *

示例值:6890452208593372679 + * + * @param departmentId + * @return + */ + public Builder departmentId(String departmentId) { + this.departmentId = departmentId; + return this; + } + + + /** + * 职务 ID,枚举值及详细信息可通过【查询单个职务】接口查询获得 + *

示例值:6890452208593372679 + * + * @param jobId + * @return + */ + public Builder jobId(String jobId) { + this.jobId = jobId; + return this; + } + + + /** + * 职务级别 ID,枚举值及详细信息可通过【查询单个职务级别】接口查询获得 + *

示例值:6890452208593372679 + * + * @param jobLevelId + * @return + */ + public Builder jobLevelId(String jobLevelId) { + this.jobLevelId = jobLevelId; + return this; + } + + + /** + * 职等 ID + *

示例值:6890452208593372679 + * + * @param jobGradeId + * @return + */ + public Builder jobGradeId(String jobGradeId) { + this.jobGradeId = jobGradeId; + return this; + } + + + /** + * 职务序列 ID,枚举值及详细信息可通过【查询单个职务序列】接口查询获得 + *

示例值:1245678 + * + * @param jobFamilyId + * @return + */ + public Builder jobFamilyId(String jobFamilyId) { + this.jobFamilyId = jobFamilyId; + return this; + } + + + /** + * 试用期开始日期 + *

示例值:2018-03-16T00:00:00 + * + * @param probationStartDate + * @return + */ + public Builder probationStartDate(String probationStartDate) { + this.probationStartDate = probationStartDate; + return this; + } + + + /** + * 试用期结束日期(实际结束日期) + *

示例值:2019-05-24T00:00:00 + * + * @param probationEndDate + * @return + */ + public Builder probationEndDate(String probationEndDate) { + this.probationEndDate = probationEndDate; + return this; + } + + + /** + * 是否为主任职 + *

示例值:true + * + * @param primaryJobData + * @return + */ + public Builder primaryJobData(Boolean primaryJobData) { + this.primaryJobData = primaryJobData; + return this; + } + + + /** + * 雇佣 ID + *

示例值:6893014062142064135 + * + * @param employmentId + * @return + */ + public Builder employmentId(String employmentId) { + this.employmentId = employmentId; + return this; + } + + + /** + * 生效时间 + *

示例值:2020-05-01 00:00:00 + * + * @param effectiveTime + * @return + */ + public Builder effectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + return this; + } + + + /** + * 失效时间 + *

示例值:2020-05-02 00:00:00 + * + * @param expirationTime + * @return + */ + public Builder expirationTime(String expirationTime) { + this.expirationTime = expirationTime; + return this; + } + + + /** + * 任职原因,枚举值可通过文档【飞书人事枚举常量】任职原因(assignment_start_reason)枚举定义部分获得 + *

示例值:onboarding + * + * @param assignmentStartReason + * @return + */ + public Builder assignmentStartReason(Enum assignmentStartReason) { + this.assignmentStartReason = assignmentStartReason; + return this; + } + + + /** + * 预计试用期结束日期 + *

示例值:2006-01-02 + * + * @param probationExpectedEndDate + * @return + */ + public Builder probationExpectedEndDate(String probationExpectedEndDate) { + this.probationExpectedEndDate = probationExpectedEndDate; + return this; + } + + + /** + * 试用期结果,枚举值可通过文档【飞书人事枚举常量】试用期结果(probation_outcome)枚举定义部分获得 + *

示例值:passed + * + * @param probationOutcome + * @return + */ + public Builder probationOutcome(Enum probationOutcome) { + this.probationOutcome = probationOutcome; + return this; + } + + + /** + * 直属上级 + *

示例值: + * + * @param directManager + * @return + */ + public Builder directManager(BasicJobData directManager) { + this.directManager = directManager; + return this; + } + + + /** + * 虚线上级 + *

示例值: + * + * @param dottedLineManagers + * @return + */ + public Builder dottedLineManagers(BasicJobData[] dottedLineManagers) { + this.dottedLineManagers = dottedLineManagers; + return this; + } + + + /** + * 第二实线主管 + *

示例值:6890452208593372679 + * + * @param secondDirectManager + * @return + */ + public Builder secondDirectManager(BasicJobData secondDirectManager) { + this.secondDirectManager = secondDirectManager; + return this; + } + + + /** + * 成本中心分摊信息 + *

示例值: + * + * @param costCenterRates + * @return + */ + public Builder costCenterRates(JobDataCostCenter[] costCenterRates) { + this.costCenterRates = costCenterRates; + return this; + } + + + /** + * 自定义字段 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(CustomFieldData[] customFields) { + this.customFields = customFields; + return this; + } + + + public JobData build() { + return new JobData(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/JobDataCostCenter.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/JobDataCostCenter.java new file mode 100644 index 000000000..a5eae9238 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/JobDataCostCenter.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class JobDataCostCenter { + /** + * 成本中心 ID,可以通过【查询单个成本中心信息】接口获取对应的成本中心信息 + *

示例值:6950635856373745165 + */ + @SerializedName("cost_center_id") + private String costCenterId; + /** + * 分摊比例 + *

示例值:100 + */ + @SerializedName("rate") + private Integer rate; + + // builder 开始 + public JobDataCostCenter() { + } + + public JobDataCostCenter(Builder builder) { + /** + * 成本中心 ID,可以通过【查询单个成本中心信息】接口获取对应的成本中心信息 + *

示例值:6950635856373745165 + */ + this.costCenterId = builder.costCenterId; + /** + * 分摊比例 + *

示例值:100 + */ + this.rate = builder.rate; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getCostCenterId() { + return this.costCenterId; + } + + public void setCostCenterId(String costCenterId) { + this.costCenterId = costCenterId; + } + + public Integer getRate() { + return this.rate; + } + + public void setRate(Integer rate) { + this.rate = rate; + } + + public static class Builder { + /** + * 成本中心 ID,可以通过【查询单个成本中心信息】接口获取对应的成本中心信息 + *

示例值:6950635856373745165 + */ + private String costCenterId; + /** + * 分摊比例 + *

示例值:100 + */ + private Integer rate; + + /** + * 成本中心 ID,可以通过【查询单个成本中心信息】接口获取对应的成本中心信息 + *

示例值:6950635856373745165 + * + * @param costCenterId + * @return + */ + public Builder costCenterId(String costCenterId) { + this.costCenterId = costCenterId; + return this; + } + + + /** + * 分摊比例 + *

示例值:100 + * + * @param rate + * @return + */ + public Builder rate(Integer rate) { + this.rate = rate; + return this; + } + + + public JobDataCostCenter build() { + return new JobDataCostCenter(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/JobFamily.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/JobFamily.java new file mode 100644 index 000000000..0fc04cc7a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/JobFamily.java @@ -0,0 +1,333 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class JobFamily { + /** + * 序列 ID + *

示例值:4698019107896524633 + */ + @SerializedName("job_family_id") + private String jobFamilyId; + /** + * 名称 + *

示例值: + */ + @SerializedName("name") + private I18n[] name; + /** + * 启用 + *

示例值:true + */ + @SerializedName("active") + private Boolean active; + /** + * 上级序列 + *

示例值:4698020757495316313 + */ + @SerializedName("parent_id") + private String parentId; + /** + * 生效时间 + *

示例值:2020-05-01 00:00:00 + */ + @SerializedName("effective_time") + private String effectiveTime; + /** + * 失效时间 + *

示例值:2020-05-02 00:00:00 + */ + @SerializedName("expiration_time") + private String expirationTime; + /** + * 编码 + *

示例值:123456 + */ + @SerializedName("code") + private String code; + /** + * 自定义字段 + *

示例值: + */ + @SerializedName("custom_fields") + private CustomFieldData[] customFields; + + // builder 开始 + public JobFamily() { + } + + public JobFamily(Builder builder) { + /** + * 序列 ID + *

示例值:4698019107896524633 + */ + this.jobFamilyId = builder.jobFamilyId; + /** + * 名称 + *

示例值: + */ + this.name = builder.name; + /** + * 启用 + *

示例值:true + */ + this.active = builder.active; + /** + * 上级序列 + *

示例值:4698020757495316313 + */ + this.parentId = builder.parentId; + /** + * 生效时间 + *

示例值:2020-05-01 00:00:00 + */ + this.effectiveTime = builder.effectiveTime; + /** + * 失效时间 + *

示例值:2020-05-02 00:00:00 + */ + this.expirationTime = builder.expirationTime; + /** + * 编码 + *

示例值:123456 + */ + this.code = builder.code; + /** + * 自定义字段 + *

示例值: + */ + this.customFields = builder.customFields; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getJobFamilyId() { + return this.jobFamilyId; + } + + public void setJobFamilyId(String jobFamilyId) { + this.jobFamilyId = jobFamilyId; + } + + public I18n[] getName() { + return this.name; + } + + public void setName(I18n[] name) { + this.name = name; + } + + public Boolean getActive() { + return this.active; + } + + public void setActive(Boolean active) { + this.active = active; + } + + public String getParentId() { + return this.parentId; + } + + public void setParentId(String parentId) { + this.parentId = parentId; + } + + public String getEffectiveTime() { + return this.effectiveTime; + } + + public void setEffectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + } + + public String getExpirationTime() { + return this.expirationTime; + } + + public void setExpirationTime(String expirationTime) { + this.expirationTime = expirationTime; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public CustomFieldData[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(CustomFieldData[] customFields) { + this.customFields = customFields; + } + + public static class Builder { + /** + * 序列 ID + *

示例值:4698019107896524633 + */ + private String jobFamilyId; + /** + * 名称 + *

示例值: + */ + private I18n[] name; + /** + * 启用 + *

示例值:true + */ + private Boolean active; + /** + * 上级序列 + *

示例值:4698020757495316313 + */ + private String parentId; + /** + * 生效时间 + *

示例值:2020-05-01 00:00:00 + */ + private String effectiveTime; + /** + * 失效时间 + *

示例值:2020-05-02 00:00:00 + */ + private String expirationTime; + /** + * 编码 + *

示例值:123456 + */ + private String code; + /** + * 自定义字段 + *

示例值: + */ + private CustomFieldData[] customFields; + + /** + * 序列 ID + *

示例值:4698019107896524633 + * + * @param jobFamilyId + * @return + */ + public Builder jobFamilyId(String jobFamilyId) { + this.jobFamilyId = jobFamilyId; + return this; + } + + + /** + * 名称 + *

示例值: + * + * @param name + * @return + */ + public Builder name(I18n[] name) { + this.name = name; + return this; + } + + + /** + * 启用 + *

示例值:true + * + * @param active + * @return + */ + public Builder active(Boolean active) { + this.active = active; + return this; + } + + + /** + * 上级序列 + *

示例值:4698020757495316313 + * + * @param parentId + * @return + */ + public Builder parentId(String parentId) { + this.parentId = parentId; + return this; + } + + + /** + * 生效时间 + *

示例值:2020-05-01 00:00:00 + * + * @param effectiveTime + * @return + */ + public Builder effectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + return this; + } + + + /** + * 失效时间 + *

示例值:2020-05-02 00:00:00 + * + * @param expirationTime + * @return + */ + public Builder expirationTime(String expirationTime) { + this.expirationTime = expirationTime; + return this; + } + + + /** + * 编码 + *

示例值:123456 + * + * @param code + * @return + */ + public Builder code(String code) { + this.code = code; + return this; + } + + + /** + * 自定义字段 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(CustomFieldData[] customFields) { + this.customFields = customFields; + return this; + } + + + public JobFamily build() { + return new JobFamily(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/JobLevel.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/JobLevel.java new file mode 100644 index 000000000..01700467d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/JobLevel.java @@ -0,0 +1,296 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class JobLevel { + /** + * 职级 ID + *

示例值:4692446793125560154 + */ + @SerializedName("job_level_id") + private String jobLevelId; + /** + * 职级数值 + *

示例值:9999 + */ + @SerializedName("level_order") + private Integer levelOrder; + /** + * 编码 + *

示例值:VQzo/BSonp8l6PmcZ+VlDhkd2595LMkhyBAGX6HAlCY= + */ + @SerializedName("code") + private String code; + /** + * 名称 + *

示例值: + */ + @SerializedName("name") + private I18n[] name; + /** + * 描述 + *

示例值: + */ + @SerializedName("description") + private I18n[] description; + /** + * 启用 + *

示例值:true + */ + @SerializedName("active") + private Boolean active; + /** + * 自定义字段 + *

示例值: + */ + @SerializedName("custom_fields") + private CustomFieldData[] customFields; + + // builder 开始 + public JobLevel() { + } + + public JobLevel(Builder builder) { + /** + * 职级 ID + *

示例值:4692446793125560154 + */ + this.jobLevelId = builder.jobLevelId; + /** + * 职级数值 + *

示例值:9999 + */ + this.levelOrder = builder.levelOrder; + /** + * 编码 + *

示例值:VQzo/BSonp8l6PmcZ+VlDhkd2595LMkhyBAGX6HAlCY= + */ + this.code = builder.code; + /** + * 名称 + *

示例值: + */ + this.name = builder.name; + /** + * 描述 + *

示例值: + */ + this.description = builder.description; + /** + * 启用 + *

示例值:true + */ + this.active = builder.active; + /** + * 自定义字段 + *

示例值: + */ + this.customFields = builder.customFields; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getJobLevelId() { + return this.jobLevelId; + } + + public void setJobLevelId(String jobLevelId) { + this.jobLevelId = jobLevelId; + } + + public Integer getLevelOrder() { + return this.levelOrder; + } + + public void setLevelOrder(Integer levelOrder) { + this.levelOrder = levelOrder; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public I18n[] getName() { + return this.name; + } + + public void setName(I18n[] name) { + this.name = name; + } + + public I18n[] getDescription() { + return this.description; + } + + public void setDescription(I18n[] description) { + this.description = description; + } + + public Boolean getActive() { + return this.active; + } + + public void setActive(Boolean active) { + this.active = active; + } + + public CustomFieldData[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(CustomFieldData[] customFields) { + this.customFields = customFields; + } + + public static class Builder { + /** + * 职级 ID + *

示例值:4692446793125560154 + */ + private String jobLevelId; + /** + * 职级数值 + *

示例值:9999 + */ + private Integer levelOrder; + /** + * 编码 + *

示例值:VQzo/BSonp8l6PmcZ+VlDhkd2595LMkhyBAGX6HAlCY= + */ + private String code; + /** + * 名称 + *

示例值: + */ + private I18n[] name; + /** + * 描述 + *

示例值: + */ + private I18n[] description; + /** + * 启用 + *

示例值:true + */ + private Boolean active; + /** + * 自定义字段 + *

示例值: + */ + private CustomFieldData[] customFields; + + /** + * 职级 ID + *

示例值:4692446793125560154 + * + * @param jobLevelId + * @return + */ + public Builder jobLevelId(String jobLevelId) { + this.jobLevelId = jobLevelId; + return this; + } + + + /** + * 职级数值 + *

示例值:9999 + * + * @param levelOrder + * @return + */ + public Builder levelOrder(Integer levelOrder) { + this.levelOrder = levelOrder; + return this; + } + + + /** + * 编码 + *

示例值:VQzo/BSonp8l6PmcZ+VlDhkd2595LMkhyBAGX6HAlCY= + * + * @param code + * @return + */ + public Builder code(String code) { + this.code = code; + return this; + } + + + /** + * 名称 + *

示例值: + * + * @param name + * @return + */ + public Builder name(I18n[] name) { + this.name = name; + return this; + } + + + /** + * 描述 + *

示例值: + * + * @param description + * @return + */ + public Builder description(I18n[] description) { + this.description = description; + return this; + } + + + /** + * 启用 + *

示例值:true + * + * @param active + * @return + */ + public Builder active(Boolean active) { + this.active = active; + return this; + } + + + /** + * 自定义字段 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(CustomFieldData[] customFields) { + this.customFields = customFields; + return this; + } + + + public JobLevel build() { + return new JobLevel(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListBpReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListBpReq.java new file mode 100644 index 000000000..104411bfe --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListBpReq.java @@ -0,0 +1,198 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Query; + +public class ListBpReq { + /** + * 分页大小,最大 500 + *

示例值:500 + */ + @Query + @SerializedName("page_size") + private Integer pageSize; + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:6891251722631890445 + */ + @Query + @SerializedName("page_token") + private String pageToken; + /** + * 用户 ID 类型 + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + */ + @Query + @SerializedName("department_id_type") + private String departmentIdType; + + // builder 开始 + public ListBpReq() { + } + + public ListBpReq(Builder builder) { + /** + * 分页大小,最大 500 + *

示例值:500 + */ + this.pageSize = builder.pageSize; + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:6891251722631890445 + */ + this.pageToken = builder.pageToken; + /** + * 用户 ID 类型 + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + */ + this.departmentIdType = builder.departmentIdType; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Integer getPageSize() { + return this.pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getDepartmentIdType() { + return this.departmentIdType; + } + + public void setDepartmentIdType(String departmentIdType) { + this.departmentIdType = departmentIdType; + } + + public static class Builder { + private Integer pageSize; // 分页大小,最大 500 + private String pageToken; // 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + private String userIdType; // 用户 ID 类型 + private String departmentIdType; // 此次调用中使用的部门 ID 类型 + + + /** + * 分页大小,最大 500 + *

示例值:500 + * + * @param pageSize + * @return + */ + public Builder pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:6891251722631890445 + * + * @param pageToken + * @return + */ + public Builder pageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + + /** + * 用户 ID 类型 + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 用户 ID 类型 + *

示例值:open_id + * + * @param userIdType {@link com.lark.oapi.service.corehr.v2.enums.ListBpUserIdTypeEnum} + * @return + */ + public Builder userIdType(com.lark.oapi.service.corehr.v2.enums.ListBpUserIdTypeEnum userIdType) { + this.userIdType = userIdType.getValue(); + return this; + } + + + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + * + * @param departmentIdType + * @return + */ + public Builder departmentIdType(String departmentIdType) { + this.departmentIdType = departmentIdType; + return this; + } + + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + * + * @param departmentIdType {@link com.lark.oapi.service.corehr.v2.enums.ListBpDepartmentIdTypeEnum} + * @return + */ + public Builder departmentIdType(com.lark.oapi.service.corehr.v2.enums.ListBpDepartmentIdTypeEnum departmentIdType) { + this.departmentIdType = departmentIdType.getValue(); + return this; + } + + public ListBpReq build() { + return new ListBpReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListBpResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListBpResp.java new file mode 100644 index 000000000..a5672c08f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListBpResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class ListBpResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListBpRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListBpRespBody.java new file mode 100644 index 000000000..97199df27 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListBpRespBody.java @@ -0,0 +1,62 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class ListBpRespBody { + /** + * HRBP 信息 + *

示例值: + */ + @SerializedName("items") + private Bp[] items; + /** + * 下一页页码 + *

示例值: + */ + @SerializedName("page_token") + private String pageToken; + /** + * 是否有下一页 + *

示例值: + */ + @SerializedName("has_more") + private Boolean hasMore; + + public Bp[] getItems() { + return this.items; + } + + public void setItems(Bp[] items) { + this.items = items; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public Boolean getHasMore() { + return this.hasMore; + } + + public void setHasMore(Boolean hasMore) { + this.hasMore = hasMore; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListJobReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListJobReq.java new file mode 100644 index 000000000..628fd8ef1 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListJobReq.java @@ -0,0 +1,174 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Query; + +public class ListJobReq { + /** + * 页码标识,获取第一页传空,每次查询会返回下一页的page_token + *

示例值:1231231987 + */ + @Query + @SerializedName("page_token") + private String pageToken; + /** + * 每页获取记录数量,最大100 + *

示例值:100 + */ + @Query + @SerializedName("page_size") + private String pageSize; + /** + * 名称 + *

示例值:keyword + */ + @Query + @SerializedName("name") + private String name; + /** + * 语言 + *

示例值:zh + */ + @Query + @SerializedName("query_language") + private String queryLanguage; + + // builder 开始 + public ListJobReq() { + } + + public ListJobReq(Builder builder) { + /** + * 页码标识,获取第一页传空,每次查询会返回下一页的page_token + *

示例值:1231231987 + */ + this.pageToken = builder.pageToken; + /** + * 每页获取记录数量,最大100 + *

示例值:100 + */ + this.pageSize = builder.pageSize; + /** + * 名称 + *

示例值:keyword + */ + this.name = builder.name; + /** + * 语言 + *

示例值:zh + */ + this.queryLanguage = builder.queryLanguage; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public String getPageSize() { + return this.pageSize; + } + + public void setPageSize(String pageSize) { + this.pageSize = pageSize; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getQueryLanguage() { + return this.queryLanguage; + } + + public void setQueryLanguage(String queryLanguage) { + this.queryLanguage = queryLanguage; + } + + public static class Builder { + private String pageToken; // 页码标识,获取第一页传空,每次查询会返回下一页的page_token + private String pageSize; // 每页获取记录数量,最大100 + private String name; // 名称 + private String queryLanguage; // 语言 + + + /** + * 页码标识,获取第一页传空,每次查询会返回下一页的page_token + *

示例值:1231231987 + * + * @param pageToken + * @return + */ + public Builder pageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + + /** + * 每页获取记录数量,最大100 + *

示例值:100 + * + * @param pageSize + * @return + */ + public Builder pageSize(String pageSize) { + this.pageSize = pageSize; + return this; + } + + + /** + * 名称 + *

示例值:keyword + * + * @param name + * @return + */ + public Builder name(String name) { + this.name = name; + return this; + } + + + /** + * 语言 + *

示例值:zh + * + * @param queryLanguage + * @return + */ + public Builder queryLanguage(String queryLanguage) { + this.queryLanguage = queryLanguage; + return this; + } + + public ListJobReq build() { + return new ListJobReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListJobResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListJobResp.java new file mode 100644 index 000000000..899a1f08c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListJobResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class ListJobResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListJobRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListJobRespBody.java new file mode 100644 index 000000000..24f0f7b15 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListJobRespBody.java @@ -0,0 +1,62 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class ListJobRespBody { + /** + * 查询的职务信息 + *

示例值: + */ + @SerializedName("items") + private Job[] items; + /** + * 是否有下一页 + *

示例值:true + */ + @SerializedName("has_more") + private Boolean hasMore; + /** + * 下一页页码 + *

示例值:1234452132 + */ + @SerializedName("page_token") + private String pageToken; + + public Job[] getItems() { + return this.items; + } + + public void setItems(Job[] items) { + this.items = items; + } + + public Boolean getHasMore() { + return this.hasMore; + } + + public void setHasMore(Boolean hasMore) { + this.hasMore = hasMore; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListProcessReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListProcessReq.java new file mode 100644 index 000000000..49cddb1c1 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListProcessReq.java @@ -0,0 +1,242 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Query; + +public class ListProcessReq { + /** + * 任务查询结束时间 (unix毫秒时间戳),闭区间,开始时间和结束时间跨度不能超过31天 + *

示例值:1547654251506 + */ + @Query + @SerializedName("modify_time_to") + private String modifyTimeTo; + /** + * 查询状态列表 + *

示例值: + */ + @Query + @SerializedName("statuses") + private Integer[] statuses; + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:7278949005675988535 + */ + @Query + @SerializedName("page_token") + private String pageToken; + /** + * 分页大小 + *

示例值:100 + */ + @Query + @SerializedName("page_size") + private Integer pageSize; + /** + * 查询开始时间(unix毫秒时间戳),闭区间,开始时间和结束时间跨度不能超过31天 + *

示例值:1547654251506 + */ + @Query + @SerializedName("modify_time_from") + private String modifyTimeFrom; + /** + * 流程定义ID + *

示例值:people_6961286846093788680_7081951411982077732 + */ + @Query + @SerializedName("flow_definition_id") + private String flowDefinitionId; + + // builder 开始 + public ListProcessReq() { + } + + public ListProcessReq(Builder builder) { + /** + * 任务查询结束时间 (unix毫秒时间戳),闭区间,开始时间和结束时间跨度不能超过31天 + *

示例值:1547654251506 + */ + this.modifyTimeTo = builder.modifyTimeTo; + /** + * 查询状态列表 + *

示例值: + */ + this.statuses = builder.statuses; + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:7278949005675988535 + */ + this.pageToken = builder.pageToken; + /** + * 分页大小 + *

示例值:100 + */ + this.pageSize = builder.pageSize; + /** + * 查询开始时间(unix毫秒时间戳),闭区间,开始时间和结束时间跨度不能超过31天 + *

示例值:1547654251506 + */ + this.modifyTimeFrom = builder.modifyTimeFrom; + /** + * 流程定义ID + *

示例值:people_6961286846093788680_7081951411982077732 + */ + this.flowDefinitionId = builder.flowDefinitionId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getModifyTimeTo() { + return this.modifyTimeTo; + } + + public void setModifyTimeTo(String modifyTimeTo) { + this.modifyTimeTo = modifyTimeTo; + } + + public Integer[] getStatuses() { + return this.statuses; + } + + public void setStatuses(Integer[] statuses) { + this.statuses = statuses; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public Integer getPageSize() { + return this.pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getModifyTimeFrom() { + return this.modifyTimeFrom; + } + + public void setModifyTimeFrom(String modifyTimeFrom) { + this.modifyTimeFrom = modifyTimeFrom; + } + + public String getFlowDefinitionId() { + return this.flowDefinitionId; + } + + public void setFlowDefinitionId(String flowDefinitionId) { + this.flowDefinitionId = flowDefinitionId; + } + + public static class Builder { + private String modifyTimeTo; // 任务查询结束时间 (unix毫秒时间戳),闭区间,开始时间和结束时间跨度不能超过31天 + private Integer[] statuses; // 查询状态列表 + private String pageToken; // 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + private Integer pageSize; // 分页大小 + private String modifyTimeFrom; // 查询开始时间(unix毫秒时间戳),闭区间,开始时间和结束时间跨度不能超过31天 + private String flowDefinitionId; // 流程定义ID + + + /** + * 任务查询结束时间 (unix毫秒时间戳),闭区间,开始时间和结束时间跨度不能超过31天 + *

示例值:1547654251506 + * + * @param modifyTimeTo + * @return + */ + public Builder modifyTimeTo(String modifyTimeTo) { + this.modifyTimeTo = modifyTimeTo; + return this; + } + + + /** + * 查询状态列表 + *

示例值: + * + * @param statuses + * @return + */ + public Builder statuses(Integer[] statuses) { + this.statuses = statuses; + return this; + } + + + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:7278949005675988535 + * + * @param pageToken + * @return + */ + public Builder pageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + + /** + * 分页大小 + *

示例值:100 + * + * @param pageSize + * @return + */ + public Builder pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + + /** + * 查询开始时间(unix毫秒时间戳),闭区间,开始时间和结束时间跨度不能超过31天 + *

示例值:1547654251506 + * + * @param modifyTimeFrom + * @return + */ + public Builder modifyTimeFrom(String modifyTimeFrom) { + this.modifyTimeFrom = modifyTimeFrom; + return this; + } + + + /** + * 流程定义ID + *

示例值:people_6961286846093788680_7081951411982077732 + * + * @param flowDefinitionId + * @return + */ + public Builder flowDefinitionId(String flowDefinitionId) { + this.flowDefinitionId = flowDefinitionId; + return this; + } + + public ListProcessReq build() { + return new ListProcessReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListProcessResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListProcessResp.java new file mode 100644 index 000000000..377fae705 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListProcessResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class ListProcessResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListProcessRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListProcessRespBody.java new file mode 100644 index 000000000..80f40393b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ListProcessRespBody.java @@ -0,0 +1,62 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class ListProcessRespBody { + /** + * 流程实例ID列表 + *

示例值: + */ + @SerializedName("process_ids") + private String[] processIds; + /** + * 是否还有更多项 + *

示例值:true + */ + @SerializedName("has_more") + private Boolean hasMore; + /** + * 有更多项时的分页键 + *

示例值:7278949005675988535 + */ + @SerializedName("page_token") + private String pageToken; + + public String[] getProcessIds() { + return this.processIds; + } + + public void setProcessIds(String[] processIds) { + this.processIds = processIds; + } + + public Boolean getHasMore() { + return this.hasMore; + } + + public void setHasMore(Boolean hasMore) { + this.hasMore = hasMore; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Location.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Location.java new file mode 100644 index 000000000..d377bd5f6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Location.java @@ -0,0 +1,444 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Location { + /** + * 地点 ID + *

示例值:4718803945687580505 + */ + @SerializedName("location_id") + private String locationId; + /** + * 地点基本信息 + *

示例值: + */ + @SerializedName("hiberarchy_common") + private HiberarchyCommon hiberarchyCommon; + /** + * 地点用途 + *

示例值: + */ + @SerializedName("location_usage_list") + private Enum[] locationUsageList; + /** + * 地址 + *

示例值: + */ + @SerializedName("address") + private Address[] address; + /** + * 工时制度 + *

示例值:4690238309151997779 + */ + @SerializedName("working_hours_type_id") + private String workingHoursTypeId; + /** + * 生效时间 + *

示例值:2020-05-01 00:00:00 + */ + @SerializedName("effective_time") + private String effectiveTime; + /** + * 失效时间 + *

示例值:2020-05-02 00:00:00 + */ + @SerializedName("expiration_time") + private String expirationTime; + /** + * 自定义字段 + *

示例值: + */ + @SerializedName("custom_fields") + private CustomFieldData[] customFields; + /** + * 区域设置 + *

示例值:zh_cn + */ + @SerializedName("locale") + private Enum locale; + /** + * 时区 + *

示例值:123456789 + */ + @SerializedName("time_zone_id") + private String timeZoneId; + /** + * 默认显示语言 + *

示例值:123456789 + */ + @SerializedName("display_language_id") + private String displayLanguageId; + + // builder 开始 + public Location() { + } + + public Location(Builder builder) { + /** + * 地点 ID + *

示例值:4718803945687580505 + */ + this.locationId = builder.locationId; + /** + * 地点基本信息 + *

示例值: + */ + this.hiberarchyCommon = builder.hiberarchyCommon; + /** + * 地点用途 + *

示例值: + */ + this.locationUsageList = builder.locationUsageList; + /** + * 地址 + *

示例值: + */ + this.address = builder.address; + /** + * 工时制度 + *

示例值:4690238309151997779 + */ + this.workingHoursTypeId = builder.workingHoursTypeId; + /** + * 生效时间 + *

示例值:2020-05-01 00:00:00 + */ + this.effectiveTime = builder.effectiveTime; + /** + * 失效时间 + *

示例值:2020-05-02 00:00:00 + */ + this.expirationTime = builder.expirationTime; + /** + * 自定义字段 + *

示例值: + */ + this.customFields = builder.customFields; + /** + * 区域设置 + *

示例值:zh_cn + */ + this.locale = builder.locale; + /** + * 时区 + *

示例值:123456789 + */ + this.timeZoneId = builder.timeZoneId; + /** + * 默认显示语言 + *

示例值:123456789 + */ + this.displayLanguageId = builder.displayLanguageId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getLocationId() { + return this.locationId; + } + + public void setLocationId(String locationId) { + this.locationId = locationId; + } + + public HiberarchyCommon getHiberarchyCommon() { + return this.hiberarchyCommon; + } + + public void setHiberarchyCommon(HiberarchyCommon hiberarchyCommon) { + this.hiberarchyCommon = hiberarchyCommon; + } + + public Enum[] getLocationUsageList() { + return this.locationUsageList; + } + + public void setLocationUsageList(Enum[] locationUsageList) { + this.locationUsageList = locationUsageList; + } + + public Address[] getAddress() { + return this.address; + } + + public void setAddress(Address[] address) { + this.address = address; + } + + public String getWorkingHoursTypeId() { + return this.workingHoursTypeId; + } + + public void setWorkingHoursTypeId(String workingHoursTypeId) { + this.workingHoursTypeId = workingHoursTypeId; + } + + public String getEffectiveTime() { + return this.effectiveTime; + } + + public void setEffectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + } + + public String getExpirationTime() { + return this.expirationTime; + } + + public void setExpirationTime(String expirationTime) { + this.expirationTime = expirationTime; + } + + public CustomFieldData[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(CustomFieldData[] customFields) { + this.customFields = customFields; + } + + public Enum getLocale() { + return this.locale; + } + + public void setLocale(Enum locale) { + this.locale = locale; + } + + public String getTimeZoneId() { + return this.timeZoneId; + } + + public void setTimeZoneId(String timeZoneId) { + this.timeZoneId = timeZoneId; + } + + public String getDisplayLanguageId() { + return this.displayLanguageId; + } + + public void setDisplayLanguageId(String displayLanguageId) { + this.displayLanguageId = displayLanguageId; + } + + public static class Builder { + /** + * 地点 ID + *

示例值:4718803945687580505 + */ + private String locationId; + /** + * 地点基本信息 + *

示例值: + */ + private HiberarchyCommon hiberarchyCommon; + /** + * 地点用途 + *

示例值: + */ + private Enum[] locationUsageList; + /** + * 地址 + *

示例值: + */ + private Address[] address; + /** + * 工时制度 + *

示例值:4690238309151997779 + */ + private String workingHoursTypeId; + /** + * 生效时间 + *

示例值:2020-05-01 00:00:00 + */ + private String effectiveTime; + /** + * 失效时间 + *

示例值:2020-05-02 00:00:00 + */ + private String expirationTime; + /** + * 自定义字段 + *

示例值: + */ + private CustomFieldData[] customFields; + /** + * 区域设置 + *

示例值:zh_cn + */ + private Enum locale; + /** + * 时区 + *

示例值:123456789 + */ + private String timeZoneId; + /** + * 默认显示语言 + *

示例值:123456789 + */ + private String displayLanguageId; + + /** + * 地点 ID + *

示例值:4718803945687580505 + * + * @param locationId + * @return + */ + public Builder locationId(String locationId) { + this.locationId = locationId; + return this; + } + + + /** + * 地点基本信息 + *

示例值: + * + * @param hiberarchyCommon + * @return + */ + public Builder hiberarchyCommon(HiberarchyCommon hiberarchyCommon) { + this.hiberarchyCommon = hiberarchyCommon; + return this; + } + + + /** + * 地点用途 + *

示例值: + * + * @param locationUsageList + * @return + */ + public Builder locationUsageList(Enum[] locationUsageList) { + this.locationUsageList = locationUsageList; + return this; + } + + + /** + * 地址 + *

示例值: + * + * @param address + * @return + */ + public Builder address(Address[] address) { + this.address = address; + return this; + } + + + /** + * 工时制度 + *

示例值:4690238309151997779 + * + * @param workingHoursTypeId + * @return + */ + public Builder workingHoursTypeId(String workingHoursTypeId) { + this.workingHoursTypeId = workingHoursTypeId; + return this; + } + + + /** + * 生效时间 + *

示例值:2020-05-01 00:00:00 + * + * @param effectiveTime + * @return + */ + public Builder effectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + return this; + } + + + /** + * 失效时间 + *

示例值:2020-05-02 00:00:00 + * + * @param expirationTime + * @return + */ + public Builder expirationTime(String expirationTime) { + this.expirationTime = expirationTime; + return this; + } + + + /** + * 自定义字段 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(CustomFieldData[] customFields) { + this.customFields = customFields; + return this; + } + + + /** + * 区域设置 + *

示例值:zh_cn + * + * @param locale + * @return + */ + public Builder locale(Enum locale) { + this.locale = locale; + return this; + } + + + /** + * 时区 + *

示例值:123456789 + * + * @param timeZoneId + * @return + */ + public Builder timeZoneId(String timeZoneId) { + this.timeZoneId = timeZoneId; + return this; + } + + + /** + * 默认显示语言 + *

示例值:123456789 + * + * @param displayLanguageId + * @return + */ + public Builder displayLanguageId(String displayLanguageId) { + this.displayLanguageId = displayLanguageId; + return this; + } + + + public Location build() { + return new Location(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/LocationV2.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/LocationV2.java new file mode 100644 index 000000000..89410d308 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/LocationV2.java @@ -0,0 +1,555 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class LocationV2 { + /** + * 地点 ID + *

示例值:4718803945687580505 + */ + @SerializedName("location_id") + private String locationId; + /** + * 上级地点ID + *

示例值:4719168654814483759 + */ + @SerializedName("parent_location_id") + private String parentLocationId; + /** + * 名称 + *

示例值: + */ + @SerializedName("names") + private I18n[] names; + /** + * 编码 + *

示例值:LO_CountryRegion_CHN + */ + @SerializedName("code") + private String code; + /** + * 启用状态 + *

示例值:true + */ + @SerializedName("active") + private Boolean active; + /** + * 地点用途 + *

示例值: + */ + @SerializedName("location_usages") + private Enum[] locationUsages; + /** + * 地址 + *

示例值: + */ + @SerializedName("addresses") + private Address[] addresses; + /** + * 工时制度 + *

示例值:4690238309151997779 + */ + @SerializedName("working_hours_type_id") + private String workingHoursTypeId; + /** + * 生效时间 + *

示例值:2020-05-01 00:00:00 + */ + @SerializedName("effective_time") + private String effectiveTime; + /** + * 失效时间 + *

示例值:2020-05-02 00:00:00 + */ + @SerializedName("expiration_time") + private String expirationTime; + /** + * 自定义字段 + *

示例值: + */ + @SerializedName("custom_fields") + private CustomFieldData[] customFields; + /** + * 区域设置 + *

示例值:zh_cn + */ + @SerializedName("locale") + private Enum locale; + /** + * 时区 + *

示例值:123456789 + */ + @SerializedName("time_zone_id") + private String timeZoneId; + /** + * 默认显示语言 + *

示例值:123456789 + */ + @SerializedName("display_language_id") + private String displayLanguageId; + + // builder 开始 + public LocationV2() { + } + + public LocationV2(Builder builder) { + /** + * 地点 ID + *

示例值:4718803945687580505 + */ + this.locationId = builder.locationId; + /** + * 上级地点ID + *

示例值:4719168654814483759 + */ + this.parentLocationId = builder.parentLocationId; + /** + * 名称 + *

示例值: + */ + this.names = builder.names; + /** + * 编码 + *

示例值:LO_CountryRegion_CHN + */ + this.code = builder.code; + /** + * 启用状态 + *

示例值:true + */ + this.active = builder.active; + /** + * 地点用途 + *

示例值: + */ + this.locationUsages = builder.locationUsages; + /** + * 地址 + *

示例值: + */ + this.addresses = builder.addresses; + /** + * 工时制度 + *

示例值:4690238309151997779 + */ + this.workingHoursTypeId = builder.workingHoursTypeId; + /** + * 生效时间 + *

示例值:2020-05-01 00:00:00 + */ + this.effectiveTime = builder.effectiveTime; + /** + * 失效时间 + *

示例值:2020-05-02 00:00:00 + */ + this.expirationTime = builder.expirationTime; + /** + * 自定义字段 + *

示例值: + */ + this.customFields = builder.customFields; + /** + * 区域设置 + *

示例值:zh_cn + */ + this.locale = builder.locale; + /** + * 时区 + *

示例值:123456789 + */ + this.timeZoneId = builder.timeZoneId; + /** + * 默认显示语言 + *

示例值:123456789 + */ + this.displayLanguageId = builder.displayLanguageId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getLocationId() { + return this.locationId; + } + + public void setLocationId(String locationId) { + this.locationId = locationId; + } + + public String getParentLocationId() { + return this.parentLocationId; + } + + public void setParentLocationId(String parentLocationId) { + this.parentLocationId = parentLocationId; + } + + public I18n[] getNames() { + return this.names; + } + + public void setNames(I18n[] names) { + this.names = names; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public Boolean getActive() { + return this.active; + } + + public void setActive(Boolean active) { + this.active = active; + } + + public Enum[] getLocationUsages() { + return this.locationUsages; + } + + public void setLocationUsages(Enum[] locationUsages) { + this.locationUsages = locationUsages; + } + + public Address[] getAddresses() { + return this.addresses; + } + + public void setAddresses(Address[] addresses) { + this.addresses = addresses; + } + + public String getWorkingHoursTypeId() { + return this.workingHoursTypeId; + } + + public void setWorkingHoursTypeId(String workingHoursTypeId) { + this.workingHoursTypeId = workingHoursTypeId; + } + + public String getEffectiveTime() { + return this.effectiveTime; + } + + public void setEffectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + } + + public String getExpirationTime() { + return this.expirationTime; + } + + public void setExpirationTime(String expirationTime) { + this.expirationTime = expirationTime; + } + + public CustomFieldData[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(CustomFieldData[] customFields) { + this.customFields = customFields; + } + + public Enum getLocale() { + return this.locale; + } + + public void setLocale(Enum locale) { + this.locale = locale; + } + + public String getTimeZoneId() { + return this.timeZoneId; + } + + public void setTimeZoneId(String timeZoneId) { + this.timeZoneId = timeZoneId; + } + + public String getDisplayLanguageId() { + return this.displayLanguageId; + } + + public void setDisplayLanguageId(String displayLanguageId) { + this.displayLanguageId = displayLanguageId; + } + + public static class Builder { + /** + * 地点 ID + *

示例值:4718803945687580505 + */ + private String locationId; + /** + * 上级地点ID + *

示例值:4719168654814483759 + */ + private String parentLocationId; + /** + * 名称 + *

示例值: + */ + private I18n[] names; + /** + * 编码 + *

示例值:LO_CountryRegion_CHN + */ + private String code; + /** + * 启用状态 + *

示例值:true + */ + private Boolean active; + /** + * 地点用途 + *

示例值: + */ + private Enum[] locationUsages; + /** + * 地址 + *

示例值: + */ + private Address[] addresses; + /** + * 工时制度 + *

示例值:4690238309151997779 + */ + private String workingHoursTypeId; + /** + * 生效时间 + *

示例值:2020-05-01 00:00:00 + */ + private String effectiveTime; + /** + * 失效时间 + *

示例值:2020-05-02 00:00:00 + */ + private String expirationTime; + /** + * 自定义字段 + *

示例值: + */ + private CustomFieldData[] customFields; + /** + * 区域设置 + *

示例值:zh_cn + */ + private Enum locale; + /** + * 时区 + *

示例值:123456789 + */ + private String timeZoneId; + /** + * 默认显示语言 + *

示例值:123456789 + */ + private String displayLanguageId; + + /** + * 地点 ID + *

示例值:4718803945687580505 + * + * @param locationId + * @return + */ + public Builder locationId(String locationId) { + this.locationId = locationId; + return this; + } + + + /** + * 上级地点ID + *

示例值:4719168654814483759 + * + * @param parentLocationId + * @return + */ + public Builder parentLocationId(String parentLocationId) { + this.parentLocationId = parentLocationId; + return this; + } + + + /** + * 名称 + *

示例值: + * + * @param names + * @return + */ + public Builder names(I18n[] names) { + this.names = names; + return this; + } + + + /** + * 编码 + *

示例值:LO_CountryRegion_CHN + * + * @param code + * @return + */ + public Builder code(String code) { + this.code = code; + return this; + } + + + /** + * 启用状态 + *

示例值:true + * + * @param active + * @return + */ + public Builder active(Boolean active) { + this.active = active; + return this; + } + + + /** + * 地点用途 + *

示例值: + * + * @param locationUsages + * @return + */ + public Builder locationUsages(Enum[] locationUsages) { + this.locationUsages = locationUsages; + return this; + } + + + /** + * 地址 + *

示例值: + * + * @param addresses + * @return + */ + public Builder addresses(Address[] addresses) { + this.addresses = addresses; + return this; + } + + + /** + * 工时制度 + *

示例值:4690238309151997779 + * + * @param workingHoursTypeId + * @return + */ + public Builder workingHoursTypeId(String workingHoursTypeId) { + this.workingHoursTypeId = workingHoursTypeId; + return this; + } + + + /** + * 生效时间 + *

示例值:2020-05-01 00:00:00 + * + * @param effectiveTime + * @return + */ + public Builder effectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + return this; + } + + + /** + * 失效时间 + *

示例值:2020-05-02 00:00:00 + * + * @param expirationTime + * @return + */ + public Builder expirationTime(String expirationTime) { + this.expirationTime = expirationTime; + return this; + } + + + /** + * 自定义字段 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(CustomFieldData[] customFields) { + this.customFields = customFields; + return this; + } + + + /** + * 区域设置 + *

示例值:zh_cn + * + * @param locale + * @return + */ + public Builder locale(Enum locale) { + this.locale = locale; + return this; + } + + + /** + * 时区 + *

示例值:123456789 + * + * @param timeZoneId + * @return + */ + public Builder timeZoneId(String timeZoneId) { + this.timeZoneId = timeZoneId; + return this; + } + + + /** + * 默认显示语言 + *

示例值:123456789 + * + * @param displayLanguageId + * @return + */ + public Builder displayLanguageId(String displayLanguageId) { + this.displayLanguageId = displayLanguageId; + return this; + } + + + public LocationV2 build() { + return new LocationV2(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Name.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Name.java new file mode 100644 index 000000000..92ef5a3b8 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Name.java @@ -0,0 +1,296 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Name { + /** + * 全名 + *

示例值:李一一 + */ + @SerializedName("full_name") + private String fullName; + /** + * 名 + *

示例值:一 + */ + @SerializedName("first_name") + private String firstName; + /** + * 中间名 + *

示例值:一 + */ + @SerializedName("middle_name") + private String middleName; + /** + * 姓 + *

示例值:李 + */ + @SerializedName("name_primary") + private String namePrimary; + /** + * 名 - 本地文字 + *

示例值:一 + */ + @SerializedName("local_first_name") + private String localFirstName; + /** + * 本地中间名 + *

示例值:一 + */ + @SerializedName("local_middle_name") + private String localMiddleName; + /** + * 姓 - 本地文字 + *

示例值:李 + */ + @SerializedName("local_primary") + private String localPrimary; + + // builder 开始 + public Name() { + } + + public Name(Builder builder) { + /** + * 全名 + *

示例值:李一一 + */ + this.fullName = builder.fullName; + /** + * 名 + *

示例值:一 + */ + this.firstName = builder.firstName; + /** + * 中间名 + *

示例值:一 + */ + this.middleName = builder.middleName; + /** + * 姓 + *

示例值:李 + */ + this.namePrimary = builder.namePrimary; + /** + * 名 - 本地文字 + *

示例值:一 + */ + this.localFirstName = builder.localFirstName; + /** + * 本地中间名 + *

示例值:一 + */ + this.localMiddleName = builder.localMiddleName; + /** + * 姓 - 本地文字 + *

示例值:李 + */ + this.localPrimary = builder.localPrimary; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getFullName() { + return this.fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + public String getFirstName() { + return this.firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getMiddleName() { + return this.middleName; + } + + public void setMiddleName(String middleName) { + this.middleName = middleName; + } + + public String getNamePrimary() { + return this.namePrimary; + } + + public void setNamePrimary(String namePrimary) { + this.namePrimary = namePrimary; + } + + public String getLocalFirstName() { + return this.localFirstName; + } + + public void setLocalFirstName(String localFirstName) { + this.localFirstName = localFirstName; + } + + public String getLocalMiddleName() { + return this.localMiddleName; + } + + public void setLocalMiddleName(String localMiddleName) { + this.localMiddleName = localMiddleName; + } + + public String getLocalPrimary() { + return this.localPrimary; + } + + public void setLocalPrimary(String localPrimary) { + this.localPrimary = localPrimary; + } + + public static class Builder { + /** + * 全名 + *

示例值:李一一 + */ + private String fullName; + /** + * 名 + *

示例值:一 + */ + private String firstName; + /** + * 中间名 + *

示例值:一 + */ + private String middleName; + /** + * 姓 + *

示例值:李 + */ + private String namePrimary; + /** + * 名 - 本地文字 + *

示例值:一 + */ + private String localFirstName; + /** + * 本地中间名 + *

示例值:一 + */ + private String localMiddleName; + /** + * 姓 - 本地文字 + *

示例值:李 + */ + private String localPrimary; + + /** + * 全名 + *

示例值:李一一 + * + * @param fullName + * @return + */ + public Builder fullName(String fullName) { + this.fullName = fullName; + return this; + } + + + /** + * 名 + *

示例值:一 + * + * @param firstName + * @return + */ + public Builder firstName(String firstName) { + this.firstName = firstName; + return this; + } + + + /** + * 中间名 + *

示例值:一 + * + * @param middleName + * @return + */ + public Builder middleName(String middleName) { + this.middleName = middleName; + return this; + } + + + /** + * 姓 + *

示例值:李 + * + * @param namePrimary + * @return + */ + public Builder namePrimary(String namePrimary) { + this.namePrimary = namePrimary; + return this; + } + + + /** + * 名 - 本地文字 + *

示例值:一 + * + * @param localFirstName + * @return + */ + public Builder localFirstName(String localFirstName) { + this.localFirstName = localFirstName; + return this; + } + + + /** + * 本地中间名 + *

示例值:一 + * + * @param localMiddleName + * @return + */ + public Builder localMiddleName(String localMiddleName) { + this.localMiddleName = localMiddleName; + return this; + } + + + /** + * 姓 - 本地文字 + *

示例值:李 + * + * @param localPrimary + * @return + */ + public Builder localPrimary(String localPrimary) { + this.localPrimary = localPrimary; + return this; + } + + + public Name build() { + return new Name(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/NationalId.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/NationalId.java new file mode 100644 index 000000000..7a176d175 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/NationalId.java @@ -0,0 +1,296 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class NationalId { + /** + * 国家证件类型 + *

示例值:6863330041896371725 + */ + @SerializedName("national_id_type_id") + private String nationalIdTypeId; + /** + * 证件号码 + *

示例值:1231131333 + */ + @SerializedName("national_id_number") + private String nationalIdNumber; + /** + * 证件签发日期 + *

示例值:2020-04-01 + */ + @SerializedName("issue_date") + private String issueDate; + /** + * 证件到期日期 + *

示例值:2020-05-21 + */ + @SerializedName("expiration_date") + private String expirationDate; + /** + * 国家 / 地区 + *

示例值:6862995757234914824 + */ + @SerializedName("country_region_id") + private String countryRegionId; + /** + * 证件签发机构 + *

示例值:北京市公安局 + */ + @SerializedName("issued_by") + private String issuedBy; + /** + * 自定义字段 + *

示例值: + */ + @SerializedName("custom_fields") + private CustomFieldData[] customFields; + + // builder 开始 + public NationalId() { + } + + public NationalId(Builder builder) { + /** + * 国家证件类型 + *

示例值:6863330041896371725 + */ + this.nationalIdTypeId = builder.nationalIdTypeId; + /** + * 证件号码 + *

示例值:1231131333 + */ + this.nationalIdNumber = builder.nationalIdNumber; + /** + * 证件签发日期 + *

示例值:2020-04-01 + */ + this.issueDate = builder.issueDate; + /** + * 证件到期日期 + *

示例值:2020-05-21 + */ + this.expirationDate = builder.expirationDate; + /** + * 国家 / 地区 + *

示例值:6862995757234914824 + */ + this.countryRegionId = builder.countryRegionId; + /** + * 证件签发机构 + *

示例值:北京市公安局 + */ + this.issuedBy = builder.issuedBy; + /** + * 自定义字段 + *

示例值: + */ + this.customFields = builder.customFields; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getNationalIdTypeId() { + return this.nationalIdTypeId; + } + + public void setNationalIdTypeId(String nationalIdTypeId) { + this.nationalIdTypeId = nationalIdTypeId; + } + + public String getNationalIdNumber() { + return this.nationalIdNumber; + } + + public void setNationalIdNumber(String nationalIdNumber) { + this.nationalIdNumber = nationalIdNumber; + } + + public String getIssueDate() { + return this.issueDate; + } + + public void setIssueDate(String issueDate) { + this.issueDate = issueDate; + } + + public String getExpirationDate() { + return this.expirationDate; + } + + public void setExpirationDate(String expirationDate) { + this.expirationDate = expirationDate; + } + + public String getCountryRegionId() { + return this.countryRegionId; + } + + public void setCountryRegionId(String countryRegionId) { + this.countryRegionId = countryRegionId; + } + + public String getIssuedBy() { + return this.issuedBy; + } + + public void setIssuedBy(String issuedBy) { + this.issuedBy = issuedBy; + } + + public CustomFieldData[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(CustomFieldData[] customFields) { + this.customFields = customFields; + } + + public static class Builder { + /** + * 国家证件类型 + *

示例值:6863330041896371725 + */ + private String nationalIdTypeId; + /** + * 证件号码 + *

示例值:1231131333 + */ + private String nationalIdNumber; + /** + * 证件签发日期 + *

示例值:2020-04-01 + */ + private String issueDate; + /** + * 证件到期日期 + *

示例值:2020-05-21 + */ + private String expirationDate; + /** + * 国家 / 地区 + *

示例值:6862995757234914824 + */ + private String countryRegionId; + /** + * 证件签发机构 + *

示例值:北京市公安局 + */ + private String issuedBy; + /** + * 自定义字段 + *

示例值: + */ + private CustomFieldData[] customFields; + + /** + * 国家证件类型 + *

示例值:6863330041896371725 + * + * @param nationalIdTypeId + * @return + */ + public Builder nationalIdTypeId(String nationalIdTypeId) { + this.nationalIdTypeId = nationalIdTypeId; + return this; + } + + + /** + * 证件号码 + *

示例值:1231131333 + * + * @param nationalIdNumber + * @return + */ + public Builder nationalIdNumber(String nationalIdNumber) { + this.nationalIdNumber = nationalIdNumber; + return this; + } + + + /** + * 证件签发日期 + *

示例值:2020-04-01 + * + * @param issueDate + * @return + */ + public Builder issueDate(String issueDate) { + this.issueDate = issueDate; + return this; + } + + + /** + * 证件到期日期 + *

示例值:2020-05-21 + * + * @param expirationDate + * @return + */ + public Builder expirationDate(String expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + + /** + * 国家 / 地区 + *

示例值:6862995757234914824 + * + * @param countryRegionId + * @return + */ + public Builder countryRegionId(String countryRegionId) { + this.countryRegionId = countryRegionId; + return this; + } + + + /** + * 证件签发机构 + *

示例值:北京市公安局 + * + * @param issuedBy + * @return + */ + public Builder issuedBy(String issuedBy) { + this.issuedBy = issuedBy; + return this; + } + + + /** + * 自定义字段 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(CustomFieldData[] customFields) { + this.customFields = customFields; + return this; + } + + + public NationalId build() { + return new NationalId(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Nationality.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Nationality.java new file mode 100644 index 000000000..c4f24d7ff --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Nationality.java @@ -0,0 +1,308 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Nationality { + /** + * 国籍 ID(对应其他查询结果的 nationality_id_v2 字段) + *

示例值:6893014062142064135 + */ + @SerializedName("nationality_id") + private String nationalityId; + /** + * 名称 + *

示例值: + */ + @SerializedName("name") + private I18n[] name; + /** + * 二字码 + *

示例值:CN + */ + @SerializedName("alpha_2_code") + private String alpha2Code; + /** + * 三字码 + *

示例值:CHN + */ + @SerializedName("alpha_3_code") + private String alpha3Code; + /** + * 数字代码 + *

示例值:156 + */ + @SerializedName("numeric_code") + private Integer numericCode; + /** + * 国家 / 地区 ID ,可通过【查询单条国家/地区信息】 接口查询 + *

示例值:6893014061142064135 + */ + @SerializedName("country_region_id") + private String countryRegionId; + /** + * 状态 + *

示例值:1 + */ + @SerializedName("status") + private Integer status; + + // builder 开始 + public Nationality() { + } + + public Nationality(Builder builder) { + /** + * 国籍 ID(对应其他查询结果的 nationality_id_v2 字段) + *

示例值:6893014062142064135 + */ + this.nationalityId = builder.nationalityId; + /** + * 名称 + *

示例值: + */ + this.name = builder.name; + /** + * 二字码 + *

示例值:CN + */ + this.alpha2Code = builder.alpha2Code; + /** + * 三字码 + *

示例值:CHN + */ + this.alpha3Code = builder.alpha3Code; + /** + * 数字代码 + *

示例值:156 + */ + this.numericCode = builder.numericCode; + /** + * 国家 / 地区 ID ,可通过【查询单条国家/地区信息】 接口查询 + *

示例值:6893014061142064135 + */ + this.countryRegionId = builder.countryRegionId; + /** + * 状态 + *

示例值:1 + */ + this.status = builder.status; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getNationalityId() { + return this.nationalityId; + } + + public void setNationalityId(String nationalityId) { + this.nationalityId = nationalityId; + } + + public I18n[] getName() { + return this.name; + } + + public void setName(I18n[] name) { + this.name = name; + } + + public String getAlpha2Code() { + return this.alpha2Code; + } + + public void setAlpha2Code(String alpha2Code) { + this.alpha2Code = alpha2Code; + } + + public String getAlpha3Code() { + return this.alpha3Code; + } + + public void setAlpha3Code(String alpha3Code) { + this.alpha3Code = alpha3Code; + } + + public Integer getNumericCode() { + return this.numericCode; + } + + public void setNumericCode(Integer numericCode) { + this.numericCode = numericCode; + } + + public String getCountryRegionId() { + return this.countryRegionId; + } + + public void setCountryRegionId(String countryRegionId) { + this.countryRegionId = countryRegionId; + } + + public Integer getStatus() { + return this.status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public static class Builder { + /** + * 国籍 ID(对应其他查询结果的 nationality_id_v2 字段) + *

示例值:6893014062142064135 + */ + private String nationalityId; + /** + * 名称 + *

示例值: + */ + private I18n[] name; + /** + * 二字码 + *

示例值:CN + */ + private String alpha2Code; + /** + * 三字码 + *

示例值:CHN + */ + private String alpha3Code; + /** + * 数字代码 + *

示例值:156 + */ + private Integer numericCode; + /** + * 国家 / 地区 ID ,可通过【查询单条国家/地区信息】 接口查询 + *

示例值:6893014061142064135 + */ + private String countryRegionId; + /** + * 状态 + *

示例值:1 + */ + private Integer status; + + /** + * 国籍 ID(对应其他查询结果的 nationality_id_v2 字段) + *

示例值:6893014062142064135 + * + * @param nationalityId + * @return + */ + public Builder nationalityId(String nationalityId) { + this.nationalityId = nationalityId; + return this; + } + + + /** + * 名称 + *

示例值: + * + * @param name + * @return + */ + public Builder name(I18n[] name) { + this.name = name; + return this; + } + + + /** + * 二字码 + *

示例值:CN + * + * @param alpha2Code + * @return + */ + public Builder alpha2Code(String alpha2Code) { + this.alpha2Code = alpha2Code; + return this; + } + + + /** + * 三字码 + *

示例值:CHN + * + * @param alpha3Code + * @return + */ + public Builder alpha3Code(String alpha3Code) { + this.alpha3Code = alpha3Code; + return this; + } + + + /** + * 数字代码 + *

示例值:156 + * + * @param numericCode + * @return + */ + public Builder numericCode(Integer numericCode) { + this.numericCode = numericCode; + return this; + } + + + /** + * 国家 / 地区 ID ,可通过【查询单条国家/地区信息】 接口查询 + *

示例值:6893014061142064135 + * + * @param countryRegionId + * @return + */ + public Builder countryRegionId(String countryRegionId) { + this.countryRegionId = countryRegionId; + return this; + } + + + /** + * 状态 + *

示例值:1 + * + * @param status + * @return + */ + public Builder status(Integer status) { + this.status = status; + return this; + } + + /** + * 状态 + *

示例值:1 + * + * @param status {@link com.lark.oapi.service.corehr.v2.enums.NationalityBasicDataObjStatusEnum} + * @return + */ + public Builder status(com.lark.oapi.service.corehr.v2.enums.NationalityBasicDataObjStatusEnum status) { + this.status = status.getValue(); + return this; + } + + + public Nationality build() { + return new Nationality(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ObjectFieldData.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ObjectFieldData.java new file mode 100644 index 000000000..e28b40d3e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ObjectFieldData.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class ObjectFieldData { + /** + * 字段名 + *

示例值:name + */ + @SerializedName("field_name") + private String fieldName; + /** + * 字段值,是json转义后的字符串,根据元数据定义不同,字段格式不同(123, 123.23, true, [\"id1\",\"id2\], 2006-01-02 15:04:05]) + *

示例值:Sandy + */ + @SerializedName("value") + private String value; + + // builder 开始 + public ObjectFieldData() { + } + + public ObjectFieldData(Builder builder) { + /** + * 字段名 + *

示例值:name + */ + this.fieldName = builder.fieldName; + /** + * 字段值,是json转义后的字符串,根据元数据定义不同,字段格式不同(123, 123.23, true, [\"id1\",\"id2\], 2006-01-02 15:04:05]) + *

示例值:Sandy + */ + this.value = builder.value; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getFieldName() { + return this.fieldName; + } + + public void setFieldName(String fieldName) { + this.fieldName = fieldName; + } + + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + public static class Builder { + /** + * 字段名 + *

示例值:name + */ + private String fieldName; + /** + * 字段值,是json转义后的字符串,根据元数据定义不同,字段格式不同(123, 123.23, true, [\"id1\",\"id2\], 2006-01-02 15:04:05]) + *

示例值:Sandy + */ + private String value; + + /** + * 字段名 + *

示例值:name + * + * @param fieldName + * @return + */ + public Builder fieldName(String fieldName) { + this.fieldName = fieldName; + return this; + } + + + /** + * 字段值,是json转义后的字符串,根据元数据定义不同,字段格式不同(123, 123.23, true, [\"id1\",\"id2\], 2006-01-02 15:04:05]) + *

示例值:Sandy + * + * @param value + * @return + */ + public Builder value(String value) { + this.value = value; + return this; + } + + + public ObjectFieldData build() { + return new ObjectFieldData(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/OfferInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/OfferInfo.java new file mode 100644 index 000000000..1b19b7f1c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/OfferInfo.java @@ -0,0 +1,1110 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class OfferInfo { + /** + * Offer id + *

示例值:7032210902531327521 + */ + @SerializedName("offer_id") + private String offerId; + /** + * Offer hr id + *

示例值:7032210902531327521 + */ + @SerializedName("offer_hr_id") + private String offerHrId; + /** + * 部门 id + *

示例值:7147562782945478177 + */ + @SerializedName("department_id") + private String departmentId; + /** + * 直属领导id + *

示例值:7032210902531327521 + */ + @SerializedName("direct_leader_id") + private String directLeaderId; + /** + * 职务id + *

示例值:6977976735715378724 + */ + @SerializedName("job_id") + private String jobId; + /** + * 序列id + *

示例值:6977972856625939999 + */ + @SerializedName("job_family_id") + private String jobFamilyId; + /** + * 级别id + *

示例值:6977971894960145950 + */ + @SerializedName("job_level_id") + private String jobLevelId; + /** + * 职务头衔id + *

示例值:java + */ + @SerializedName("job_title") + private String jobTitle; + /** + * 试用期开始日期 + *

示例值:2022-07-29 + */ + @SerializedName("probation_start_date") + private String probationStartDate; + /** + * 试用期结束日期 + *

示例值:2023-04-07 + */ + @SerializedName("probation_end_date") + private String probationEndDate; + /** + * 合同开始日期 + *

示例值:2022-10-08 + */ + @SerializedName("contract_start_date") + private String contractStartDate; + /** + * 合同结束日期 + *

示例值:2025-10-07 + */ + @SerializedName("contract_end_date") + private String contractEndDate; + /** + * 入职日期 + *

示例值:2022-10-08 + */ + @SerializedName("onboarding_date") + private String onboardingDate; + /** + * 入职地点id + *

示例值:6977976687350924832 + */ + @SerializedName("onboarding_location_id") + private String onboardingLocationId; + /** + * 办公地点id + *

示例值:6977976687350924832 + */ + @SerializedName("office_location_id") + private String officeLocationId; + /** + * 招聘来源id + *

示例值:experienced_professionals + */ + @SerializedName("recruitment_type_id") + private String recruitmentTypeId; + /** + * 试用期时长 + *

示例值:6 + */ + @SerializedName("probation_period") + private String probationPeriod; + /** + * 人员类型id + *

示例值:6977973225846343171 + */ + @SerializedName("employee_type_id") + private String employeeTypeId; + /** + * 雇佣类型id + *

示例值:6977973225846343171 + */ + @SerializedName("employment_type_id") + private String employmentTypeId; + /** + * 工作邮箱 + *

示例值:joshua@bytedance.com + */ + @SerializedName("work_email") + private String workEmail; + /** + * 期限类型id + *

示例值:6977973225846343171 + */ + @SerializedName("duration_type_id") + private String durationTypeId; + /** + * 签订类型id + *

示例值:6738317738688661772 + */ + @SerializedName("signing_type_id") + private String signingTypeId; + /** + * 入职方式 + *

示例值:1 + */ + @SerializedName("entry_mode") + private String entryMode; + /** + * 社保城市id + *

示例值:xxx + */ + @SerializedName("social_security_city_id") + private String socialSecurityCityId; + /** + * 合同类型 + *

示例值:6738317738688661772 + */ + @SerializedName("contract_type") + private String contractType; + /** + * 公司 + *

示例值:6738317738688661772 + */ + @SerializedName("company") + private String company; + /** + * 成本中心分摊信息 + *

示例值: + */ + @SerializedName("cost_center_rate") + private JobDataCostCenter[] costCenterRate; + /** + * 职等ID + *

示例值:6738317738688661772 + */ + @SerializedName("job_grade_id") + private String jobGradeId; + /** + * 自定义字段 + *

示例值: + */ + @SerializedName("custom_fields") + private ObjectFieldData[] customFields; + + // builder 开始 + public OfferInfo() { + } + + public OfferInfo(Builder builder) { + /** + * Offer id + *

示例值:7032210902531327521 + */ + this.offerId = builder.offerId; + /** + * Offer hr id + *

示例值:7032210902531327521 + */ + this.offerHrId = builder.offerHrId; + /** + * 部门 id + *

示例值:7147562782945478177 + */ + this.departmentId = builder.departmentId; + /** + * 直属领导id + *

示例值:7032210902531327521 + */ + this.directLeaderId = builder.directLeaderId; + /** + * 职务id + *

示例值:6977976735715378724 + */ + this.jobId = builder.jobId; + /** + * 序列id + *

示例值:6977972856625939999 + */ + this.jobFamilyId = builder.jobFamilyId; + /** + * 级别id + *

示例值:6977971894960145950 + */ + this.jobLevelId = builder.jobLevelId; + /** + * 职务头衔id + *

示例值:java + */ + this.jobTitle = builder.jobTitle; + /** + * 试用期开始日期 + *

示例值:2022-07-29 + */ + this.probationStartDate = builder.probationStartDate; + /** + * 试用期结束日期 + *

示例值:2023-04-07 + */ + this.probationEndDate = builder.probationEndDate; + /** + * 合同开始日期 + *

示例值:2022-10-08 + */ + this.contractStartDate = builder.contractStartDate; + /** + * 合同结束日期 + *

示例值:2025-10-07 + */ + this.contractEndDate = builder.contractEndDate; + /** + * 入职日期 + *

示例值:2022-10-08 + */ + this.onboardingDate = builder.onboardingDate; + /** + * 入职地点id + *

示例值:6977976687350924832 + */ + this.onboardingLocationId = builder.onboardingLocationId; + /** + * 办公地点id + *

示例值:6977976687350924832 + */ + this.officeLocationId = builder.officeLocationId; + /** + * 招聘来源id + *

示例值:experienced_professionals + */ + this.recruitmentTypeId = builder.recruitmentTypeId; + /** + * 试用期时长 + *

示例值:6 + */ + this.probationPeriod = builder.probationPeriod; + /** + * 人员类型id + *

示例值:6977973225846343171 + */ + this.employeeTypeId = builder.employeeTypeId; + /** + * 雇佣类型id + *

示例值:6977973225846343171 + */ + this.employmentTypeId = builder.employmentTypeId; + /** + * 工作邮箱 + *

示例值:joshua@bytedance.com + */ + this.workEmail = builder.workEmail; + /** + * 期限类型id + *

示例值:6977973225846343171 + */ + this.durationTypeId = builder.durationTypeId; + /** + * 签订类型id + *

示例值:6738317738688661772 + */ + this.signingTypeId = builder.signingTypeId; + /** + * 入职方式 + *

示例值:1 + */ + this.entryMode = builder.entryMode; + /** + * 社保城市id + *

示例值:xxx + */ + this.socialSecurityCityId = builder.socialSecurityCityId; + /** + * 合同类型 + *

示例值:6738317738688661772 + */ + this.contractType = builder.contractType; + /** + * 公司 + *

示例值:6738317738688661772 + */ + this.company = builder.company; + /** + * 成本中心分摊信息 + *

示例值: + */ + this.costCenterRate = builder.costCenterRate; + /** + * 职等ID + *

示例值:6738317738688661772 + */ + this.jobGradeId = builder.jobGradeId; + /** + * 自定义字段 + *

示例值: + */ + this.customFields = builder.customFields; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getOfferId() { + return this.offerId; + } + + public void setOfferId(String offerId) { + this.offerId = offerId; + } + + public String getOfferHrId() { + return this.offerHrId; + } + + public void setOfferHrId(String offerHrId) { + this.offerHrId = offerHrId; + } + + public String getDepartmentId() { + return this.departmentId; + } + + public void setDepartmentId(String departmentId) { + this.departmentId = departmentId; + } + + public String getDirectLeaderId() { + return this.directLeaderId; + } + + public void setDirectLeaderId(String directLeaderId) { + this.directLeaderId = directLeaderId; + } + + public String getJobId() { + return this.jobId; + } + + public void setJobId(String jobId) { + this.jobId = jobId; + } + + public String getJobFamilyId() { + return this.jobFamilyId; + } + + public void setJobFamilyId(String jobFamilyId) { + this.jobFamilyId = jobFamilyId; + } + + public String getJobLevelId() { + return this.jobLevelId; + } + + public void setJobLevelId(String jobLevelId) { + this.jobLevelId = jobLevelId; + } + + public String getJobTitle() { + return this.jobTitle; + } + + public void setJobTitle(String jobTitle) { + this.jobTitle = jobTitle; + } + + public String getProbationStartDate() { + return this.probationStartDate; + } + + public void setProbationStartDate(String probationStartDate) { + this.probationStartDate = probationStartDate; + } + + public String getProbationEndDate() { + return this.probationEndDate; + } + + public void setProbationEndDate(String probationEndDate) { + this.probationEndDate = probationEndDate; + } + + public String getContractStartDate() { + return this.contractStartDate; + } + + public void setContractStartDate(String contractStartDate) { + this.contractStartDate = contractStartDate; + } + + public String getContractEndDate() { + return this.contractEndDate; + } + + public void setContractEndDate(String contractEndDate) { + this.contractEndDate = contractEndDate; + } + + public String getOnboardingDate() { + return this.onboardingDate; + } + + public void setOnboardingDate(String onboardingDate) { + this.onboardingDate = onboardingDate; + } + + public String getOnboardingLocationId() { + return this.onboardingLocationId; + } + + public void setOnboardingLocationId(String onboardingLocationId) { + this.onboardingLocationId = onboardingLocationId; + } + + public String getOfficeLocationId() { + return this.officeLocationId; + } + + public void setOfficeLocationId(String officeLocationId) { + this.officeLocationId = officeLocationId; + } + + public String getRecruitmentTypeId() { + return this.recruitmentTypeId; + } + + public void setRecruitmentTypeId(String recruitmentTypeId) { + this.recruitmentTypeId = recruitmentTypeId; + } + + public String getProbationPeriod() { + return this.probationPeriod; + } + + public void setProbationPeriod(String probationPeriod) { + this.probationPeriod = probationPeriod; + } + + public String getEmployeeTypeId() { + return this.employeeTypeId; + } + + public void setEmployeeTypeId(String employeeTypeId) { + this.employeeTypeId = employeeTypeId; + } + + public String getEmploymentTypeId() { + return this.employmentTypeId; + } + + public void setEmploymentTypeId(String employmentTypeId) { + this.employmentTypeId = employmentTypeId; + } + + public String getWorkEmail() { + return this.workEmail; + } + + public void setWorkEmail(String workEmail) { + this.workEmail = workEmail; + } + + public String getDurationTypeId() { + return this.durationTypeId; + } + + public void setDurationTypeId(String durationTypeId) { + this.durationTypeId = durationTypeId; + } + + public String getSigningTypeId() { + return this.signingTypeId; + } + + public void setSigningTypeId(String signingTypeId) { + this.signingTypeId = signingTypeId; + } + + public String getEntryMode() { + return this.entryMode; + } + + public void setEntryMode(String entryMode) { + this.entryMode = entryMode; + } + + public String getSocialSecurityCityId() { + return this.socialSecurityCityId; + } + + public void setSocialSecurityCityId(String socialSecurityCityId) { + this.socialSecurityCityId = socialSecurityCityId; + } + + public String getContractType() { + return this.contractType; + } + + public void setContractType(String contractType) { + this.contractType = contractType; + } + + public String getCompany() { + return this.company; + } + + public void setCompany(String company) { + this.company = company; + } + + public JobDataCostCenter[] getCostCenterRate() { + return this.costCenterRate; + } + + public void setCostCenterRate(JobDataCostCenter[] costCenterRate) { + this.costCenterRate = costCenterRate; + } + + public String getJobGradeId() { + return this.jobGradeId; + } + + public void setJobGradeId(String jobGradeId) { + this.jobGradeId = jobGradeId; + } + + public ObjectFieldData[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(ObjectFieldData[] customFields) { + this.customFields = customFields; + } + + public static class Builder { + /** + * Offer id + *

示例值:7032210902531327521 + */ + private String offerId; + /** + * Offer hr id + *

示例值:7032210902531327521 + */ + private String offerHrId; + /** + * 部门 id + *

示例值:7147562782945478177 + */ + private String departmentId; + /** + * 直属领导id + *

示例值:7032210902531327521 + */ + private String directLeaderId; + /** + * 职务id + *

示例值:6977976735715378724 + */ + private String jobId; + /** + * 序列id + *

示例值:6977972856625939999 + */ + private String jobFamilyId; + /** + * 级别id + *

示例值:6977971894960145950 + */ + private String jobLevelId; + /** + * 职务头衔id + *

示例值:java + */ + private String jobTitle; + /** + * 试用期开始日期 + *

示例值:2022-07-29 + */ + private String probationStartDate; + /** + * 试用期结束日期 + *

示例值:2023-04-07 + */ + private String probationEndDate; + /** + * 合同开始日期 + *

示例值:2022-10-08 + */ + private String contractStartDate; + /** + * 合同结束日期 + *

示例值:2025-10-07 + */ + private String contractEndDate; + /** + * 入职日期 + *

示例值:2022-10-08 + */ + private String onboardingDate; + /** + * 入职地点id + *

示例值:6977976687350924832 + */ + private String onboardingLocationId; + /** + * 办公地点id + *

示例值:6977976687350924832 + */ + private String officeLocationId; + /** + * 招聘来源id + *

示例值:experienced_professionals + */ + private String recruitmentTypeId; + /** + * 试用期时长 + *

示例值:6 + */ + private String probationPeriod; + /** + * 人员类型id + *

示例值:6977973225846343171 + */ + private String employeeTypeId; + /** + * 雇佣类型id + *

示例值:6977973225846343171 + */ + private String employmentTypeId; + /** + * 工作邮箱 + *

示例值:joshua@bytedance.com + */ + private String workEmail; + /** + * 期限类型id + *

示例值:6977973225846343171 + */ + private String durationTypeId; + /** + * 签订类型id + *

示例值:6738317738688661772 + */ + private String signingTypeId; + /** + * 入职方式 + *

示例值:1 + */ + private String entryMode; + /** + * 社保城市id + *

示例值:xxx + */ + private String socialSecurityCityId; + /** + * 合同类型 + *

示例值:6738317738688661772 + */ + private String contractType; + /** + * 公司 + *

示例值:6738317738688661772 + */ + private String company; + /** + * 成本中心分摊信息 + *

示例值: + */ + private JobDataCostCenter[] costCenterRate; + /** + * 职等ID + *

示例值:6738317738688661772 + */ + private String jobGradeId; + /** + * 自定义字段 + *

示例值: + */ + private ObjectFieldData[] customFields; + + /** + * Offer id + *

示例值:7032210902531327521 + * + * @param offerId + * @return + */ + public Builder offerId(String offerId) { + this.offerId = offerId; + return this; + } + + + /** + * Offer hr id + *

示例值:7032210902531327521 + * + * @param offerHrId + * @return + */ + public Builder offerHrId(String offerHrId) { + this.offerHrId = offerHrId; + return this; + } + + + /** + * 部门 id + *

示例值:7147562782945478177 + * + * @param departmentId + * @return + */ + public Builder departmentId(String departmentId) { + this.departmentId = departmentId; + return this; + } + + + /** + * 直属领导id + *

示例值:7032210902531327521 + * + * @param directLeaderId + * @return + */ + public Builder directLeaderId(String directLeaderId) { + this.directLeaderId = directLeaderId; + return this; + } + + + /** + * 职务id + *

示例值:6977976735715378724 + * + * @param jobId + * @return + */ + public Builder jobId(String jobId) { + this.jobId = jobId; + return this; + } + + + /** + * 序列id + *

示例值:6977972856625939999 + * + * @param jobFamilyId + * @return + */ + public Builder jobFamilyId(String jobFamilyId) { + this.jobFamilyId = jobFamilyId; + return this; + } + + + /** + * 级别id + *

示例值:6977971894960145950 + * + * @param jobLevelId + * @return + */ + public Builder jobLevelId(String jobLevelId) { + this.jobLevelId = jobLevelId; + return this; + } + + + /** + * 职务头衔id + *

示例值:java + * + * @param jobTitle + * @return + */ + public Builder jobTitle(String jobTitle) { + this.jobTitle = jobTitle; + return this; + } + + + /** + * 试用期开始日期 + *

示例值:2022-07-29 + * + * @param probationStartDate + * @return + */ + public Builder probationStartDate(String probationStartDate) { + this.probationStartDate = probationStartDate; + return this; + } + + + /** + * 试用期结束日期 + *

示例值:2023-04-07 + * + * @param probationEndDate + * @return + */ + public Builder probationEndDate(String probationEndDate) { + this.probationEndDate = probationEndDate; + return this; + } + + + /** + * 合同开始日期 + *

示例值:2022-10-08 + * + * @param contractStartDate + * @return + */ + public Builder contractStartDate(String contractStartDate) { + this.contractStartDate = contractStartDate; + return this; + } + + + /** + * 合同结束日期 + *

示例值:2025-10-07 + * + * @param contractEndDate + * @return + */ + public Builder contractEndDate(String contractEndDate) { + this.contractEndDate = contractEndDate; + return this; + } + + + /** + * 入职日期 + *

示例值:2022-10-08 + * + * @param onboardingDate + * @return + */ + public Builder onboardingDate(String onboardingDate) { + this.onboardingDate = onboardingDate; + return this; + } + + + /** + * 入职地点id + *

示例值:6977976687350924832 + * + * @param onboardingLocationId + * @return + */ + public Builder onboardingLocationId(String onboardingLocationId) { + this.onboardingLocationId = onboardingLocationId; + return this; + } + + + /** + * 办公地点id + *

示例值:6977976687350924832 + * + * @param officeLocationId + * @return + */ + public Builder officeLocationId(String officeLocationId) { + this.officeLocationId = officeLocationId; + return this; + } + + + /** + * 招聘来源id + *

示例值:experienced_professionals + * + * @param recruitmentTypeId + * @return + */ + public Builder recruitmentTypeId(String recruitmentTypeId) { + this.recruitmentTypeId = recruitmentTypeId; + return this; + } + + + /** + * 试用期时长 + *

示例值:6 + * + * @param probationPeriod + * @return + */ + public Builder probationPeriod(String probationPeriod) { + this.probationPeriod = probationPeriod; + return this; + } + + + /** + * 人员类型id + *

示例值:6977973225846343171 + * + * @param employeeTypeId + * @return + */ + public Builder employeeTypeId(String employeeTypeId) { + this.employeeTypeId = employeeTypeId; + return this; + } + + + /** + * 雇佣类型id + *

示例值:6977973225846343171 + * + * @param employmentTypeId + * @return + */ + public Builder employmentTypeId(String employmentTypeId) { + this.employmentTypeId = employmentTypeId; + return this; + } + + + /** + * 工作邮箱 + *

示例值:joshua@bytedance.com + * + * @param workEmail + * @return + */ + public Builder workEmail(String workEmail) { + this.workEmail = workEmail; + return this; + } + + + /** + * 期限类型id + *

示例值:6977973225846343171 + * + * @param durationTypeId + * @return + */ + public Builder durationTypeId(String durationTypeId) { + this.durationTypeId = durationTypeId; + return this; + } + + + /** + * 签订类型id + *

示例值:6738317738688661772 + * + * @param signingTypeId + * @return + */ + public Builder signingTypeId(String signingTypeId) { + this.signingTypeId = signingTypeId; + return this; + } + + + /** + * 入职方式 + *

示例值:1 + * + * @param entryMode + * @return + */ + public Builder entryMode(String entryMode) { + this.entryMode = entryMode; + return this; + } + + + /** + * 社保城市id + *

示例值:xxx + * + * @param socialSecurityCityId + * @return + */ + public Builder socialSecurityCityId(String socialSecurityCityId) { + this.socialSecurityCityId = socialSecurityCityId; + return this; + } + + + /** + * 合同类型 + *

示例值:6738317738688661772 + * + * @param contractType + * @return + */ + public Builder contractType(String contractType) { + this.contractType = contractType; + return this; + } + + + /** + * 公司 + *

示例值:6738317738688661772 + * + * @param company + * @return + */ + public Builder company(String company) { + this.company = company; + return this; + } + + + /** + * 成本中心分摊信息 + *

示例值: + * + * @param costCenterRate + * @return + */ + public Builder costCenterRate(JobDataCostCenter[] costCenterRate) { + this.costCenterRate = costCenterRate; + return this; + } + + + /** + * 职等ID + *

示例值:6738317738688661772 + * + * @param jobGradeId + * @return + */ + public Builder jobGradeId(String jobGradeId) { + this.jobGradeId = jobGradeId; + return this; + } + + + /** + * 自定义字段 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(ObjectFieldData[] customFields) { + this.customFields = customFields; + return this; + } + + + public OfferInfo build() { + return new OfferInfo(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/OnboardingTask.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/OnboardingTask.java new file mode 100644 index 000000000..f53990b09 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/OnboardingTask.java @@ -0,0 +1,160 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class OnboardingTask { + /** + * 任务名称 + *

示例值:task_1 + */ + @SerializedName("task_name") + private String taskName; + /** + * 任务名称 + *

示例值: + */ + @SerializedName("task_status") + private String taskStatus; + /** + * 当前操作人雇佣 ID + *

示例值:7032210902531327521 + */ + @SerializedName("operator_id") + private String operatorId; + + // builder 开始 + public OnboardingTask() { + } + + public OnboardingTask(Builder builder) { + /** + * 任务名称 + *

示例值:task_1 + */ + this.taskName = builder.taskName; + /** + * 任务名称 + *

示例值: + */ + this.taskStatus = builder.taskStatus; + /** + * 当前操作人雇佣 ID + *

示例值:7032210902531327521 + */ + this.operatorId = builder.operatorId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getTaskName() { + return this.taskName; + } + + public void setTaskName(String taskName) { + this.taskName = taskName; + } + + public String getTaskStatus() { + return this.taskStatus; + } + + public void setTaskStatus(String taskStatus) { + this.taskStatus = taskStatus; + } + + public String getOperatorId() { + return this.operatorId; + } + + public void setOperatorId(String operatorId) { + this.operatorId = operatorId; + } + + public static class Builder { + /** + * 任务名称 + *

示例值:task_1 + */ + private String taskName; + /** + * 任务名称 + *

示例值: + */ + private String taskStatus; + /** + * 当前操作人雇佣 ID + *

示例值:7032210902531327521 + */ + private String operatorId; + + /** + * 任务名称 + *

示例值:task_1 + * + * @param taskName + * @return + */ + public Builder taskName(String taskName) { + this.taskName = taskName; + return this; + } + + + /** + * 任务名称 + *

示例值: + * + * @param taskStatus + * @return + */ + public Builder taskStatus(String taskStatus) { + this.taskStatus = taskStatus; + return this; + } + + /** + * 任务名称 + *

示例值: + * + * @param taskStatus {@link com.lark.oapi.service.corehr.v2.enums.OnboardingTaskTaskStatusEnum} + * @return + */ + public Builder taskStatus(com.lark.oapi.service.corehr.v2.enums.OnboardingTaskTaskStatusEnum taskStatus) { + this.taskStatus = taskStatus.getValue(); + return this; + } + + + /** + * 当前操作人雇佣 ID + *

示例值:7032210902531327521 + * + * @param operatorId + * @return + */ + public Builder operatorId(String operatorId) { + this.operatorId = operatorId; + return this; + } + + + public OnboardingTask build() { + return new OnboardingTask(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProbationUpdatedV2.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProbationUpdatedV2.java new file mode 100644 index 000000000..be5b13e7a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProbationUpdatedV2.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.event.model.BaseEventV2; + +public class P2ProbationUpdatedV2 extends BaseEventV2 { + /** + *

示例值: + */ + @SerializedName("event") + private P2ProbationUpdatedV2Data event; + + public P2ProbationUpdatedV2Data getEvent() { + return this.event; + } + + public void setEvent(P2ProbationUpdatedV2Data event) { + this.event = event; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProbationUpdatedV2Data.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProbationUpdatedV2Data.java new file mode 100644 index 000000000..7c585db44 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProbationUpdatedV2Data.java @@ -0,0 +1,62 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class P2ProbationUpdatedV2Data { + /** + * 雇佣 ID + *

示例值:7043711771159341206 + */ + @SerializedName("employment_id") + private String employmentId; + /** + * 试用期状态 + *

示例值:converted + */ + @SerializedName("probation_status") + private String probationStatus; + /** + * 试用期实际结束日期 + *

示例值:2023-05-25 + */ + @SerializedName("actual_probation_end_date") + private String actualProbationEndDate; + + public String getEmploymentId() { + return this.employmentId; + } + + public void setEmploymentId(String employmentId) { + this.employmentId = employmentId; + } + + public String getProbationStatus() { + return this.probationStatus; + } + + public void setProbationStatus(String probationStatus) { + this.probationStatus = probationStatus; + } + + public String getActualProbationEndDate() { + return this.actualProbationEndDate; + } + + public void setActualProbationEndDate(String actualProbationEndDate) { + this.actualProbationEndDate = actualProbationEndDate; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProcessApproverUpdatedV2.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProcessApproverUpdatedV2.java new file mode 100644 index 000000000..119389127 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProcessApproverUpdatedV2.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.event.model.BaseEventV2; + +public class P2ProcessApproverUpdatedV2 extends BaseEventV2 { + /** + *

示例值: + */ + @SerializedName("event") + private P2ProcessApproverUpdatedV2Data event; + + public P2ProcessApproverUpdatedV2Data getEvent() { + return this.event; + } + + public void setEvent(P2ProcessApproverUpdatedV2Data event) { + this.event = event; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProcessApproverUpdatedV2Data.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProcessApproverUpdatedV2Data.java new file mode 100644 index 000000000..ed409b4c6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProcessApproverUpdatedV2Data.java @@ -0,0 +1,76 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class P2ProcessApproverUpdatedV2Data { + /** + * 流程实例ID + *

示例值:7072306364927985196 + */ + @SerializedName("process_id") + private String processId; + /** + * 单据ID + *

示例值:7072306364927985187 + */ + @SerializedName("approver_id") + private String approverId; + /** + * 单据类型 + *

示例值:1 + */ + @SerializedName("type") + private Integer type; + /** + * 单据状态 + *

示例值:1 + */ + @SerializedName("status") + private Integer status; + + public String getProcessId() { + return this.processId; + } + + public void setProcessId(String processId) { + this.processId = processId; + } + + public String getApproverId() { + return this.approverId; + } + + public void setApproverId(String approverId) { + this.approverId = approverId; + } + + public Integer getType() { + return this.type; + } + + public void setType(Integer type) { + this.type = type; + } + + public Integer getStatus() { + return this.status; + } + + public void setStatus(Integer status) { + this.status = status; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProcessCcUpdatedV2.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProcessCcUpdatedV2.java new file mode 100644 index 000000000..067c767ef --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProcessCcUpdatedV2.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.event.model.BaseEventV2; + +public class P2ProcessCcUpdatedV2 extends BaseEventV2 { + /** + *

示例值: + */ + @SerializedName("event") + private P2ProcessCcUpdatedV2Data event; + + public P2ProcessCcUpdatedV2Data getEvent() { + return this.event; + } + + public void setEvent(P2ProcessCcUpdatedV2Data event) { + this.event = event; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProcessCcUpdatedV2Data.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProcessCcUpdatedV2Data.java new file mode 100644 index 000000000..507f147d7 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProcessCcUpdatedV2Data.java @@ -0,0 +1,62 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class P2ProcessCcUpdatedV2Data { + /** + * 流程实例ID + *

示例值:7072306364927985196 + */ + @SerializedName("process_id") + private String processId; + /** + * 抄送单据ID + *

示例值:7072306364927985187 + */ + @SerializedName("approver_id") + private String approverId; + /** + * 单据状态 + *

示例值:5 + */ + @SerializedName("status") + private Integer status; + + public String getProcessId() { + return this.processId; + } + + public void setProcessId(String processId) { + this.processId = processId; + } + + public String getApproverId() { + return this.approverId; + } + + public void setApproverId(String approverId) { + this.approverId = approverId; + } + + public Integer getStatus() { + return this.status; + } + + public void setStatus(Integer status) { + this.status = status; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProcessUpdatedV2.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProcessUpdatedV2.java new file mode 100644 index 000000000..e21680e22 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProcessUpdatedV2.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.event.model.BaseEventV2; + +public class P2ProcessUpdatedV2 extends BaseEventV2 { + /** + *

示例值: + */ + @SerializedName("event") + private P2ProcessUpdatedV2Data event; + + public P2ProcessUpdatedV2Data getEvent() { + return this.event; + } + + public void setEvent(P2ProcessUpdatedV2Data event) { + this.event = event; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProcessUpdatedV2Data.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProcessUpdatedV2Data.java new file mode 100644 index 000000000..4d281e39e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/P2ProcessUpdatedV2Data.java @@ -0,0 +1,48 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class P2ProcessUpdatedV2Data { + /** + * 流程实例ID + *

示例值:7072306364927985196 + */ + @SerializedName("process_id") + private String processId; + /** + * 变更后状态:1 发起/进行中,9 完成,2拒绝,4 撤回,8 撤销 + *

示例值:1 + */ + @SerializedName("status") + private Integer status; + + public String getProcessId() { + return this.processId; + } + + public void setProcessId(String processId) { + this.processId = processId; + } + + public Integer getStatus() { + return this.status; + } + + public void setStatus(Integer status) { + this.status = status; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ParentsDepartmentReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ParentsDepartmentReq.java new file mode 100644 index 000000000..ac50308d1 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ParentsDepartmentReq.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Query; + +public class ParentsDepartmentReq { + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + */ + @Query + @SerializedName("department_id_type") + private String departmentIdType; + @Body + private ParentsDepartmentReqBody body; + + // builder 开始 + public ParentsDepartmentReq() { + } + + public ParentsDepartmentReq(Builder builder) { + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + */ + this.departmentIdType = builder.departmentIdType; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getDepartmentIdType() { + return this.departmentIdType; + } + + public void setDepartmentIdType(String departmentIdType) { + this.departmentIdType = departmentIdType; + } + + public ParentsDepartmentReqBody getParentsDepartmentReqBody() { + return this.body; + } + + public void setParentsDepartmentReqBody(ParentsDepartmentReqBody body) { + this.body = body; + } + + public static class Builder { + private String departmentIdType; // 此次调用中使用的部门 ID 类型 + private ParentsDepartmentReqBody body; + + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + * + * @param departmentIdType + * @return + */ + public Builder departmentIdType(String departmentIdType) { + this.departmentIdType = departmentIdType; + return this; + } + + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + * + * @param departmentIdType {@link com.lark.oapi.service.corehr.v2.enums.ParentsDepartmentDepartmentIdTypeEnum} + * @return + */ + public Builder departmentIdType(com.lark.oapi.service.corehr.v2.enums.ParentsDepartmentDepartmentIdTypeEnum departmentIdType) { + this.departmentIdType = departmentIdType.getValue(); + return this; + } + + public ParentsDepartmentReqBody getParentsDepartmentReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder parentsDepartmentReqBody(ParentsDepartmentReqBody body) { + this.body = body; + return this; + } + + public ParentsDepartmentReq build() { + return new ParentsDepartmentReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ParentsDepartmentReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ParentsDepartmentReqBody.java new file mode 100644 index 000000000..a968b0bbc --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ParentsDepartmentReqBody.java @@ -0,0 +1,74 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class ParentsDepartmentReqBody { + /** + * 部门 ID 列表,一次性最多传入 100 个部门 ID + *

示例值: + */ + @SerializedName("department_id_list") + private String[] departmentIdList; + + // builder 开始 + public ParentsDepartmentReqBody() { + } + + public ParentsDepartmentReqBody(Builder builder) { + /** + * 部门 ID 列表,一次性最多传入 100 个部门 ID + *

示例值: + */ + this.departmentIdList = builder.departmentIdList; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String[] getDepartmentIdList() { + return this.departmentIdList; + } + + public void setDepartmentIdList(String[] departmentIdList) { + this.departmentIdList = departmentIdList; + } + + public static class Builder { + /** + * 部门 ID 列表,一次性最多传入 100 个部门 ID + *

示例值: + */ + private String[] departmentIdList; + + /** + * 部门 ID 列表,一次性最多传入 100 个部门 ID + *

示例值: + * + * @param departmentIdList + * @return + */ + public Builder departmentIdList(String[] departmentIdList) { + this.departmentIdList = departmentIdList; + return this; + } + + + public ParentsDepartmentReqBody build() { + return new ParentsDepartmentReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ParentsDepartmentResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ParentsDepartmentResp.java new file mode 100644 index 000000000..52e579716 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ParentsDepartmentResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class ParentsDepartmentResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ParentsDepartmentRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ParentsDepartmentRespBody.java new file mode 100644 index 000000000..3f5090760 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ParentsDepartmentRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class ParentsDepartmentRespBody { + /** + * 父部门查询结果 + *

示例值: + */ + @SerializedName("items") + private DepartmentParents[] items; + + public DepartmentParents[] getItems() { + return this.items; + } + + public void setItems(DepartmentParents[] items) { + this.items = items; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PatchPersonReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PatchPersonReq.java new file mode 100644 index 000000000..95771a64e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PatchPersonReq.java @@ -0,0 +1,133 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class PatchPersonReq { + /** + * 根据client_token是否一致来判断是否为同一请求 + *

示例值:12454646 + */ + @Query + @SerializedName("client_token") + private String clientToken; + /** + * person的ID + *

示例值:12454646 + */ + @Path + @SerializedName("person_id") + private String personId; + @Body + private PersonInfo body; + + // builder 开始 + public PatchPersonReq() { + } + + public PatchPersonReq(Builder builder) { + /** + * 根据client_token是否一致来判断是否为同一请求 + *

示例值:12454646 + */ + this.clientToken = builder.clientToken; + /** + * person的ID + *

示例值:12454646 + */ + this.personId = builder.personId; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getClientToken() { + return this.clientToken; + } + + public void setClientToken(String clientToken) { + this.clientToken = clientToken; + } + + public String getPersonId() { + return this.personId; + } + + public void setPersonId(String personId) { + this.personId = personId; + } + + public PersonInfo getPersonInfo() { + return this.body; + } + + public void setPersonInfo(PersonInfo body) { + this.body = body; + } + + public static class Builder { + private String clientToken; // 根据client_token是否一致来判断是否为同一请求 + private String personId; // person的ID + private PersonInfo body; + + /** + * 根据client_token是否一致来判断是否为同一请求 + *

示例值:12454646 + * + * @param clientToken + * @return + */ + public Builder clientToken(String clientToken) { + this.clientToken = clientToken; + return this; + } + + /** + * person的ID + *

示例值:12454646 + * + * @param personId + * @return + */ + public Builder personId(String personId) { + this.personId = personId; + return this; + } + + public PersonInfo getPersonInfo() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder personInfo(PersonInfo body) { + this.body = body; + return this; + } + + public PatchPersonReq build() { + return new PatchPersonReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PatchPersonResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PatchPersonResp.java new file mode 100644 index 000000000..b6130185c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PatchPersonResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class PatchPersonResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PatchPersonRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PatchPersonRespBody.java new file mode 100644 index 000000000..e1524a9ae --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PatchPersonRespBody.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PatchPersonRespBody { + /** + *

示例值: + */ + @SerializedName("person") + private PersonInfo person; + + public PersonInfo getPerson() { + return this.person; + } + + public void setPerson(PersonInfo person) { + this.person = person; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PatchProbationAssessmentReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PatchProbationAssessmentReq.java new file mode 100644 index 000000000..402820426 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PatchProbationAssessmentReq.java @@ -0,0 +1,133 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class PatchProbationAssessmentReq { + /** + * 根据 client_token 是否一致来判断是否为同一请求 + *

示例值:6822122262122064111 + */ + @Query + @SerializedName("client_token") + private String clientToken; + /** + * 考核结果 ID + *

示例值:7140964208476371331 + */ + @Path + @SerializedName("assessment_id") + private String assessmentId; + @Body + private AssessmentForCreate body; + + // builder 开始 + public PatchProbationAssessmentReq() { + } + + public PatchProbationAssessmentReq(Builder builder) { + /** + * 根据 client_token 是否一致来判断是否为同一请求 + *

示例值:6822122262122064111 + */ + this.clientToken = builder.clientToken; + /** + * 考核结果 ID + *

示例值:7140964208476371331 + */ + this.assessmentId = builder.assessmentId; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getClientToken() { + return this.clientToken; + } + + public void setClientToken(String clientToken) { + this.clientToken = clientToken; + } + + public String getAssessmentId() { + return this.assessmentId; + } + + public void setAssessmentId(String assessmentId) { + this.assessmentId = assessmentId; + } + + public AssessmentForCreate getAssessmentForCreate() { + return this.body; + } + + public void setAssessmentForCreate(AssessmentForCreate body) { + this.body = body; + } + + public static class Builder { + private String clientToken; // 根据 client_token 是否一致来判断是否为同一请求 + private String assessmentId; // 考核结果 ID + private AssessmentForCreate body; + + /** + * 根据 client_token 是否一致来判断是否为同一请求 + *

示例值:6822122262122064111 + * + * @param clientToken + * @return + */ + public Builder clientToken(String clientToken) { + this.clientToken = clientToken; + return this; + } + + /** + * 考核结果 ID + *

示例值:7140964208476371331 + * + * @param assessmentId + * @return + */ + public Builder assessmentId(String assessmentId) { + this.assessmentId = assessmentId; + return this; + } + + public AssessmentForCreate getAssessmentForCreate() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder assessmentForCreate(AssessmentForCreate body) { + this.body = body; + return this; + } + + public PatchProbationAssessmentReq build() { + return new PatchProbationAssessmentReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PatchProbationAssessmentResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PatchProbationAssessmentResp.java new file mode 100644 index 000000000..9518f7e3c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PatchProbationAssessmentResp.java @@ -0,0 +1,20 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; +import com.lark.oapi.core.response.EmptyData; + +public class PatchProbationAssessmentResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PersonInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PersonInfo.java new file mode 100644 index 000000000..2433ff7f9 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PersonInfo.java @@ -0,0 +1,1739 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PersonInfo { + /** + * 个人信息 ID + *

示例值:6919733936050406926 + */ + @SerializedName("person_id") + private String personId; + /** + * 个人电话 + *

示例值:13649211111 + */ + @SerializedName("phone_number") + private String phoneNumber; + /** + * 法定姓名 + *

示例值:张三 + */ + @SerializedName("legal_name") + private String legalName; + /** + * 常用名 + *

示例值:刘梓新(Henry) + */ + @SerializedName("preferred_name") + private String preferredName; + /** + * 常用本地全名 + *

示例值:刘梓新 + */ + @SerializedName("preferred_local_full_name") + private String preferredLocalFullName; + /** + * 常用英文全名 + *

示例值:Henry + */ + @SerializedName("preferred_english_full_name") + private String preferredEnglishFullName; + /** + * 姓名列表 + *

示例值: + */ + @SerializedName("name_list") + private PersonName[] nameList; + /** + * -| 性别,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:gender - object_api_name:person + *

示例值: + */ + @SerializedName("gender") + private Enum gender; + /** + * 出生日期 + *

示例值:2020-01-01 + */ + @SerializedName("date_of_birth") + private String dateOfBirth; + /** + * -| 民族 / 种族,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:ethnicity_race - object_api_name:person + *

示例值: + */ + @SerializedName("race") + private Enum race; + /** + * -| 婚姻状况,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:marital_status - object_api_name:person + *

示例值: + */ + @SerializedName("marital_status") + private Enum maritalStatus; + /** + * 电话列表,只有当满足下面所有条件时,电话在个人信息页才可见 + *

示例值: + */ + @SerializedName("phone_list") + private Phone[] phoneList; + /** + * 地址列表 + *

示例值: + */ + @SerializedName("address_list") + private Address[] addressList; + /** + * 邮箱列表 + *

示例值: + */ + @SerializedName("email_list") + private Email[] emailList; + /** + * 工作经历列表 + *

示例值: + */ + @SerializedName("work_experience_list") + private WorkExperienceInfo[] workExperienceList; + /** + * 教育经历列表 + *

示例值: + */ + @SerializedName("education_list") + private Education[] educationList; + /** + * 银行账户 + *

示例值: + */ + @SerializedName("bank_account_list") + private BankAccount[] bankAccountList; + /** + * 证件 + *

示例值: + */ + @SerializedName("national_id_list") + private NationalId[] nationalIdList; + /** + * 家庭成员列表 + *

示例值: + */ + @SerializedName("dependent_list") + private Dependent[] dependentList; + /** + * 紧急联系人列表 + *

示例值: + */ + @SerializedName("emergency_contact_list") + private EmergencyContact[] emergencyContactList; + /** + * 参加工作日期 + *

示例值:2020-10-01 + */ + @SerializedName("date_entered_workforce") + private String dateEnteredWorkforce; + /** + * 工龄 + *

示例值:2 + */ + @SerializedName("working_years") + private Integer workingYears; + /** + * 头像资源的 ID + *

示例值:dfysuc8x76dsfsw + */ + @SerializedName("profile_image_id") + private String profileImageId; + /** + * 邮箱地址 + *

示例值:test@163.com + */ + @SerializedName("email_address") + private String emailAddress; + /** + * 年龄 + *

示例值:22 + */ + @SerializedName("age") + private Integer age; + /** + * 最高学历教育经历 + *

示例值: + */ + @SerializedName("highest_level_of_education") + private Education highestLevelOfEducation; + /** + * 最高学位教育经历 + *

示例值: + */ + @SerializedName("highest_degree_of_education") + private Education highestDegreeOfEducation; + /** + * 个人资料附件 + *

示例值: + */ + @SerializedName("personal_profile") + private PersonalProfile[] personalProfile; + /** + * 籍贯 ID + *

示例值:6863326262618752111 + */ + @SerializedName("native_region") + private String nativeRegion; + /** + * 户口类型,枚举值可通过文档【飞书人事枚举常量】户口类型(hukou_type)枚举定义部分获得 + *

示例值: + */ + @SerializedName("hukou_type") + private Enum hukouType; + /** + * 户口所在地 + *

示例值:山东省平阴县 + */ + @SerializedName("hukou_location") + private String hukouLocation; + /** + * 人才 ID + *

示例值:6863326262618752123 + */ + @SerializedName("talent_id") + private String talentId; + /** + * 自定义字段 + *

示例值: + */ + @SerializedName("custom_fields") + private CustomFieldData[] customFields; + /** + * 居民身份证件号码 + *

示例值:11010000000000 + */ + @SerializedName("national_id_number") + private String nationalIdNumber; + /** + * 家庭地址 + *

示例值:6863326262618752123 + */ + @SerializedName("family_address") + private String familyAddress; + /** + * 个人附加信息 + *

示例值:6863326262618752123 + */ + @SerializedName("person_info_chns") + private PersonInfoChn[] personInfoChns; + /** + * 出生国家/地区 + *

示例值:中国 + */ + @SerializedName("born_country_region") + private String bornCountryRegion; + /** + * 是否残疾 + *

示例值:true + */ + @SerializedName("is_disabled") + private Boolean isDisabled; + /** + * 残疾证号 + *

示例值:1110000 + */ + @SerializedName("disable_card_number") + private String disableCardNumber; + /** + * 是否烈属 + *

示例值:true + */ + @SerializedName("is_martyr_family") + private Boolean isMartyrFamily; + /** + * 烈属证号 + *

示例值:1110000 + */ + @SerializedName("martyr_card_number") + private String martyrCardNumber; + /** + * 是否孤老 + *

示例值:true + */ + @SerializedName("is_old_alone") + private Boolean isOldAlone; + /** + * 居民身份信息 + *

示例值:6863326262618752123 + */ + @SerializedName("resident_taxes") + private ResidentTax[] residentTaxes; + /** + * 首次入境日期 + *

示例值:2021-01-02 + */ + @SerializedName("first_entry_time") + private String firstEntryTime; + /** + * 预计离境日期 + *

示例值:2022-01-02 + */ + @SerializedName("leave_time") + private String leaveTime; + /** + * -| 宗教信仰,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name:person - custom_api_name:religion + *

示例值: + */ + @SerializedName("religion") + private Enum religion; + + // builder 开始 + public PersonInfo() { + } + + public PersonInfo(Builder builder) { + /** + * 个人信息 ID + *

示例值:6919733936050406926 + */ + this.personId = builder.personId; + /** + * 个人电话 + *

示例值:13649211111 + */ + this.phoneNumber = builder.phoneNumber; + /** + * 法定姓名 + *

示例值:张三 + */ + this.legalName = builder.legalName; + /** + * 常用名 + *

示例值:刘梓新(Henry) + */ + this.preferredName = builder.preferredName; + /** + * 常用本地全名 + *

示例值:刘梓新 + */ + this.preferredLocalFullName = builder.preferredLocalFullName; + /** + * 常用英文全名 + *

示例值:Henry + */ + this.preferredEnglishFullName = builder.preferredEnglishFullName; + /** + * 姓名列表 + *

示例值: + */ + this.nameList = builder.nameList; + /** + * -| 性别,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:gender - object_api_name:person + *

示例值: + */ + this.gender = builder.gender; + /** + * 出生日期 + *

示例值:2020-01-01 + */ + this.dateOfBirth = builder.dateOfBirth; + /** + * -| 民族 / 种族,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:ethnicity_race - object_api_name:person + *

示例值: + */ + this.race = builder.race; + /** + * -| 婚姻状况,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:marital_status - object_api_name:person + *

示例值: + */ + this.maritalStatus = builder.maritalStatus; + /** + * 电话列表,只有当满足下面所有条件时,电话在个人信息页才可见 + *

示例值: + */ + this.phoneList = builder.phoneList; + /** + * 地址列表 + *

示例值: + */ + this.addressList = builder.addressList; + /** + * 邮箱列表 + *

示例值: + */ + this.emailList = builder.emailList; + /** + * 工作经历列表 + *

示例值: + */ + this.workExperienceList = builder.workExperienceList; + /** + * 教育经历列表 + *

示例值: + */ + this.educationList = builder.educationList; + /** + * 银行账户 + *

示例值: + */ + this.bankAccountList = builder.bankAccountList; + /** + * 证件 + *

示例值: + */ + this.nationalIdList = builder.nationalIdList; + /** + * 家庭成员列表 + *

示例值: + */ + this.dependentList = builder.dependentList; + /** + * 紧急联系人列表 + *

示例值: + */ + this.emergencyContactList = builder.emergencyContactList; + /** + * 参加工作日期 + *

示例值:2020-10-01 + */ + this.dateEnteredWorkforce = builder.dateEnteredWorkforce; + /** + * 工龄 + *

示例值:2 + */ + this.workingYears = builder.workingYears; + /** + * 头像资源的 ID + *

示例值:dfysuc8x76dsfsw + */ + this.profileImageId = builder.profileImageId; + /** + * 邮箱地址 + *

示例值:test@163.com + */ + this.emailAddress = builder.emailAddress; + /** + * 年龄 + *

示例值:22 + */ + this.age = builder.age; + /** + * 最高学历教育经历 + *

示例值: + */ + this.highestLevelOfEducation = builder.highestLevelOfEducation; + /** + * 最高学位教育经历 + *

示例值: + */ + this.highestDegreeOfEducation = builder.highestDegreeOfEducation; + /** + * 个人资料附件 + *

示例值: + */ + this.personalProfile = builder.personalProfile; + /** + * 籍贯 ID + *

示例值:6863326262618752111 + */ + this.nativeRegion = builder.nativeRegion; + /** + * 户口类型,枚举值可通过文档【飞书人事枚举常量】户口类型(hukou_type)枚举定义部分获得 + *

示例值: + */ + this.hukouType = builder.hukouType; + /** + * 户口所在地 + *

示例值:山东省平阴县 + */ + this.hukouLocation = builder.hukouLocation; + /** + * 人才 ID + *

示例值:6863326262618752123 + */ + this.talentId = builder.talentId; + /** + * 自定义字段 + *

示例值: + */ + this.customFields = builder.customFields; + /** + * 居民身份证件号码 + *

示例值:11010000000000 + */ + this.nationalIdNumber = builder.nationalIdNumber; + /** + * 家庭地址 + *

示例值:6863326262618752123 + */ + this.familyAddress = builder.familyAddress; + /** + * 个人附加信息 + *

示例值:6863326262618752123 + */ + this.personInfoChns = builder.personInfoChns; + /** + * 出生国家/地区 + *

示例值:中国 + */ + this.bornCountryRegion = builder.bornCountryRegion; + /** + * 是否残疾 + *

示例值:true + */ + this.isDisabled = builder.isDisabled; + /** + * 残疾证号 + *

示例值:1110000 + */ + this.disableCardNumber = builder.disableCardNumber; + /** + * 是否烈属 + *

示例值:true + */ + this.isMartyrFamily = builder.isMartyrFamily; + /** + * 烈属证号 + *

示例值:1110000 + */ + this.martyrCardNumber = builder.martyrCardNumber; + /** + * 是否孤老 + *

示例值:true + */ + this.isOldAlone = builder.isOldAlone; + /** + * 居民身份信息 + *

示例值:6863326262618752123 + */ + this.residentTaxes = builder.residentTaxes; + /** + * 首次入境日期 + *

示例值:2021-01-02 + */ + this.firstEntryTime = builder.firstEntryTime; + /** + * 预计离境日期 + *

示例值:2022-01-02 + */ + this.leaveTime = builder.leaveTime; + /** + * -| 宗教信仰,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name:person - custom_api_name:religion + *

示例值: + */ + this.religion = builder.religion; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getPersonId() { + return this.personId; + } + + public void setPersonId(String personId) { + this.personId = personId; + } + + public String getPhoneNumber() { + return this.phoneNumber; + } + + public void setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + public String getLegalName() { + return this.legalName; + } + + public void setLegalName(String legalName) { + this.legalName = legalName; + } + + public String getPreferredName() { + return this.preferredName; + } + + public void setPreferredName(String preferredName) { + this.preferredName = preferredName; + } + + public String getPreferredLocalFullName() { + return this.preferredLocalFullName; + } + + public void setPreferredLocalFullName(String preferredLocalFullName) { + this.preferredLocalFullName = preferredLocalFullName; + } + + public String getPreferredEnglishFullName() { + return this.preferredEnglishFullName; + } + + public void setPreferredEnglishFullName(String preferredEnglishFullName) { + this.preferredEnglishFullName = preferredEnglishFullName; + } + + public PersonName[] getNameList() { + return this.nameList; + } + + public void setNameList(PersonName[] nameList) { + this.nameList = nameList; + } + + public Enum getGender() { + return this.gender; + } + + public void setGender(Enum gender) { + this.gender = gender; + } + + public String getDateOfBirth() { + return this.dateOfBirth; + } + + public void setDateOfBirth(String dateOfBirth) { + this.dateOfBirth = dateOfBirth; + } + + public Enum getRace() { + return this.race; + } + + public void setRace(Enum race) { + this.race = race; + } + + public Enum getMaritalStatus() { + return this.maritalStatus; + } + + public void setMaritalStatus(Enum maritalStatus) { + this.maritalStatus = maritalStatus; + } + + public Phone[] getPhoneList() { + return this.phoneList; + } + + public void setPhoneList(Phone[] phoneList) { + this.phoneList = phoneList; + } + + public Address[] getAddressList() { + return this.addressList; + } + + public void setAddressList(Address[] addressList) { + this.addressList = addressList; + } + + public Email[] getEmailList() { + return this.emailList; + } + + public void setEmailList(Email[] emailList) { + this.emailList = emailList; + } + + public WorkExperienceInfo[] getWorkExperienceList() { + return this.workExperienceList; + } + + public void setWorkExperienceList(WorkExperienceInfo[] workExperienceList) { + this.workExperienceList = workExperienceList; + } + + public Education[] getEducationList() { + return this.educationList; + } + + public void setEducationList(Education[] educationList) { + this.educationList = educationList; + } + + public BankAccount[] getBankAccountList() { + return this.bankAccountList; + } + + public void setBankAccountList(BankAccount[] bankAccountList) { + this.bankAccountList = bankAccountList; + } + + public NationalId[] getNationalIdList() { + return this.nationalIdList; + } + + public void setNationalIdList(NationalId[] nationalIdList) { + this.nationalIdList = nationalIdList; + } + + public Dependent[] getDependentList() { + return this.dependentList; + } + + public void setDependentList(Dependent[] dependentList) { + this.dependentList = dependentList; + } + + public EmergencyContact[] getEmergencyContactList() { + return this.emergencyContactList; + } + + public void setEmergencyContactList(EmergencyContact[] emergencyContactList) { + this.emergencyContactList = emergencyContactList; + } + + public String getDateEnteredWorkforce() { + return this.dateEnteredWorkforce; + } + + public void setDateEnteredWorkforce(String dateEnteredWorkforce) { + this.dateEnteredWorkforce = dateEnteredWorkforce; + } + + public Integer getWorkingYears() { + return this.workingYears; + } + + public void setWorkingYears(Integer workingYears) { + this.workingYears = workingYears; + } + + public String getProfileImageId() { + return this.profileImageId; + } + + public void setProfileImageId(String profileImageId) { + this.profileImageId = profileImageId; + } + + public String getEmailAddress() { + return this.emailAddress; + } + + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + + public Integer getAge() { + return this.age; + } + + public void setAge(Integer age) { + this.age = age; + } + + public Education getHighestLevelOfEducation() { + return this.highestLevelOfEducation; + } + + public void setHighestLevelOfEducation(Education highestLevelOfEducation) { + this.highestLevelOfEducation = highestLevelOfEducation; + } + + public Education getHighestDegreeOfEducation() { + return this.highestDegreeOfEducation; + } + + public void setHighestDegreeOfEducation(Education highestDegreeOfEducation) { + this.highestDegreeOfEducation = highestDegreeOfEducation; + } + + public PersonalProfile[] getPersonalProfile() { + return this.personalProfile; + } + + public void setPersonalProfile(PersonalProfile[] personalProfile) { + this.personalProfile = personalProfile; + } + + public String getNativeRegion() { + return this.nativeRegion; + } + + public void setNativeRegion(String nativeRegion) { + this.nativeRegion = nativeRegion; + } + + public Enum getHukouType() { + return this.hukouType; + } + + public void setHukouType(Enum hukouType) { + this.hukouType = hukouType; + } + + public String getHukouLocation() { + return this.hukouLocation; + } + + public void setHukouLocation(String hukouLocation) { + this.hukouLocation = hukouLocation; + } + + public String getTalentId() { + return this.talentId; + } + + public void setTalentId(String talentId) { + this.talentId = talentId; + } + + public CustomFieldData[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(CustomFieldData[] customFields) { + this.customFields = customFields; + } + + public String getNationalIdNumber() { + return this.nationalIdNumber; + } + + public void setNationalIdNumber(String nationalIdNumber) { + this.nationalIdNumber = nationalIdNumber; + } + + public String getFamilyAddress() { + return this.familyAddress; + } + + public void setFamilyAddress(String familyAddress) { + this.familyAddress = familyAddress; + } + + public PersonInfoChn[] getPersonInfoChns() { + return this.personInfoChns; + } + + public void setPersonInfoChns(PersonInfoChn[] personInfoChns) { + this.personInfoChns = personInfoChns; + } + + public String getBornCountryRegion() { + return this.bornCountryRegion; + } + + public void setBornCountryRegion(String bornCountryRegion) { + this.bornCountryRegion = bornCountryRegion; + } + + public Boolean getIsDisabled() { + return this.isDisabled; + } + + public void setIsDisabled(Boolean isDisabled) { + this.isDisabled = isDisabled; + } + + public String getDisableCardNumber() { + return this.disableCardNumber; + } + + public void setDisableCardNumber(String disableCardNumber) { + this.disableCardNumber = disableCardNumber; + } + + public Boolean getIsMartyrFamily() { + return this.isMartyrFamily; + } + + public void setIsMartyrFamily(Boolean isMartyrFamily) { + this.isMartyrFamily = isMartyrFamily; + } + + public String getMartyrCardNumber() { + return this.martyrCardNumber; + } + + public void setMartyrCardNumber(String martyrCardNumber) { + this.martyrCardNumber = martyrCardNumber; + } + + public Boolean getIsOldAlone() { + return this.isOldAlone; + } + + public void setIsOldAlone(Boolean isOldAlone) { + this.isOldAlone = isOldAlone; + } + + public ResidentTax[] getResidentTaxes() { + return this.residentTaxes; + } + + public void setResidentTaxes(ResidentTax[] residentTaxes) { + this.residentTaxes = residentTaxes; + } + + public String getFirstEntryTime() { + return this.firstEntryTime; + } + + public void setFirstEntryTime(String firstEntryTime) { + this.firstEntryTime = firstEntryTime; + } + + public String getLeaveTime() { + return this.leaveTime; + } + + public void setLeaveTime(String leaveTime) { + this.leaveTime = leaveTime; + } + + public Enum getReligion() { + return this.religion; + } + + public void setReligion(Enum religion) { + this.religion = religion; + } + + public static class Builder { + /** + * 个人信息 ID + *

示例值:6919733936050406926 + */ + private String personId; + /** + * 个人电话 + *

示例值:13649211111 + */ + private String phoneNumber; + /** + * 法定姓名 + *

示例值:张三 + */ + private String legalName; + /** + * 常用名 + *

示例值:刘梓新(Henry) + */ + private String preferredName; + /** + * 常用本地全名 + *

示例值:刘梓新 + */ + private String preferredLocalFullName; + /** + * 常用英文全名 + *

示例值:Henry + */ + private String preferredEnglishFullName; + /** + * 姓名列表 + *

示例值: + */ + private PersonName[] nameList; + /** + * -| 性别,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:gender - object_api_name:person + *

示例值: + */ + private Enum gender; + /** + * 出生日期 + *

示例值:2020-01-01 + */ + private String dateOfBirth; + /** + * -| 民族 / 种族,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:ethnicity_race - object_api_name:person + *

示例值: + */ + private Enum race; + /** + * -| 婚姻状况,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:marital_status - object_api_name:person + *

示例值: + */ + private Enum maritalStatus; + /** + * 电话列表,只有当满足下面所有条件时,电话在个人信息页才可见 + *

示例值: + */ + private Phone[] phoneList; + /** + * 地址列表 + *

示例值: + */ + private Address[] addressList; + /** + * 邮箱列表 + *

示例值: + */ + private Email[] emailList; + /** + * 工作经历列表 + *

示例值: + */ + private WorkExperienceInfo[] workExperienceList; + /** + * 教育经历列表 + *

示例值: + */ + private Education[] educationList; + /** + * 银行账户 + *

示例值: + */ + private BankAccount[] bankAccountList; + /** + * 证件 + *

示例值: + */ + private NationalId[] nationalIdList; + /** + * 家庭成员列表 + *

示例值: + */ + private Dependent[] dependentList; + /** + * 紧急联系人列表 + *

示例值: + */ + private EmergencyContact[] emergencyContactList; + /** + * 参加工作日期 + *

示例值:2020-10-01 + */ + private String dateEnteredWorkforce; + /** + * 工龄 + *

示例值:2 + */ + private Integer workingYears; + /** + * 头像资源的 ID + *

示例值:dfysuc8x76dsfsw + */ + private String profileImageId; + /** + * 邮箱地址 + *

示例值:test@163.com + */ + private String emailAddress; + /** + * 年龄 + *

示例值:22 + */ + private Integer age; + /** + * 最高学历教育经历 + *

示例值: + */ + private Education highestLevelOfEducation; + /** + * 最高学位教育经历 + *

示例值: + */ + private Education highestDegreeOfEducation; + /** + * 个人资料附件 + *

示例值: + */ + private PersonalProfile[] personalProfile; + /** + * 籍贯 ID + *

示例值:6863326262618752111 + */ + private String nativeRegion; + /** + * 户口类型,枚举值可通过文档【飞书人事枚举常量】户口类型(hukou_type)枚举定义部分获得 + *

示例值: + */ + private Enum hukouType; + /** + * 户口所在地 + *

示例值:山东省平阴县 + */ + private String hukouLocation; + /** + * 人才 ID + *

示例值:6863326262618752123 + */ + private String talentId; + /** + * 自定义字段 + *

示例值: + */ + private CustomFieldData[] customFields; + /** + * 居民身份证件号码 + *

示例值:11010000000000 + */ + private String nationalIdNumber; + /** + * 家庭地址 + *

示例值:6863326262618752123 + */ + private String familyAddress; + /** + * 个人附加信息 + *

示例值:6863326262618752123 + */ + private PersonInfoChn[] personInfoChns; + /** + * 出生国家/地区 + *

示例值:中国 + */ + private String bornCountryRegion; + /** + * 是否残疾 + *

示例值:true + */ + private Boolean isDisabled; + /** + * 残疾证号 + *

示例值:1110000 + */ + private String disableCardNumber; + /** + * 是否烈属 + *

示例值:true + */ + private Boolean isMartyrFamily; + /** + * 烈属证号 + *

示例值:1110000 + */ + private String martyrCardNumber; + /** + * 是否孤老 + *

示例值:true + */ + private Boolean isOldAlone; + /** + * 居民身份信息 + *

示例值:6863326262618752123 + */ + private ResidentTax[] residentTaxes; + /** + * 首次入境日期 + *

示例值:2021-01-02 + */ + private String firstEntryTime; + /** + * 预计离境日期 + *

示例值:2022-01-02 + */ + private String leaveTime; + /** + * -| 宗教信仰,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name:person - custom_api_name:religion + *

示例值: + */ + private Enum religion; + + /** + * 个人信息 ID + *

示例值:6919733936050406926 + * + * @param personId + * @return + */ + public Builder personId(String personId) { + this.personId = personId; + return this; + } + + + /** + * 个人电话 + *

示例值:13649211111 + * + * @param phoneNumber + * @return + */ + public Builder phoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + + /** + * 法定姓名 + *

示例值:张三 + * + * @param legalName + * @return + */ + public Builder legalName(String legalName) { + this.legalName = legalName; + return this; + } + + + /** + * 常用名 + *

示例值:刘梓新(Henry) + * + * @param preferredName + * @return + */ + public Builder preferredName(String preferredName) { + this.preferredName = preferredName; + return this; + } + + + /** + * 常用本地全名 + *

示例值:刘梓新 + * + * @param preferredLocalFullName + * @return + */ + public Builder preferredLocalFullName(String preferredLocalFullName) { + this.preferredLocalFullName = preferredLocalFullName; + return this; + } + + + /** + * 常用英文全名 + *

示例值:Henry + * + * @param preferredEnglishFullName + * @return + */ + public Builder preferredEnglishFullName(String preferredEnglishFullName) { + this.preferredEnglishFullName = preferredEnglishFullName; + return this; + } + + + /** + * 姓名列表 + *

示例值: + * + * @param nameList + * @return + */ + public Builder nameList(PersonName[] nameList) { + this.nameList = nameList; + return this; + } + + + /** + * -| 性别,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:gender - object_api_name:person + *

示例值: + * + * @param gender + * @return + */ + public Builder gender(Enum gender) { + this.gender = gender; + return this; + } + + + /** + * 出生日期 + *

示例值:2020-01-01 + * + * @param dateOfBirth + * @return + */ + public Builder dateOfBirth(String dateOfBirth) { + this.dateOfBirth = dateOfBirth; + return this; + } + + + /** + * -| 民族 / 种族,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:ethnicity_race - object_api_name:person + *

示例值: + * + * @param race + * @return + */ + public Builder race(Enum race) { + this.race = race; + return this; + } + + + /** + * -| 婚姻状况,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:marital_status - object_api_name:person + *

示例值: + * + * @param maritalStatus + * @return + */ + public Builder maritalStatus(Enum maritalStatus) { + this.maritalStatus = maritalStatus; + return this; + } + + + /** + * 电话列表,只有当满足下面所有条件时,电话在个人信息页才可见 + *

示例值: + * + * @param phoneList + * @return + */ + public Builder phoneList(Phone[] phoneList) { + this.phoneList = phoneList; + return this; + } + + + /** + * 地址列表 + *

示例值: + * + * @param addressList + * @return + */ + public Builder addressList(Address[] addressList) { + this.addressList = addressList; + return this; + } + + + /** + * 邮箱列表 + *

示例值: + * + * @param emailList + * @return + */ + public Builder emailList(Email[] emailList) { + this.emailList = emailList; + return this; + } + + + /** + * 工作经历列表 + *

示例值: + * + * @param workExperienceList + * @return + */ + public Builder workExperienceList(WorkExperienceInfo[] workExperienceList) { + this.workExperienceList = workExperienceList; + return this; + } + + + /** + * 教育经历列表 + *

示例值: + * + * @param educationList + * @return + */ + public Builder educationList(Education[] educationList) { + this.educationList = educationList; + return this; + } + + + /** + * 银行账户 + *

示例值: + * + * @param bankAccountList + * @return + */ + public Builder bankAccountList(BankAccount[] bankAccountList) { + this.bankAccountList = bankAccountList; + return this; + } + + + /** + * 证件 + *

示例值: + * + * @param nationalIdList + * @return + */ + public Builder nationalIdList(NationalId[] nationalIdList) { + this.nationalIdList = nationalIdList; + return this; + } + + + /** + * 家庭成员列表 + *

示例值: + * + * @param dependentList + * @return + */ + public Builder dependentList(Dependent[] dependentList) { + this.dependentList = dependentList; + return this; + } + + + /** + * 紧急联系人列表 + *

示例值: + * + * @param emergencyContactList + * @return + */ + public Builder emergencyContactList(EmergencyContact[] emergencyContactList) { + this.emergencyContactList = emergencyContactList; + return this; + } + + + /** + * 参加工作日期 + *

示例值:2020-10-01 + * + * @param dateEnteredWorkforce + * @return + */ + public Builder dateEnteredWorkforce(String dateEnteredWorkforce) { + this.dateEnteredWorkforce = dateEnteredWorkforce; + return this; + } + + + /** + * 工龄 + *

示例值:2 + * + * @param workingYears + * @return + */ + public Builder workingYears(Integer workingYears) { + this.workingYears = workingYears; + return this; + } + + + /** + * 头像资源的 ID + *

示例值:dfysuc8x76dsfsw + * + * @param profileImageId + * @return + */ + public Builder profileImageId(String profileImageId) { + this.profileImageId = profileImageId; + return this; + } + + + /** + * 邮箱地址 + *

示例值:test@163.com + * + * @param emailAddress + * @return + */ + public Builder emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + + /** + * 年龄 + *

示例值:22 + * + * @param age + * @return + */ + public Builder age(Integer age) { + this.age = age; + return this; + } + + + /** + * 最高学历教育经历 + *

示例值: + * + * @param highestLevelOfEducation + * @return + */ + public Builder highestLevelOfEducation(Education highestLevelOfEducation) { + this.highestLevelOfEducation = highestLevelOfEducation; + return this; + } + + + /** + * 最高学位教育经历 + *

示例值: + * + * @param highestDegreeOfEducation + * @return + */ + public Builder highestDegreeOfEducation(Education highestDegreeOfEducation) { + this.highestDegreeOfEducation = highestDegreeOfEducation; + return this; + } + + + /** + * 个人资料附件 + *

示例值: + * + * @param personalProfile + * @return + */ + public Builder personalProfile(PersonalProfile[] personalProfile) { + this.personalProfile = personalProfile; + return this; + } + + + /** + * 籍贯 ID + *

示例值:6863326262618752111 + * + * @param nativeRegion + * @return + */ + public Builder nativeRegion(String nativeRegion) { + this.nativeRegion = nativeRegion; + return this; + } + + + /** + * 户口类型,枚举值可通过文档【飞书人事枚举常量】户口类型(hukou_type)枚举定义部分获得 + *

示例值: + * + * @param hukouType + * @return + */ + public Builder hukouType(Enum hukouType) { + this.hukouType = hukouType; + return this; + } + + + /** + * 户口所在地 + *

示例值:山东省平阴县 + * + * @param hukouLocation + * @return + */ + public Builder hukouLocation(String hukouLocation) { + this.hukouLocation = hukouLocation; + return this; + } + + + /** + * 人才 ID + *

示例值:6863326262618752123 + * + * @param talentId + * @return + */ + public Builder talentId(String talentId) { + this.talentId = talentId; + return this; + } + + + /** + * 自定义字段 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(CustomFieldData[] customFields) { + this.customFields = customFields; + return this; + } + + + /** + * 居民身份证件号码 + *

示例值:11010000000000 + * + * @param nationalIdNumber + * @return + */ + public Builder nationalIdNumber(String nationalIdNumber) { + this.nationalIdNumber = nationalIdNumber; + return this; + } + + + /** + * 家庭地址 + *

示例值:6863326262618752123 + * + * @param familyAddress + * @return + */ + public Builder familyAddress(String familyAddress) { + this.familyAddress = familyAddress; + return this; + } + + + /** + * 个人附加信息 + *

示例值:6863326262618752123 + * + * @param personInfoChns + * @return + */ + public Builder personInfoChns(PersonInfoChn[] personInfoChns) { + this.personInfoChns = personInfoChns; + return this; + } + + + /** + * 出生国家/地区 + *

示例值:中国 + * + * @param bornCountryRegion + * @return + */ + public Builder bornCountryRegion(String bornCountryRegion) { + this.bornCountryRegion = bornCountryRegion; + return this; + } + + + /** + * 是否残疾 + *

示例值:true + * + * @param isDisabled + * @return + */ + public Builder isDisabled(Boolean isDisabled) { + this.isDisabled = isDisabled; + return this; + } + + + /** + * 残疾证号 + *

示例值:1110000 + * + * @param disableCardNumber + * @return + */ + public Builder disableCardNumber(String disableCardNumber) { + this.disableCardNumber = disableCardNumber; + return this; + } + + + /** + * 是否烈属 + *

示例值:true + * + * @param isMartyrFamily + * @return + */ + public Builder isMartyrFamily(Boolean isMartyrFamily) { + this.isMartyrFamily = isMartyrFamily; + return this; + } + + + /** + * 烈属证号 + *

示例值:1110000 + * + * @param martyrCardNumber + * @return + */ + public Builder martyrCardNumber(String martyrCardNumber) { + this.martyrCardNumber = martyrCardNumber; + return this; + } + + + /** + * 是否孤老 + *

示例值:true + * + * @param isOldAlone + * @return + */ + public Builder isOldAlone(Boolean isOldAlone) { + this.isOldAlone = isOldAlone; + return this; + } + + + /** + * 居民身份信息 + *

示例值:6863326262618752123 + * + * @param residentTaxes + * @return + */ + public Builder residentTaxes(ResidentTax[] residentTaxes) { + this.residentTaxes = residentTaxes; + return this; + } + + + /** + * 首次入境日期 + *

示例值:2021-01-02 + * + * @param firstEntryTime + * @return + */ + public Builder firstEntryTime(String firstEntryTime) { + this.firstEntryTime = firstEntryTime; + return this; + } + + + /** + * 预计离境日期 + *

示例值:2022-01-02 + * + * @param leaveTime + * @return + */ + public Builder leaveTime(String leaveTime) { + this.leaveTime = leaveTime; + return this; + } + + + /** + * -| 宗教信仰,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name:person - custom_api_name:religion + *

示例值: + * + * @param religion + * @return + */ + public Builder religion(Enum religion) { + this.religion = religion; + return this; + } + + + public PersonInfo build() { + return new PersonInfo(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PersonInfoChn.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PersonInfoChn.java new file mode 100644 index 000000000..a5e278455 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PersonInfoChn.java @@ -0,0 +1,222 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PersonInfoChn { + /** + * 籍贯 ID + *

示例值:6863326262618752111 + */ + @SerializedName("native_region") + private String nativeRegion; + /** + * -| 户口类型,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:hukou_type - object_api_name:person_info_chn + *

示例值: + */ + @SerializedName("hukou_type") + private Enum hukouType; + /** + * 户口所在地 + *

示例值:山东省平阴县 + */ + @SerializedName("hukou_location") + private String hukouLocation; + /** + * 首次入境日期 + *

示例值:2023-07-09 + */ + @SerializedName("first_entry_time") + private String firstEntryTime; + /** + * 预计离境日期 + *

示例值:2023-07-09 + */ + @SerializedName("leave_time") + private String leaveTime; + + // builder 开始 + public PersonInfoChn() { + } + + public PersonInfoChn(Builder builder) { + /** + * 籍贯 ID + *

示例值:6863326262618752111 + */ + this.nativeRegion = builder.nativeRegion; + /** + * -| 户口类型,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:hukou_type - object_api_name:person_info_chn + *

示例值: + */ + this.hukouType = builder.hukouType; + /** + * 户口所在地 + *

示例值:山东省平阴县 + */ + this.hukouLocation = builder.hukouLocation; + /** + * 首次入境日期 + *

示例值:2023-07-09 + */ + this.firstEntryTime = builder.firstEntryTime; + /** + * 预计离境日期 + *

示例值:2023-07-09 + */ + this.leaveTime = builder.leaveTime; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getNativeRegion() { + return this.nativeRegion; + } + + public void setNativeRegion(String nativeRegion) { + this.nativeRegion = nativeRegion; + } + + public Enum getHukouType() { + return this.hukouType; + } + + public void setHukouType(Enum hukouType) { + this.hukouType = hukouType; + } + + public String getHukouLocation() { + return this.hukouLocation; + } + + public void setHukouLocation(String hukouLocation) { + this.hukouLocation = hukouLocation; + } + + public String getFirstEntryTime() { + return this.firstEntryTime; + } + + public void setFirstEntryTime(String firstEntryTime) { + this.firstEntryTime = firstEntryTime; + } + + public String getLeaveTime() { + return this.leaveTime; + } + + public void setLeaveTime(String leaveTime) { + this.leaveTime = leaveTime; + } + + public static class Builder { + /** + * 籍贯 ID + *

示例值:6863326262618752111 + */ + private String nativeRegion; + /** + * -| 户口类型,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:hukou_type - object_api_name:person_info_chn + *

示例值: + */ + private Enum hukouType; + /** + * 户口所在地 + *

示例值:山东省平阴县 + */ + private String hukouLocation; + /** + * 首次入境日期 + *

示例值:2023-07-09 + */ + private String firstEntryTime; + /** + * 预计离境日期 + *

示例值:2023-07-09 + */ + private String leaveTime; + + /** + * 籍贯 ID + *

示例值:6863326262618752111 + * + * @param nativeRegion + * @return + */ + public Builder nativeRegion(String nativeRegion) { + this.nativeRegion = nativeRegion; + return this; + } + + + /** + * -| 户口类型,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:hukou_type - object_api_name:person_info_chn + *

示例值: + * + * @param hukouType + * @return + */ + public Builder hukouType(Enum hukouType) { + this.hukouType = hukouType; + return this; + } + + + /** + * 户口所在地 + *

示例值:山东省平阴县 + * + * @param hukouLocation + * @return + */ + public Builder hukouLocation(String hukouLocation) { + this.hukouLocation = hukouLocation; + return this; + } + + + /** + * 首次入境日期 + *

示例值:2023-07-09 + * + * @param firstEntryTime + * @return + */ + public Builder firstEntryTime(String firstEntryTime) { + this.firstEntryTime = firstEntryTime; + return this; + } + + + /** + * 预计离境日期 + *

示例值:2023-07-09 + * + * @param leaveTime + * @return + */ + public Builder leaveTime(String leaveTime) { + this.leaveTime = leaveTime; + return this; + } + + + public PersonInfoChn build() { + return new PersonInfoChn(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PersonName.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PersonName.java new file mode 100644 index 000000000..5af8ca908 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PersonName.java @@ -0,0 +1,888 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PersonName { + /** + * 姓 - 本地文字 + *

示例值:黄 + */ + @SerializedName("local_primary") + private String localPrimary; + /** + * 名 - 本地文字 + *

示例值:四 + */ + @SerializedName("local_first_name") + private String localFirstName; + /** + * 国家 / 地区 + *

示例值:6862995757234914824 + */ + @SerializedName("country_region_id") + private String countryRegionId; + /** + * 姓名类型 + *

示例值: + */ + @SerializedName("name_type") + private Enum nameType; + /** + * 名 - 第二本地文字 + *

示例值:五 + */ + @SerializedName("local_first_name_2") + private String localFirstName2; + /** + * 姓 - 第二本地文字 + *

示例值:王 + */ + @SerializedName("local_primary_2") + private String localPrimary2; + /** + * 补充姓名类型 + *

示例值: + */ + @SerializedName("additional_name_type") + private Enum additionalNameType; + /** + * 名 + *

示例值:帅 + */ + @SerializedName("first_name") + private String firstName; + /** + * 全名 + *

示例值:王大帅 + */ + @SerializedName("full_name") + private String fullName; + /** + * 姓氏称谓 + *

示例值:王 + */ + @SerializedName("hereditary") + private String hereditary; + /** + * 自定义姓名(未传入时,姓名将默认根据所属国家 / 地区规则对相关姓、名字段拼接) + *

示例值:王大帅 + */ + @SerializedName("custom_name") + private String customName; + /** + * 本地文字的自定义姓名(未传入时,本地文字的姓名将默认根据所属国家 / 地区规则对本地文字的相关姓、名字段拼接) + *

示例值:王大帅 + */ + @SerializedName("custom_local_name") + private String customLocalName; + /** + * 中间名 + *

示例值:大 + */ + @SerializedName("middle_name") + private String middleName; + /** + * 姓 + *

示例值:王 + */ + @SerializedName("name_primary") + private String namePrimary; + /** + * 第二姓氏 + *

示例值:王 + */ + @SerializedName("secondary") + private String secondary; + /** + * 尊称 + *

示例值:王大帅 + */ + @SerializedName("social") + private Enum social; + /** + * 婚后姓氏 + *

示例值:王 + */ + @SerializedName("tertiary") + private String tertiary; + /** + * 头衔 + *

示例值:王 + */ + @SerializedName("title") + private Enum title; + /** + * 本地中间名 + *

示例值:大 + */ + @SerializedName("local_middle_name") + private String localMiddleName; + /** + * 第二姓氏 - 本地文字 + *

示例值:王 + */ + @SerializedName("local_secondary") + private String localSecondary; + /** + * 展示姓名(本地和西方文字) + *

示例值:王大帅 + */ + @SerializedName("display_name_local_and_western_script") + private String displayNameLocalAndWesternScript; + /** + * 展示姓名(本地文字) + *

示例值:王大帅 + */ + @SerializedName("display_name_local_script") + private String displayNameLocalScript; + /** + * 展示姓名(西方文字) + *

示例值:王大帅 + */ + @SerializedName("display_name_western_script") + private String displayNameWesternScript; + + // builder 开始 + public PersonName() { + } + + public PersonName(Builder builder) { + /** + * 姓 - 本地文字 + *

示例值:黄 + */ + this.localPrimary = builder.localPrimary; + /** + * 名 - 本地文字 + *

示例值:四 + */ + this.localFirstName = builder.localFirstName; + /** + * 国家 / 地区 + *

示例值:6862995757234914824 + */ + this.countryRegionId = builder.countryRegionId; + /** + * 姓名类型 + *

示例值: + */ + this.nameType = builder.nameType; + /** + * 名 - 第二本地文字 + *

示例值:五 + */ + this.localFirstName2 = builder.localFirstName2; + /** + * 姓 - 第二本地文字 + *

示例值:王 + */ + this.localPrimary2 = builder.localPrimary2; + /** + * 补充姓名类型 + *

示例值: + */ + this.additionalNameType = builder.additionalNameType; + /** + * 名 + *

示例值:帅 + */ + this.firstName = builder.firstName; + /** + * 全名 + *

示例值:王大帅 + */ + this.fullName = builder.fullName; + /** + * 姓氏称谓 + *

示例值:王 + */ + this.hereditary = builder.hereditary; + /** + * 自定义姓名(未传入时,姓名将默认根据所属国家 / 地区规则对相关姓、名字段拼接) + *

示例值:王大帅 + */ + this.customName = builder.customName; + /** + * 本地文字的自定义姓名(未传入时,本地文字的姓名将默认根据所属国家 / 地区规则对本地文字的相关姓、名字段拼接) + *

示例值:王大帅 + */ + this.customLocalName = builder.customLocalName; + /** + * 中间名 + *

示例值:大 + */ + this.middleName = builder.middleName; + /** + * 姓 + *

示例值:王 + */ + this.namePrimary = builder.namePrimary; + /** + * 第二姓氏 + *

示例值:王 + */ + this.secondary = builder.secondary; + /** + * 尊称 + *

示例值:王大帅 + */ + this.social = builder.social; + /** + * 婚后姓氏 + *

示例值:王 + */ + this.tertiary = builder.tertiary; + /** + * 头衔 + *

示例值:王 + */ + this.title = builder.title; + /** + * 本地中间名 + *

示例值:大 + */ + this.localMiddleName = builder.localMiddleName; + /** + * 第二姓氏 - 本地文字 + *

示例值:王 + */ + this.localSecondary = builder.localSecondary; + /** + * 展示姓名(本地和西方文字) + *

示例值:王大帅 + */ + this.displayNameLocalAndWesternScript = builder.displayNameLocalAndWesternScript; + /** + * 展示姓名(本地文字) + *

示例值:王大帅 + */ + this.displayNameLocalScript = builder.displayNameLocalScript; + /** + * 展示姓名(西方文字) + *

示例值:王大帅 + */ + this.displayNameWesternScript = builder.displayNameWesternScript; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getLocalPrimary() { + return this.localPrimary; + } + + public void setLocalPrimary(String localPrimary) { + this.localPrimary = localPrimary; + } + + public String getLocalFirstName() { + return this.localFirstName; + } + + public void setLocalFirstName(String localFirstName) { + this.localFirstName = localFirstName; + } + + public String getCountryRegionId() { + return this.countryRegionId; + } + + public void setCountryRegionId(String countryRegionId) { + this.countryRegionId = countryRegionId; + } + + public Enum getNameType() { + return this.nameType; + } + + public void setNameType(Enum nameType) { + this.nameType = nameType; + } + + public String getLocalFirstName2() { + return this.localFirstName2; + } + + public void setLocalFirstName2(String localFirstName2) { + this.localFirstName2 = localFirstName2; + } + + public String getLocalPrimary2() { + return this.localPrimary2; + } + + public void setLocalPrimary2(String localPrimary2) { + this.localPrimary2 = localPrimary2; + } + + public Enum getAdditionalNameType() { + return this.additionalNameType; + } + + public void setAdditionalNameType(Enum additionalNameType) { + this.additionalNameType = additionalNameType; + } + + public String getFirstName() { + return this.firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getFullName() { + return this.fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + public String getHereditary() { + return this.hereditary; + } + + public void setHereditary(String hereditary) { + this.hereditary = hereditary; + } + + public String getCustomName() { + return this.customName; + } + + public void setCustomName(String customName) { + this.customName = customName; + } + + public String getCustomLocalName() { + return this.customLocalName; + } + + public void setCustomLocalName(String customLocalName) { + this.customLocalName = customLocalName; + } + + public String getMiddleName() { + return this.middleName; + } + + public void setMiddleName(String middleName) { + this.middleName = middleName; + } + + public String getNamePrimary() { + return this.namePrimary; + } + + public void setNamePrimary(String namePrimary) { + this.namePrimary = namePrimary; + } + + public String getSecondary() { + return this.secondary; + } + + public void setSecondary(String secondary) { + this.secondary = secondary; + } + + public Enum getSocial() { + return this.social; + } + + public void setSocial(Enum social) { + this.social = social; + } + + public String getTertiary() { + return this.tertiary; + } + + public void setTertiary(String tertiary) { + this.tertiary = tertiary; + } + + public Enum getTitle() { + return this.title; + } + + public void setTitle(Enum title) { + this.title = title; + } + + public String getLocalMiddleName() { + return this.localMiddleName; + } + + public void setLocalMiddleName(String localMiddleName) { + this.localMiddleName = localMiddleName; + } + + public String getLocalSecondary() { + return this.localSecondary; + } + + public void setLocalSecondary(String localSecondary) { + this.localSecondary = localSecondary; + } + + public String getDisplayNameLocalAndWesternScript() { + return this.displayNameLocalAndWesternScript; + } + + public void setDisplayNameLocalAndWesternScript(String displayNameLocalAndWesternScript) { + this.displayNameLocalAndWesternScript = displayNameLocalAndWesternScript; + } + + public String getDisplayNameLocalScript() { + return this.displayNameLocalScript; + } + + public void setDisplayNameLocalScript(String displayNameLocalScript) { + this.displayNameLocalScript = displayNameLocalScript; + } + + public String getDisplayNameWesternScript() { + return this.displayNameWesternScript; + } + + public void setDisplayNameWesternScript(String displayNameWesternScript) { + this.displayNameWesternScript = displayNameWesternScript; + } + + public static class Builder { + /** + * 姓 - 本地文字 + *

示例值:黄 + */ + private String localPrimary; + /** + * 名 - 本地文字 + *

示例值:四 + */ + private String localFirstName; + /** + * 国家 / 地区 + *

示例值:6862995757234914824 + */ + private String countryRegionId; + /** + * 姓名类型 + *

示例值: + */ + private Enum nameType; + /** + * 名 - 第二本地文字 + *

示例值:五 + */ + private String localFirstName2; + /** + * 姓 - 第二本地文字 + *

示例值:王 + */ + private String localPrimary2; + /** + * 补充姓名类型 + *

示例值: + */ + private Enum additionalNameType; + /** + * 名 + *

示例值:帅 + */ + private String firstName; + /** + * 全名 + *

示例值:王大帅 + */ + private String fullName; + /** + * 姓氏称谓 + *

示例值:王 + */ + private String hereditary; + /** + * 自定义姓名(未传入时,姓名将默认根据所属国家 / 地区规则对相关姓、名字段拼接) + *

示例值:王大帅 + */ + private String customName; + /** + * 本地文字的自定义姓名(未传入时,本地文字的姓名将默认根据所属国家 / 地区规则对本地文字的相关姓、名字段拼接) + *

示例值:王大帅 + */ + private String customLocalName; + /** + * 中间名 + *

示例值:大 + */ + private String middleName; + /** + * 姓 + *

示例值:王 + */ + private String namePrimary; + /** + * 第二姓氏 + *

示例值:王 + */ + private String secondary; + /** + * 尊称 + *

示例值:王大帅 + */ + private Enum social; + /** + * 婚后姓氏 + *

示例值:王 + */ + private String tertiary; + /** + * 头衔 + *

示例值:王 + */ + private Enum title; + /** + * 本地中间名 + *

示例值:大 + */ + private String localMiddleName; + /** + * 第二姓氏 - 本地文字 + *

示例值:王 + */ + private String localSecondary; + /** + * 展示姓名(本地和西方文字) + *

示例值:王大帅 + */ + private String displayNameLocalAndWesternScript; + /** + * 展示姓名(本地文字) + *

示例值:王大帅 + */ + private String displayNameLocalScript; + /** + * 展示姓名(西方文字) + *

示例值:王大帅 + */ + private String displayNameWesternScript; + + /** + * 姓 - 本地文字 + *

示例值:黄 + * + * @param localPrimary + * @return + */ + public Builder localPrimary(String localPrimary) { + this.localPrimary = localPrimary; + return this; + } + + + /** + * 名 - 本地文字 + *

示例值:四 + * + * @param localFirstName + * @return + */ + public Builder localFirstName(String localFirstName) { + this.localFirstName = localFirstName; + return this; + } + + + /** + * 国家 / 地区 + *

示例值:6862995757234914824 + * + * @param countryRegionId + * @return + */ + public Builder countryRegionId(String countryRegionId) { + this.countryRegionId = countryRegionId; + return this; + } + + + /** + * 姓名类型 + *

示例值: + * + * @param nameType + * @return + */ + public Builder nameType(Enum nameType) { + this.nameType = nameType; + return this; + } + + + /** + * 名 - 第二本地文字 + *

示例值:五 + * + * @param localFirstName2 + * @return + */ + public Builder localFirstName2(String localFirstName2) { + this.localFirstName2 = localFirstName2; + return this; + } + + + /** + * 姓 - 第二本地文字 + *

示例值:王 + * + * @param localPrimary2 + * @return + */ + public Builder localPrimary2(String localPrimary2) { + this.localPrimary2 = localPrimary2; + return this; + } + + + /** + * 补充姓名类型 + *

示例值: + * + * @param additionalNameType + * @return + */ + public Builder additionalNameType(Enum additionalNameType) { + this.additionalNameType = additionalNameType; + return this; + } + + + /** + * 名 + *

示例值:帅 + * + * @param firstName + * @return + */ + public Builder firstName(String firstName) { + this.firstName = firstName; + return this; + } + + + /** + * 全名 + *

示例值:王大帅 + * + * @param fullName + * @return + */ + public Builder fullName(String fullName) { + this.fullName = fullName; + return this; + } + + + /** + * 姓氏称谓 + *

示例值:王 + * + * @param hereditary + * @return + */ + public Builder hereditary(String hereditary) { + this.hereditary = hereditary; + return this; + } + + + /** + * 自定义姓名(未传入时,姓名将默认根据所属国家 / 地区规则对相关姓、名字段拼接) + *

示例值:王大帅 + * + * @param customName + * @return + */ + public Builder customName(String customName) { + this.customName = customName; + return this; + } + + + /** + * 本地文字的自定义姓名(未传入时,本地文字的姓名将默认根据所属国家 / 地区规则对本地文字的相关姓、名字段拼接) + *

示例值:王大帅 + * + * @param customLocalName + * @return + */ + public Builder customLocalName(String customLocalName) { + this.customLocalName = customLocalName; + return this; + } + + + /** + * 中间名 + *

示例值:大 + * + * @param middleName + * @return + */ + public Builder middleName(String middleName) { + this.middleName = middleName; + return this; + } + + + /** + * 姓 + *

示例值:王 + * + * @param namePrimary + * @return + */ + public Builder namePrimary(String namePrimary) { + this.namePrimary = namePrimary; + return this; + } + + + /** + * 第二姓氏 + *

示例值:王 + * + * @param secondary + * @return + */ + public Builder secondary(String secondary) { + this.secondary = secondary; + return this; + } + + + /** + * 尊称 + *

示例值:王大帅 + * + * @param social + * @return + */ + public Builder social(Enum social) { + this.social = social; + return this; + } + + + /** + * 婚后姓氏 + *

示例值:王 + * + * @param tertiary + * @return + */ + public Builder tertiary(String tertiary) { + this.tertiary = tertiary; + return this; + } + + + /** + * 头衔 + *

示例值:王 + * + * @param title + * @return + */ + public Builder title(Enum title) { + this.title = title; + return this; + } + + + /** + * 本地中间名 + *

示例值:大 + * + * @param localMiddleName + * @return + */ + public Builder localMiddleName(String localMiddleName) { + this.localMiddleName = localMiddleName; + return this; + } + + + /** + * 第二姓氏 - 本地文字 + *

示例值:王 + * + * @param localSecondary + * @return + */ + public Builder localSecondary(String localSecondary) { + this.localSecondary = localSecondary; + return this; + } + + + /** + * 展示姓名(本地和西方文字) + *

示例值:王大帅 + * + * @param displayNameLocalAndWesternScript + * @return + */ + public Builder displayNameLocalAndWesternScript(String displayNameLocalAndWesternScript) { + this.displayNameLocalAndWesternScript = displayNameLocalAndWesternScript; + return this; + } + + + /** + * 展示姓名(本地文字) + *

示例值:王大帅 + * + * @param displayNameLocalScript + * @return + */ + public Builder displayNameLocalScript(String displayNameLocalScript) { + this.displayNameLocalScript = displayNameLocalScript; + return this; + } + + + /** + * 展示姓名(西方文字) + *

示例值:王大帅 + * + * @param displayNameWesternScript + * @return + */ + public Builder displayNameWesternScript(String displayNameWesternScript) { + this.displayNameWesternScript = displayNameWesternScript; + return this; + } + + + public PersonName build() { + return new PersonName(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PersonalProfile.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PersonalProfile.java new file mode 100644 index 000000000..7626f2173 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PersonalProfile.java @@ -0,0 +1,148 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PersonalProfile { + /** + * 个人资料 ID + *

示例值:150018109586e8ea745e47ae8feb3722dbe1d03a181336393633393133303431393831343930373235150200 + */ + @SerializedName("personal_profile_id") + private String personalProfileId; + /** + * 资料类型 + *

示例值: + */ + @SerializedName("personal_profile_type") + private Enum personalProfileType; + /** + * 上传文件列表 + *

示例值: + */ + @SerializedName("files") + private File[] files; + + // builder 开始 + public PersonalProfile() { + } + + public PersonalProfile(Builder builder) { + /** + * 个人资料 ID + *

示例值:150018109586e8ea745e47ae8feb3722dbe1d03a181336393633393133303431393831343930373235150200 + */ + this.personalProfileId = builder.personalProfileId; + /** + * 资料类型 + *

示例值: + */ + this.personalProfileType = builder.personalProfileType; + /** + * 上传文件列表 + *

示例值: + */ + this.files = builder.files; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getPersonalProfileId() { + return this.personalProfileId; + } + + public void setPersonalProfileId(String personalProfileId) { + this.personalProfileId = personalProfileId; + } + + public Enum getPersonalProfileType() { + return this.personalProfileType; + } + + public void setPersonalProfileType(Enum personalProfileType) { + this.personalProfileType = personalProfileType; + } + + public File[] getFiles() { + return this.files; + } + + public void setFiles(File[] files) { + this.files = files; + } + + public static class Builder { + /** + * 个人资料 ID + *

示例值:150018109586e8ea745e47ae8feb3722dbe1d03a181336393633393133303431393831343930373235150200 + */ + private String personalProfileId; + /** + * 资料类型 + *

示例值: + */ + private Enum personalProfileType; + /** + * 上传文件列表 + *

示例值: + */ + private File[] files; + + /** + * 个人资料 ID + *

示例值:150018109586e8ea745e47ae8feb3722dbe1d03a181336393633393133303431393831343930373235150200 + * + * @param personalProfileId + * @return + */ + public Builder personalProfileId(String personalProfileId) { + this.personalProfileId = personalProfileId; + return this; + } + + + /** + * 资料类型 + *

示例值: + * + * @param personalProfileType + * @return + */ + public Builder personalProfileType(Enum personalProfileType) { + this.personalProfileType = personalProfileType; + return this; + } + + + /** + * 上传文件列表 + *

示例值: + * + * @param files + * @return + */ + public Builder files(File[] files) { + this.files = files; + return this; + } + + + public PersonalProfile build() { + return new PersonalProfile(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Phone.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Phone.java new file mode 100644 index 000000000..c41935067 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/Phone.java @@ -0,0 +1,296 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Phone { + /** + * 国家区号 + *

示例值: + */ + @SerializedName("international_area_code") + private Enum internationalAreaCode; + /** + * 电话号码 + *

示例值:010-12345678 + */ + @SerializedName("phone_number") + private String phoneNumber; + /** + * 完整电话号码 + *

示例值:+86 010-12345678 + */ + @SerializedName("formatted_phone_number") + private String formattedPhoneNumber; + /** + * 设备类型 + *

示例值: + */ + @SerializedName("device_type") + private Enum deviceType; + /** + * 电话用途 + *

示例值: + */ + @SerializedName("phone_usage") + private Enum phoneUsage; + /** + * 主要电话 + *

示例值:true + */ + @SerializedName("is_primary") + private Boolean isPrimary; + /** + * 公开电话 + *

示例值:true + */ + @SerializedName("is_public") + private Boolean isPublic; + + // builder 开始 + public Phone() { + } + + public Phone(Builder builder) { + /** + * 国家区号 + *

示例值: + */ + this.internationalAreaCode = builder.internationalAreaCode; + /** + * 电话号码 + *

示例值:010-12345678 + */ + this.phoneNumber = builder.phoneNumber; + /** + * 完整电话号码 + *

示例值:+86 010-12345678 + */ + this.formattedPhoneNumber = builder.formattedPhoneNumber; + /** + * 设备类型 + *

示例值: + */ + this.deviceType = builder.deviceType; + /** + * 电话用途 + *

示例值: + */ + this.phoneUsage = builder.phoneUsage; + /** + * 主要电话 + *

示例值:true + */ + this.isPrimary = builder.isPrimary; + /** + * 公开电话 + *

示例值:true + */ + this.isPublic = builder.isPublic; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Enum getInternationalAreaCode() { + return this.internationalAreaCode; + } + + public void setInternationalAreaCode(Enum internationalAreaCode) { + this.internationalAreaCode = internationalAreaCode; + } + + public String getPhoneNumber() { + return this.phoneNumber; + } + + public void setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + public String getFormattedPhoneNumber() { + return this.formattedPhoneNumber; + } + + public void setFormattedPhoneNumber(String formattedPhoneNumber) { + this.formattedPhoneNumber = formattedPhoneNumber; + } + + public Enum getDeviceType() { + return this.deviceType; + } + + public void setDeviceType(Enum deviceType) { + this.deviceType = deviceType; + } + + public Enum getPhoneUsage() { + return this.phoneUsage; + } + + public void setPhoneUsage(Enum phoneUsage) { + this.phoneUsage = phoneUsage; + } + + public Boolean getIsPrimary() { + return this.isPrimary; + } + + public void setIsPrimary(Boolean isPrimary) { + this.isPrimary = isPrimary; + } + + public Boolean getIsPublic() { + return this.isPublic; + } + + public void setIsPublic(Boolean isPublic) { + this.isPublic = isPublic; + } + + public static class Builder { + /** + * 国家区号 + *

示例值: + */ + private Enum internationalAreaCode; + /** + * 电话号码 + *

示例值:010-12345678 + */ + private String phoneNumber; + /** + * 完整电话号码 + *

示例值:+86 010-12345678 + */ + private String formattedPhoneNumber; + /** + * 设备类型 + *

示例值: + */ + private Enum deviceType; + /** + * 电话用途 + *

示例值: + */ + private Enum phoneUsage; + /** + * 主要电话 + *

示例值:true + */ + private Boolean isPrimary; + /** + * 公开电话 + *

示例值:true + */ + private Boolean isPublic; + + /** + * 国家区号 + *

示例值: + * + * @param internationalAreaCode + * @return + */ + public Builder internationalAreaCode(Enum internationalAreaCode) { + this.internationalAreaCode = internationalAreaCode; + return this; + } + + + /** + * 电话号码 + *

示例值:010-12345678 + * + * @param phoneNumber + * @return + */ + public Builder phoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + + /** + * 完整电话号码 + *

示例值:+86 010-12345678 + * + * @param formattedPhoneNumber + * @return + */ + public Builder formattedPhoneNumber(String formattedPhoneNumber) { + this.formattedPhoneNumber = formattedPhoneNumber; + return this; + } + + + /** + * 设备类型 + *

示例值: + * + * @param deviceType + * @return + */ + public Builder deviceType(Enum deviceType) { + this.deviceType = deviceType; + return this; + } + + + /** + * 电话用途 + *

示例值: + * + * @param phoneUsage + * @return + */ + public Builder phoneUsage(Enum phoneUsage) { + this.phoneUsage = phoneUsage; + return this; + } + + + /** + * 主要电话 + *

示例值:true + * + * @param isPrimary + * @return + */ + public Builder isPrimary(Boolean isPrimary) { + this.isPrimary = isPrimary; + return this; + } + + + /** + * 公开电话 + *

示例值:true + * + * @param isPublic + * @return + */ + public Builder isPublic(Boolean isPublic) { + this.isPublic = isPublic; + return this; + } + + + public Phone build() { + return new Phone(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PhoneNumberAndAreaCode.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PhoneNumberAndAreaCode.java new file mode 100644 index 000000000..57e871afb --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PhoneNumberAndAreaCode.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PhoneNumberAndAreaCode { + /** + * 区号 + *

示例值:123123 + */ + @SerializedName("area_code") + private Enum areaCode; + /** + * 号码 + *

示例值:213213 + */ + @SerializedName("phone_number") + private String phoneNumber; + + // builder 开始 + public PhoneNumberAndAreaCode() { + } + + public PhoneNumberAndAreaCode(Builder builder) { + /** + * 区号 + *

示例值:123123 + */ + this.areaCode = builder.areaCode; + /** + * 号码 + *

示例值:213213 + */ + this.phoneNumber = builder.phoneNumber; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Enum getAreaCode() { + return this.areaCode; + } + + public void setAreaCode(Enum areaCode) { + this.areaCode = areaCode; + } + + public String getPhoneNumber() { + return this.phoneNumber; + } + + public void setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + public static class Builder { + /** + * 区号 + *

示例值:123123 + */ + private Enum areaCode; + /** + * 号码 + *

示例值:213213 + */ + private String phoneNumber; + + /** + * 区号 + *

示例值:123123 + * + * @param areaCode + * @return + */ + public Builder areaCode(Enum areaCode) { + this.areaCode = areaCode; + return this; + } + + + /** + * 号码 + *

示例值:213213 + * + * @param phoneNumber + * @return + */ + public Builder phoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + + public PhoneNumberAndAreaCode build() { + return new PhoneNumberAndAreaCode(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PreHire.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PreHire.java new file mode 100644 index 000000000..028bb0953 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PreHire.java @@ -0,0 +1,259 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PreHire { + /** + * 个人信息 + *

示例值: + */ + @SerializedName("person_info") + private PersonInfo personInfo; + /** + * 工作信息 + *

示例值: + */ + @SerializedName("employment_info") + private PreHireEmploymentInfo employmentInfo; + /** + * 入职信息 + *

示例值: + */ + @SerializedName("onboarding_info") + private PreHireOnboardingInfo onboardingInfo; + /** + * 试用期信息 + *

示例值: + */ + @SerializedName("probation_info") + private PreHireProbationInfo probationInfo; + /** + * 合同信息 + *

示例值: + */ + @SerializedName("contract_info") + private PreHireContractInfo contractInfo; + /** + * 待入职 id + *

示例值:7032210902531327521 + */ + @SerializedName("pre_hire_id") + private String preHireId; + + // builder 开始 + public PreHire() { + } + + public PreHire(Builder builder) { + /** + * 个人信息 + *

示例值: + */ + this.personInfo = builder.personInfo; + /** + * 工作信息 + *

示例值: + */ + this.employmentInfo = builder.employmentInfo; + /** + * 入职信息 + *

示例值: + */ + this.onboardingInfo = builder.onboardingInfo; + /** + * 试用期信息 + *

示例值: + */ + this.probationInfo = builder.probationInfo; + /** + * 合同信息 + *

示例值: + */ + this.contractInfo = builder.contractInfo; + /** + * 待入职 id + *

示例值:7032210902531327521 + */ + this.preHireId = builder.preHireId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public PersonInfo getPersonInfo() { + return this.personInfo; + } + + public void setPersonInfo(PersonInfo personInfo) { + this.personInfo = personInfo; + } + + public PreHireEmploymentInfo getEmploymentInfo() { + return this.employmentInfo; + } + + public void setEmploymentInfo(PreHireEmploymentInfo employmentInfo) { + this.employmentInfo = employmentInfo; + } + + public PreHireOnboardingInfo getOnboardingInfo() { + return this.onboardingInfo; + } + + public void setOnboardingInfo(PreHireOnboardingInfo onboardingInfo) { + this.onboardingInfo = onboardingInfo; + } + + public PreHireProbationInfo getProbationInfo() { + return this.probationInfo; + } + + public void setProbationInfo(PreHireProbationInfo probationInfo) { + this.probationInfo = probationInfo; + } + + public PreHireContractInfo getContractInfo() { + return this.contractInfo; + } + + public void setContractInfo(PreHireContractInfo contractInfo) { + this.contractInfo = contractInfo; + } + + public String getPreHireId() { + return this.preHireId; + } + + public void setPreHireId(String preHireId) { + this.preHireId = preHireId; + } + + public static class Builder { + /** + * 个人信息 + *

示例值: + */ + private PersonInfo personInfo; + /** + * 工作信息 + *

示例值: + */ + private PreHireEmploymentInfo employmentInfo; + /** + * 入职信息 + *

示例值: + */ + private PreHireOnboardingInfo onboardingInfo; + /** + * 试用期信息 + *

示例值: + */ + private PreHireProbationInfo probationInfo; + /** + * 合同信息 + *

示例值: + */ + private PreHireContractInfo contractInfo; + /** + * 待入职 id + *

示例值:7032210902531327521 + */ + private String preHireId; + + /** + * 个人信息 + *

示例值: + * + * @param personInfo + * @return + */ + public Builder personInfo(PersonInfo personInfo) { + this.personInfo = personInfo; + return this; + } + + + /** + * 工作信息 + *

示例值: + * + * @param employmentInfo + * @return + */ + public Builder employmentInfo(PreHireEmploymentInfo employmentInfo) { + this.employmentInfo = employmentInfo; + return this; + } + + + /** + * 入职信息 + *

示例值: + * + * @param onboardingInfo + * @return + */ + public Builder onboardingInfo(PreHireOnboardingInfo onboardingInfo) { + this.onboardingInfo = onboardingInfo; + return this; + } + + + /** + * 试用期信息 + *

示例值: + * + * @param probationInfo + * @return + */ + public Builder probationInfo(PreHireProbationInfo probationInfo) { + this.probationInfo = probationInfo; + return this; + } + + + /** + * 合同信息 + *

示例值: + * + * @param contractInfo + * @return + */ + public Builder contractInfo(PreHireContractInfo contractInfo) { + this.contractInfo = contractInfo; + return this; + } + + + /** + * 待入职 id + *

示例值:7032210902531327521 + * + * @param preHireId + * @return + */ + public Builder preHireId(String preHireId) { + this.preHireId = preHireId; + return this; + } + + + public PreHire build() { + return new PreHire(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PreHireContractInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PreHireContractInfo.java new file mode 100644 index 000000000..8b04777e2 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PreHireContractInfo.java @@ -0,0 +1,222 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PreHireContractInfo { + /** + * 合同开始日期 + *

示例值:2022-10-08 + */ + @SerializedName("contract_start_date") + private String contractStartDate; + /** + * 合同结束日期 + *

示例值:2025-10-07 + */ + @SerializedName("contract_end_date") + private String contractEndDate; + /** + * -| 合同类型,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name = "pre_hire" - custom_api_name = "contract_type" + *

示例值:labor_contract + */ + @SerializedName("contract_type") + private String contractType; + /** + * -| 期限类型,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name = "pre_hire" - custom_api_name = "duration_type" + *

示例值:fixed_term + */ + @SerializedName("duration_type") + private String durationType; + /** + * -| 签订类型,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name = "pre_hire" - custom_api_name = "duration_type" + *

示例值:renewed + */ + @SerializedName("signing_type") + private String signingType; + + // builder 开始 + public PreHireContractInfo() { + } + + public PreHireContractInfo(Builder builder) { + /** + * 合同开始日期 + *

示例值:2022-10-08 + */ + this.contractStartDate = builder.contractStartDate; + /** + * 合同结束日期 + *

示例值:2025-10-07 + */ + this.contractEndDate = builder.contractEndDate; + /** + * -| 合同类型,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name = "pre_hire" - custom_api_name = "contract_type" + *

示例值:labor_contract + */ + this.contractType = builder.contractType; + /** + * -| 期限类型,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name = "pre_hire" - custom_api_name = "duration_type" + *

示例值:fixed_term + */ + this.durationType = builder.durationType; + /** + * -| 签订类型,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name = "pre_hire" - custom_api_name = "duration_type" + *

示例值:renewed + */ + this.signingType = builder.signingType; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getContractStartDate() { + return this.contractStartDate; + } + + public void setContractStartDate(String contractStartDate) { + this.contractStartDate = contractStartDate; + } + + public String getContractEndDate() { + return this.contractEndDate; + } + + public void setContractEndDate(String contractEndDate) { + this.contractEndDate = contractEndDate; + } + + public String getContractType() { + return this.contractType; + } + + public void setContractType(String contractType) { + this.contractType = contractType; + } + + public String getDurationType() { + return this.durationType; + } + + public void setDurationType(String durationType) { + this.durationType = durationType; + } + + public String getSigningType() { + return this.signingType; + } + + public void setSigningType(String signingType) { + this.signingType = signingType; + } + + public static class Builder { + /** + * 合同开始日期 + *

示例值:2022-10-08 + */ + private String contractStartDate; + /** + * 合同结束日期 + *

示例值:2025-10-07 + */ + private String contractEndDate; + /** + * -| 合同类型,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name = "pre_hire" - custom_api_name = "contract_type" + *

示例值:labor_contract + */ + private String contractType; + /** + * -| 期限类型,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name = "pre_hire" - custom_api_name = "duration_type" + *

示例值:fixed_term + */ + private String durationType; + /** + * -| 签订类型,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name = "pre_hire" - custom_api_name = "duration_type" + *

示例值:renewed + */ + private String signingType; + + /** + * 合同开始日期 + *

示例值:2022-10-08 + * + * @param contractStartDate + * @return + */ + public Builder contractStartDate(String contractStartDate) { + this.contractStartDate = contractStartDate; + return this; + } + + + /** + * 合同结束日期 + *

示例值:2025-10-07 + * + * @param contractEndDate + * @return + */ + public Builder contractEndDate(String contractEndDate) { + this.contractEndDate = contractEndDate; + return this; + } + + + /** + * -| 合同类型,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name = "pre_hire" - custom_api_name = "contract_type" + *

示例值:labor_contract + * + * @param contractType + * @return + */ + public Builder contractType(String contractType) { + this.contractType = contractType; + return this; + } + + + /** + * -| 期限类型,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name = "pre_hire" - custom_api_name = "duration_type" + *

示例值:fixed_term + * + * @param durationType + * @return + */ + public Builder durationType(String durationType) { + this.durationType = durationType; + return this; + } + + + /** + * -| 签订类型,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name = "pre_hire" - custom_api_name = "duration_type" + *

示例值:renewed + * + * @param signingType + * @return + */ + public Builder signingType(String signingType) { + this.signingType = signingType; + return this; + } + + + public PreHireContractInfo build() { + return new PreHireContractInfo(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PreHireEmploymentInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PreHireEmploymentInfo.java new file mode 100644 index 000000000..03b931f67 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PreHireEmploymentInfo.java @@ -0,0 +1,937 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PreHireEmploymentInfo { + /** + * 部门 ID ,可以通过【搜索部门信息】接口获取 + *

示例值:7147562782945478177 + */ + @SerializedName("department_id") + private String departmentId; + /** + * 成本中心分摊信息 + *

示例值: + */ + @SerializedName("cost_center_rates") + private JobDataCostCenter[] costCenterRates; + /** + * 办公地点id ,详细信息可通过【批量查询地点】接口获得 + *

示例值:6977976687350924832 + */ + @SerializedName("office_location_id") + private String officeLocationId; + /** + * 工作地点id ,详细信息可通过【批量查询地点】接口获得 + *

示例值:6977976687350924832 + */ + @SerializedName("work_location_id") + private String workLocationId; + /** + * 工位 + *

示例值:ABC123 + */ + @SerializedName("work_station") + private String workStation; + /** + * 工号 + *

示例值:1234567 + */ + @SerializedName("worker_id") + private String workerId; + /** + * -| 薪资类型,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:compensation_type - object_api_name:pre_hire + *

示例值: + */ + @SerializedName("compensation_type") + private Enum compensationType; + /** + * 直属上级雇佣 ID , 可以通过【搜索员工信息】接口获取 + *

示例值:7032210902531327521 + */ + @SerializedName("direct_leader_id") + private String directLeaderId; + /** + * 职务 ID ,可以通过【批量查询职务】接口获取 + *

示例值:6977976735715378724 + */ + @SerializedName("job_id") + private String jobId; + /** + * 序列 ID,可以通过【批量查询职务序列】接口获取 + *

示例值:6977972856625939999 + */ + @SerializedName("job_family_id") + private String jobFamilyId; + /** + * 职级 ID,可以通过【批量查询职务级别】接口获取 + *

示例值:6977971894960145950 + */ + @SerializedName("job_level_id") + private String jobLevelId; + /** + * 职等 ID + *

示例值:6977971894960145950 + */ + @SerializedName("job_grade_id") + private String jobGradeId; + /** + * 职务头衔 + *

示例值:java + */ + @SerializedName("job_title") + private String jobTitle; + /** + * 人员类型 ID ,可以通过招聘【批量查询人员类型】接口获取 + *

示例值:6977973225846343171 + */ + @SerializedName("employee_type_id") + private String employeeTypeId; + /** + * -| 雇佣类型, 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name = "pre_hire" - custom_api_name = "employment_type" + *

示例值:employee + */ + @SerializedName("employment_type") + private String employmentType; + /** + * 工作邮箱 + *

示例值:joshua@bytedance.com + */ + @SerializedName("work_email") + private String workEmail; + /** + * 公司 ID , 详细信息可通过【批量查询公司】接口获得 + *

示例值:6738317738688661772 + */ + @SerializedName("company_id") + private String companyId; + /** + * 社保城市 ID ,详细信息可通过【批量查询地点】接口获得 + *

示例值:6977973225846343171 + */ + @SerializedName("social_security_city_id") + private String socialSecurityCityId; + /** + * 是否包含竞业条款 + *

示例值:true + */ + @SerializedName("non_compete_covenant") + private Boolean nonCompeteCovenant; + /** + * 周工作时长(单位:小时) + *

示例值:8 + */ + @SerializedName("weekly_working_hours") + private Integer weeklyWorkingHours; + /** + * 是否离职重聘 + *

示例值: + */ + @SerializedName("rehire") + private String rehire; + /** + * -| 历史雇佣信息 ID ,雇佣信息详细信息可以通过「查询单个雇佣信息」API 获得,系统会检验当前雇佣信息的合法性,要求: - 雇佣信息为该人员最后一次雇佣记录 - 雇佣信息的雇员状态 = "terminated" - 该人员不存在其他待入职记录 + *

示例值:6977973225846343172 + */ + @SerializedName("rehire_employment_id") + private String rehireEmploymentId; + /** + * -| 工时制度 ID ,可通过【查询单个工时制度】接口获取 + *

示例值:6977973225846343171 + */ + @SerializedName("working_hours_type") + private String workingHoursType; + /** + * 周工作时长v2(单位:小时) + *

示例值:8.5 + */ + @SerializedName("weekly_working_hours_v2") + private Double weeklyWorkingHoursV2; + + // builder 开始 + public PreHireEmploymentInfo() { + } + + public PreHireEmploymentInfo(Builder builder) { + /** + * 部门 ID ,可以通过【搜索部门信息】接口获取 + *

示例值:7147562782945478177 + */ + this.departmentId = builder.departmentId; + /** + * 成本中心分摊信息 + *

示例值: + */ + this.costCenterRates = builder.costCenterRates; + /** + * 办公地点id ,详细信息可通过【批量查询地点】接口获得 + *

示例值:6977976687350924832 + */ + this.officeLocationId = builder.officeLocationId; + /** + * 工作地点id ,详细信息可通过【批量查询地点】接口获得 + *

示例值:6977976687350924832 + */ + this.workLocationId = builder.workLocationId; + /** + * 工位 + *

示例值:ABC123 + */ + this.workStation = builder.workStation; + /** + * 工号 + *

示例值:1234567 + */ + this.workerId = builder.workerId; + /** + * -| 薪资类型,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:compensation_type - object_api_name:pre_hire + *

示例值: + */ + this.compensationType = builder.compensationType; + /** + * 直属上级雇佣 ID , 可以通过【搜索员工信息】接口获取 + *

示例值:7032210902531327521 + */ + this.directLeaderId = builder.directLeaderId; + /** + * 职务 ID ,可以通过【批量查询职务】接口获取 + *

示例值:6977976735715378724 + */ + this.jobId = builder.jobId; + /** + * 序列 ID,可以通过【批量查询职务序列】接口获取 + *

示例值:6977972856625939999 + */ + this.jobFamilyId = builder.jobFamilyId; + /** + * 职级 ID,可以通过【批量查询职务级别】接口获取 + *

示例值:6977971894960145950 + */ + this.jobLevelId = builder.jobLevelId; + /** + * 职等 ID + *

示例值:6977971894960145950 + */ + this.jobGradeId = builder.jobGradeId; + /** + * 职务头衔 + *

示例值:java + */ + this.jobTitle = builder.jobTitle; + /** + * 人员类型 ID ,可以通过招聘【批量查询人员类型】接口获取 + *

示例值:6977973225846343171 + */ + this.employeeTypeId = builder.employeeTypeId; + /** + * -| 雇佣类型, 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name = "pre_hire" - custom_api_name = "employment_type" + *

示例值:employee + */ + this.employmentType = builder.employmentType; + /** + * 工作邮箱 + *

示例值:joshua@bytedance.com + */ + this.workEmail = builder.workEmail; + /** + * 公司 ID , 详细信息可通过【批量查询公司】接口获得 + *

示例值:6738317738688661772 + */ + this.companyId = builder.companyId; + /** + * 社保城市 ID ,详细信息可通过【批量查询地点】接口获得 + *

示例值:6977973225846343171 + */ + this.socialSecurityCityId = builder.socialSecurityCityId; + /** + * 是否包含竞业条款 + *

示例值:true + */ + this.nonCompeteCovenant = builder.nonCompeteCovenant; + /** + * 周工作时长(单位:小时) + *

示例值:8 + */ + this.weeklyWorkingHours = builder.weeklyWorkingHours; + /** + * 是否离职重聘 + *

示例值: + */ + this.rehire = builder.rehire; + /** + * -| 历史雇佣信息 ID ,雇佣信息详细信息可以通过「查询单个雇佣信息」API 获得,系统会检验当前雇佣信息的合法性,要求: - 雇佣信息为该人员最后一次雇佣记录 - 雇佣信息的雇员状态 = "terminated" - 该人员不存在其他待入职记录 + *

示例值:6977973225846343172 + */ + this.rehireEmploymentId = builder.rehireEmploymentId; + /** + * -| 工时制度 ID ,可通过【查询单个工时制度】接口获取 + *

示例值:6977973225846343171 + */ + this.workingHoursType = builder.workingHoursType; + /** + * 周工作时长v2(单位:小时) + *

示例值:8.5 + */ + this.weeklyWorkingHoursV2 = builder.weeklyWorkingHoursV2; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getDepartmentId() { + return this.departmentId; + } + + public void setDepartmentId(String departmentId) { + this.departmentId = departmentId; + } + + public JobDataCostCenter[] getCostCenterRates() { + return this.costCenterRates; + } + + public void setCostCenterRates(JobDataCostCenter[] costCenterRates) { + this.costCenterRates = costCenterRates; + } + + public String getOfficeLocationId() { + return this.officeLocationId; + } + + public void setOfficeLocationId(String officeLocationId) { + this.officeLocationId = officeLocationId; + } + + public String getWorkLocationId() { + return this.workLocationId; + } + + public void setWorkLocationId(String workLocationId) { + this.workLocationId = workLocationId; + } + + public String getWorkStation() { + return this.workStation; + } + + public void setWorkStation(String workStation) { + this.workStation = workStation; + } + + public String getWorkerId() { + return this.workerId; + } + + public void setWorkerId(String workerId) { + this.workerId = workerId; + } + + public Enum getCompensationType() { + return this.compensationType; + } + + public void setCompensationType(Enum compensationType) { + this.compensationType = compensationType; + } + + public String getDirectLeaderId() { + return this.directLeaderId; + } + + public void setDirectLeaderId(String directLeaderId) { + this.directLeaderId = directLeaderId; + } + + public String getJobId() { + return this.jobId; + } + + public void setJobId(String jobId) { + this.jobId = jobId; + } + + public String getJobFamilyId() { + return this.jobFamilyId; + } + + public void setJobFamilyId(String jobFamilyId) { + this.jobFamilyId = jobFamilyId; + } + + public String getJobLevelId() { + return this.jobLevelId; + } + + public void setJobLevelId(String jobLevelId) { + this.jobLevelId = jobLevelId; + } + + public String getJobGradeId() { + return this.jobGradeId; + } + + public void setJobGradeId(String jobGradeId) { + this.jobGradeId = jobGradeId; + } + + public String getJobTitle() { + return this.jobTitle; + } + + public void setJobTitle(String jobTitle) { + this.jobTitle = jobTitle; + } + + public String getEmployeeTypeId() { + return this.employeeTypeId; + } + + public void setEmployeeTypeId(String employeeTypeId) { + this.employeeTypeId = employeeTypeId; + } + + public String getEmploymentType() { + return this.employmentType; + } + + public void setEmploymentType(String employmentType) { + this.employmentType = employmentType; + } + + public String getWorkEmail() { + return this.workEmail; + } + + public void setWorkEmail(String workEmail) { + this.workEmail = workEmail; + } + + public String getCompanyId() { + return this.companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + public String getSocialSecurityCityId() { + return this.socialSecurityCityId; + } + + public void setSocialSecurityCityId(String socialSecurityCityId) { + this.socialSecurityCityId = socialSecurityCityId; + } + + public Boolean getNonCompeteCovenant() { + return this.nonCompeteCovenant; + } + + public void setNonCompeteCovenant(Boolean nonCompeteCovenant) { + this.nonCompeteCovenant = nonCompeteCovenant; + } + + public Integer getWeeklyWorkingHours() { + return this.weeklyWorkingHours; + } + + public void setWeeklyWorkingHours(Integer weeklyWorkingHours) { + this.weeklyWorkingHours = weeklyWorkingHours; + } + + public String getRehire() { + return this.rehire; + } + + public void setRehire(String rehire) { + this.rehire = rehire; + } + + public String getRehireEmploymentId() { + return this.rehireEmploymentId; + } + + public void setRehireEmploymentId(String rehireEmploymentId) { + this.rehireEmploymentId = rehireEmploymentId; + } + + public String getWorkingHoursType() { + return this.workingHoursType; + } + + public void setWorkingHoursType(String workingHoursType) { + this.workingHoursType = workingHoursType; + } + + public Double getWeeklyWorkingHoursV2() { + return this.weeklyWorkingHoursV2; + } + + public void setWeeklyWorkingHoursV2(Double weeklyWorkingHoursV2) { + this.weeklyWorkingHoursV2 = weeklyWorkingHoursV2; + } + + public static class Builder { + /** + * 部门 ID ,可以通过【搜索部门信息】接口获取 + *

示例值:7147562782945478177 + */ + private String departmentId; + /** + * 成本中心分摊信息 + *

示例值: + */ + private JobDataCostCenter[] costCenterRates; + /** + * 办公地点id ,详细信息可通过【批量查询地点】接口获得 + *

示例值:6977976687350924832 + */ + private String officeLocationId; + /** + * 工作地点id ,详细信息可通过【批量查询地点】接口获得 + *

示例值:6977976687350924832 + */ + private String workLocationId; + /** + * 工位 + *

示例值:ABC123 + */ + private String workStation; + /** + * 工号 + *

示例值:1234567 + */ + private String workerId; + /** + * -| 薪资类型,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:compensation_type - object_api_name:pre_hire + *

示例值: + */ + private Enum compensationType; + /** + * 直属上级雇佣 ID , 可以通过【搜索员工信息】接口获取 + *

示例值:7032210902531327521 + */ + private String directLeaderId; + /** + * 职务 ID ,可以通过【批量查询职务】接口获取 + *

示例值:6977976735715378724 + */ + private String jobId; + /** + * 序列 ID,可以通过【批量查询职务序列】接口获取 + *

示例值:6977972856625939999 + */ + private String jobFamilyId; + /** + * 职级 ID,可以通过【批量查询职务级别】接口获取 + *

示例值:6977971894960145950 + */ + private String jobLevelId; + /** + * 职等 ID + *

示例值:6977971894960145950 + */ + private String jobGradeId; + /** + * 职务头衔 + *

示例值:java + */ + private String jobTitle; + /** + * 人员类型 ID ,可以通过招聘【批量查询人员类型】接口获取 + *

示例值:6977973225846343171 + */ + private String employeeTypeId; + /** + * -| 雇佣类型, 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name = "pre_hire" - custom_api_name = "employment_type" + *

示例值:employee + */ + private String employmentType; + /** + * 工作邮箱 + *

示例值:joshua@bytedance.com + */ + private String workEmail; + /** + * 公司 ID , 详细信息可通过【批量查询公司】接口获得 + *

示例值:6738317738688661772 + */ + private String companyId; + /** + * 社保城市 ID ,详细信息可通过【批量查询地点】接口获得 + *

示例值:6977973225846343171 + */ + private String socialSecurityCityId; + /** + * 是否包含竞业条款 + *

示例值:true + */ + private Boolean nonCompeteCovenant; + /** + * 周工作时长(单位:小时) + *

示例值:8 + */ + private Integer weeklyWorkingHours; + /** + * 是否离职重聘 + *

示例值: + */ + private String rehire; + /** + * -| 历史雇佣信息 ID ,雇佣信息详细信息可以通过「查询单个雇佣信息」API 获得,系统会检验当前雇佣信息的合法性,要求: - 雇佣信息为该人员最后一次雇佣记录 - 雇佣信息的雇员状态 = "terminated" - 该人员不存在其他待入职记录 + *

示例值:6977973225846343172 + */ + private String rehireEmploymentId; + /** + * -| 工时制度 ID ,可通过【查询单个工时制度】接口获取 + *

示例值:6977973225846343171 + */ + private String workingHoursType; + /** + * 周工作时长v2(单位:小时) + *

示例值:8.5 + */ + private Double weeklyWorkingHoursV2; + + /** + * 部门 ID ,可以通过【搜索部门信息】接口获取 + *

示例值:7147562782945478177 + * + * @param departmentId + * @return + */ + public Builder departmentId(String departmentId) { + this.departmentId = departmentId; + return this; + } + + + /** + * 成本中心分摊信息 + *

示例值: + * + * @param costCenterRates + * @return + */ + public Builder costCenterRates(JobDataCostCenter[] costCenterRates) { + this.costCenterRates = costCenterRates; + return this; + } + + + /** + * 办公地点id ,详细信息可通过【批量查询地点】接口获得 + *

示例值:6977976687350924832 + * + * @param officeLocationId + * @return + */ + public Builder officeLocationId(String officeLocationId) { + this.officeLocationId = officeLocationId; + return this; + } + + + /** + * 工作地点id ,详细信息可通过【批量查询地点】接口获得 + *

示例值:6977976687350924832 + * + * @param workLocationId + * @return + */ + public Builder workLocationId(String workLocationId) { + this.workLocationId = workLocationId; + return this; + } + + + /** + * 工位 + *

示例值:ABC123 + * + * @param workStation + * @return + */ + public Builder workStation(String workStation) { + this.workStation = workStation; + return this; + } + + + /** + * 工号 + *

示例值:1234567 + * + * @param workerId + * @return + */ + public Builder workerId(String workerId) { + this.workerId = workerId; + return this; + } + + + /** + * -| 薪资类型,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - custom_api_name:compensation_type - object_api_name:pre_hire + *

示例值: + * + * @param compensationType + * @return + */ + public Builder compensationType(Enum compensationType) { + this.compensationType = compensationType; + return this; + } + + + /** + * 直属上级雇佣 ID , 可以通过【搜索员工信息】接口获取 + *

示例值:7032210902531327521 + * + * @param directLeaderId + * @return + */ + public Builder directLeaderId(String directLeaderId) { + this.directLeaderId = directLeaderId; + return this; + } + + + /** + * 职务 ID ,可以通过【批量查询职务】接口获取 + *

示例值:6977976735715378724 + * + * @param jobId + * @return + */ + public Builder jobId(String jobId) { + this.jobId = jobId; + return this; + } + + + /** + * 序列 ID,可以通过【批量查询职务序列】接口获取 + *

示例值:6977972856625939999 + * + * @param jobFamilyId + * @return + */ + public Builder jobFamilyId(String jobFamilyId) { + this.jobFamilyId = jobFamilyId; + return this; + } + + + /** + * 职级 ID,可以通过【批量查询职务级别】接口获取 + *

示例值:6977971894960145950 + * + * @param jobLevelId + * @return + */ + public Builder jobLevelId(String jobLevelId) { + this.jobLevelId = jobLevelId; + return this; + } + + + /** + * 职等 ID + *

示例值:6977971894960145950 + * + * @param jobGradeId + * @return + */ + public Builder jobGradeId(String jobGradeId) { + this.jobGradeId = jobGradeId; + return this; + } + + + /** + * 职务头衔 + *

示例值:java + * + * @param jobTitle + * @return + */ + public Builder jobTitle(String jobTitle) { + this.jobTitle = jobTitle; + return this; + } + + + /** + * 人员类型 ID ,可以通过招聘【批量查询人员类型】接口获取 + *

示例值:6977973225846343171 + * + * @param employeeTypeId + * @return + */ + public Builder employeeTypeId(String employeeTypeId) { + this.employeeTypeId = employeeTypeId; + return this; + } + + + /** + * -| 雇佣类型, 枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name = "pre_hire" - custom_api_name = "employment_type" + *

示例值:employee + * + * @param employmentType + * @return + */ + public Builder employmentType(String employmentType) { + this.employmentType = employmentType; + return this; + } + + + /** + * 工作邮箱 + *

示例值:joshua@bytedance.com + * + * @param workEmail + * @return + */ + public Builder workEmail(String workEmail) { + this.workEmail = workEmail; + return this; + } + + + /** + * 公司 ID , 详细信息可通过【批量查询公司】接口获得 + *

示例值:6738317738688661772 + * + * @param companyId + * @return + */ + public Builder companyId(String companyId) { + this.companyId = companyId; + return this; + } + + + /** + * 社保城市 ID ,详细信息可通过【批量查询地点】接口获得 + *

示例值:6977973225846343171 + * + * @param socialSecurityCityId + * @return + */ + public Builder socialSecurityCityId(String socialSecurityCityId) { + this.socialSecurityCityId = socialSecurityCityId; + return this; + } + + + /** + * 是否包含竞业条款 + *

示例值:true + * + * @param nonCompeteCovenant + * @return + */ + public Builder nonCompeteCovenant(Boolean nonCompeteCovenant) { + this.nonCompeteCovenant = nonCompeteCovenant; + return this; + } + + + /** + * 周工作时长(单位:小时) + *

示例值:8 + * + * @param weeklyWorkingHours + * @return + */ + public Builder weeklyWorkingHours(Integer weeklyWorkingHours) { + this.weeklyWorkingHours = weeklyWorkingHours; + return this; + } + + + /** + * 是否离职重聘 + *

示例值: + * + * @param rehire + * @return + */ + public Builder rehire(String rehire) { + this.rehire = rehire; + return this; + } + + /** + * 是否离职重聘 + *

示例值: + * + * @param rehire {@link com.lark.oapi.service.corehr.v2.enums.PreHireEmploymentInfoRehireEnum} + * @return + */ + public Builder rehire(com.lark.oapi.service.corehr.v2.enums.PreHireEmploymentInfoRehireEnum rehire) { + this.rehire = rehire.getValue(); + return this; + } + + + /** + * -| 历史雇佣信息 ID ,雇佣信息详细信息可以通过「查询单个雇佣信息」API 获得,系统会检验当前雇佣信息的合法性,要求: - 雇佣信息为该人员最后一次雇佣记录 - 雇佣信息的雇员状态 = "terminated" - 该人员不存在其他待入职记录 + *

示例值:6977973225846343172 + * + * @param rehireEmploymentId + * @return + */ + public Builder rehireEmploymentId(String rehireEmploymentId) { + this.rehireEmploymentId = rehireEmploymentId; + return this; + } + + + /** + * -| 工时制度 ID ,可通过【查询单个工时制度】接口获取 + *

示例值:6977973225846343171 + * + * @param workingHoursType + * @return + */ + public Builder workingHoursType(String workingHoursType) { + this.workingHoursType = workingHoursType; + return this; + } + + + /** + * 周工作时长v2(单位:小时) + *

示例值:8.5 + * + * @param weeklyWorkingHoursV2 + * @return + */ + public Builder weeklyWorkingHoursV2(Double weeklyWorkingHoursV2) { + this.weeklyWorkingHoursV2 = weeklyWorkingHoursV2; + return this; + } + + + public PreHireEmploymentInfo build() { + return new PreHireEmploymentInfo(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PreHireOnboardingInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PreHireOnboardingInfo.java new file mode 100644 index 000000000..36f9f1a01 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PreHireOnboardingInfo.java @@ -0,0 +1,407 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PreHireOnboardingInfo { + /** + * Offer id , 可以通过招聘【获取 Offer 列表】接口获取 + *

示例值:7032210902531327521 + */ + @SerializedName("offer_id") + private String offerId; + /** + * Offer hr 的 雇佣 ID + *

示例值:7032210902531327521 + */ + @SerializedName("offer_hr_id") + private String offerHrId; + /** + * -| 入职方式,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name = "pre_hire" - custom_api_name = "onboarding_method" + *

示例值:onsite + */ + @SerializedName("entry_mode") + private String entryMode; + /** + * 入职日期 + *

示例值:2022-10-08 + */ + @SerializedName("onboarding_date") + private String onboardingDate; + /** + * 招聘投递 ID ,详细信息可以通过招聘【获取投递信息】接口查询获得 + *

示例值:7140946969586010376 + */ + @SerializedName("ats_application_id") + private String atsApplicationId; + /** + * -| 招聘来源 ,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name = "pre_hire" - custom_api_name = "recruitment_type" + *

示例值:recent_graduates + */ + @SerializedName("recruitment_type") + private String recruitmentType; + /** + * -| 入职地点id , 详细信息可通过【批量查询地点】接口获得 + *

示例值:6977976687350924832 + */ + @SerializedName("onboarding_location_id") + private String onboardingLocationId; + /** + * -| 需要公司办理签证 + *

示例值:true + */ + @SerializedName("company_sponsored_visa") + private Boolean companySponsoredVisa; + /** + * -| 入职状态 + *

示例值: + */ + @SerializedName("onboarding_status") + private Boolean onboardingStatus; + /** + * 入职任务列表 + *

示例值: + */ + @SerializedName("onboarding_task_list") + private OnboardingTask[] onboardingTaskList; + + // builder 开始 + public PreHireOnboardingInfo() { + } + + public PreHireOnboardingInfo(Builder builder) { + /** + * Offer id , 可以通过招聘【获取 Offer 列表】接口获取 + *

示例值:7032210902531327521 + */ + this.offerId = builder.offerId; + /** + * Offer hr 的 雇佣 ID + *

示例值:7032210902531327521 + */ + this.offerHrId = builder.offerHrId; + /** + * -| 入职方式,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name = "pre_hire" - custom_api_name = "onboarding_method" + *

示例值:onsite + */ + this.entryMode = builder.entryMode; + /** + * 入职日期 + *

示例值:2022-10-08 + */ + this.onboardingDate = builder.onboardingDate; + /** + * 招聘投递 ID ,详细信息可以通过招聘【获取投递信息】接口查询获得 + *

示例值:7140946969586010376 + */ + this.atsApplicationId = builder.atsApplicationId; + /** + * -| 招聘来源 ,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name = "pre_hire" - custom_api_name = "recruitment_type" + *

示例值:recent_graduates + */ + this.recruitmentType = builder.recruitmentType; + /** + * -| 入职地点id , 详细信息可通过【批量查询地点】接口获得 + *

示例值:6977976687350924832 + */ + this.onboardingLocationId = builder.onboardingLocationId; + /** + * -| 需要公司办理签证 + *

示例值:true + */ + this.companySponsoredVisa = builder.companySponsoredVisa; + /** + * -| 入职状态 + *

示例值: + */ + this.onboardingStatus = builder.onboardingStatus; + /** + * 入职任务列表 + *

示例值: + */ + this.onboardingTaskList = builder.onboardingTaskList; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getOfferId() { + return this.offerId; + } + + public void setOfferId(String offerId) { + this.offerId = offerId; + } + + public String getOfferHrId() { + return this.offerHrId; + } + + public void setOfferHrId(String offerHrId) { + this.offerHrId = offerHrId; + } + + public String getEntryMode() { + return this.entryMode; + } + + public void setEntryMode(String entryMode) { + this.entryMode = entryMode; + } + + public String getOnboardingDate() { + return this.onboardingDate; + } + + public void setOnboardingDate(String onboardingDate) { + this.onboardingDate = onboardingDate; + } + + public String getAtsApplicationId() { + return this.atsApplicationId; + } + + public void setAtsApplicationId(String atsApplicationId) { + this.atsApplicationId = atsApplicationId; + } + + public String getRecruitmentType() { + return this.recruitmentType; + } + + public void setRecruitmentType(String recruitmentType) { + this.recruitmentType = recruitmentType; + } + + public String getOnboardingLocationId() { + return this.onboardingLocationId; + } + + public void setOnboardingLocationId(String onboardingLocationId) { + this.onboardingLocationId = onboardingLocationId; + } + + public Boolean getCompanySponsoredVisa() { + return this.companySponsoredVisa; + } + + public void setCompanySponsoredVisa(Boolean companySponsoredVisa) { + this.companySponsoredVisa = companySponsoredVisa; + } + + public Boolean getOnboardingStatus() { + return this.onboardingStatus; + } + + public void setOnboardingStatus(Boolean onboardingStatus) { + this.onboardingStatus = onboardingStatus; + } + + public OnboardingTask[] getOnboardingTaskList() { + return this.onboardingTaskList; + } + + public void setOnboardingTaskList(OnboardingTask[] onboardingTaskList) { + this.onboardingTaskList = onboardingTaskList; + } + + public static class Builder { + /** + * Offer id , 可以通过招聘【获取 Offer 列表】接口获取 + *

示例值:7032210902531327521 + */ + private String offerId; + /** + * Offer hr 的 雇佣 ID + *

示例值:7032210902531327521 + */ + private String offerHrId; + /** + * -| 入职方式,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name = "pre_hire" - custom_api_name = "onboarding_method" + *

示例值:onsite + */ + private String entryMode; + /** + * 入职日期 + *

示例值:2022-10-08 + */ + private String onboardingDate; + /** + * 招聘投递 ID ,详细信息可以通过招聘【获取投递信息】接口查询获得 + *

示例值:7140946969586010376 + */ + private String atsApplicationId; + /** + * -| 招聘来源 ,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name = "pre_hire" - custom_api_name = "recruitment_type" + *

示例值:recent_graduates + */ + private String recruitmentType; + /** + * -| 入职地点id , 详细信息可通过【批量查询地点】接口获得 + *

示例值:6977976687350924832 + */ + private String onboardingLocationId; + /** + * -| 需要公司办理签证 + *

示例值:true + */ + private Boolean companySponsoredVisa; + /** + * -| 入职状态 + *

示例值: + */ + private Boolean onboardingStatus; + /** + * 入职任务列表 + *

示例值: + */ + private OnboardingTask[] onboardingTaskList; + + /** + * Offer id , 可以通过招聘【获取 Offer 列表】接口获取 + *

示例值:7032210902531327521 + * + * @param offerId + * @return + */ + public Builder offerId(String offerId) { + this.offerId = offerId; + return this; + } + + + /** + * Offer hr 的 雇佣 ID + *

示例值:7032210902531327521 + * + * @param offerHrId + * @return + */ + public Builder offerHrId(String offerHrId) { + this.offerHrId = offerHrId; + return this; + } + + + /** + * -| 入职方式,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name = "pre_hire" - custom_api_name = "onboarding_method" + *

示例值:onsite + * + * @param entryMode + * @return + */ + public Builder entryMode(String entryMode) { + this.entryMode = entryMode; + return this; + } + + + /** + * 入职日期 + *

示例值:2022-10-08 + * + * @param onboardingDate + * @return + */ + public Builder onboardingDate(String onboardingDate) { + this.onboardingDate = onboardingDate; + return this; + } + + + /** + * 招聘投递 ID ,详细信息可以通过招聘【获取投递信息】接口查询获得 + *

示例值:7140946969586010376 + * + * @param atsApplicationId + * @return + */ + public Builder atsApplicationId(String atsApplicationId) { + this.atsApplicationId = atsApplicationId; + return this; + } + + + /** + * -| 招聘来源 ,枚举值可查询【获取字段详情】接口获取,按如下参数查询即可: - object_api_name = "pre_hire" - custom_api_name = "recruitment_type" + *

示例值:recent_graduates + * + * @param recruitmentType + * @return + */ + public Builder recruitmentType(String recruitmentType) { + this.recruitmentType = recruitmentType; + return this; + } + + + /** + * -| 入职地点id , 详细信息可通过【批量查询地点】接口获得 + *

示例值:6977976687350924832 + * + * @param onboardingLocationId + * @return + */ + public Builder onboardingLocationId(String onboardingLocationId) { + this.onboardingLocationId = onboardingLocationId; + return this; + } + + + /** + * -| 需要公司办理签证 + *

示例值:true + * + * @param companySponsoredVisa + * @return + */ + public Builder companySponsoredVisa(Boolean companySponsoredVisa) { + this.companySponsoredVisa = companySponsoredVisa; + return this; + } + + + /** + * -| 入职状态 + *

示例值: + * + * @param onboardingStatus + * @return + */ + public Builder onboardingStatus(Boolean onboardingStatus) { + this.onboardingStatus = onboardingStatus; + return this; + } + + + /** + * 入职任务列表 + *

示例值: + * + * @param onboardingTaskList + * @return + */ + public Builder onboardingTaskList(OnboardingTask[] onboardingTaskList) { + this.onboardingTaskList = onboardingTaskList; + return this; + } + + + public PreHireOnboardingInfo build() { + return new PreHireOnboardingInfo(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PreHireProbationInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PreHireProbationInfo.java new file mode 100644 index 000000000..3dc75d9e3 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PreHireProbationInfo.java @@ -0,0 +1,148 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PreHireProbationInfo { + /** + * 试用期开始日期 + *

示例值:2022-07-29 + */ + @SerializedName("probation_start_date") + private String probationStartDate; + /** + * 试用期结束日期 + *

示例值:2023-04-07 + */ + @SerializedName("probation_end_date") + private String probationEndDate; + /** + * 试用期时长(单位:天) + *

示例值:6 + */ + @SerializedName("probation_period") + private Integer probationPeriod; + + // builder 开始 + public PreHireProbationInfo() { + } + + public PreHireProbationInfo(Builder builder) { + /** + * 试用期开始日期 + *

示例值:2022-07-29 + */ + this.probationStartDate = builder.probationStartDate; + /** + * 试用期结束日期 + *

示例值:2023-04-07 + */ + this.probationEndDate = builder.probationEndDate; + /** + * 试用期时长(单位:天) + *

示例值:6 + */ + this.probationPeriod = builder.probationPeriod; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getProbationStartDate() { + return this.probationStartDate; + } + + public void setProbationStartDate(String probationStartDate) { + this.probationStartDate = probationStartDate; + } + + public String getProbationEndDate() { + return this.probationEndDate; + } + + public void setProbationEndDate(String probationEndDate) { + this.probationEndDate = probationEndDate; + } + + public Integer getProbationPeriod() { + return this.probationPeriod; + } + + public void setProbationPeriod(Integer probationPeriod) { + this.probationPeriod = probationPeriod; + } + + public static class Builder { + /** + * 试用期开始日期 + *

示例值:2022-07-29 + */ + private String probationStartDate; + /** + * 试用期结束日期 + *

示例值:2023-04-07 + */ + private String probationEndDate; + /** + * 试用期时长(单位:天) + *

示例值:6 + */ + private Integer probationPeriod; + + /** + * 试用期开始日期 + *

示例值:2022-07-29 + * + * @param probationStartDate + * @return + */ + public Builder probationStartDate(String probationStartDate) { + this.probationStartDate = probationStartDate; + return this; + } + + + /** + * 试用期结束日期 + *

示例值:2023-04-07 + * + * @param probationEndDate + * @return + */ + public Builder probationEndDate(String probationEndDate) { + this.probationEndDate = probationEndDate; + return this; + } + + + /** + * 试用期时长(单位:天) + *

示例值:6 + * + * @param probationPeriod + * @return + */ + public Builder probationPeriod(Integer probationPeriod) { + this.probationPeriod = probationPeriod; + return this; + } + + + public PreHireProbationInfo build() { + return new PreHireProbationInfo(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PrehireCreate.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PrehireCreate.java new file mode 100644 index 000000000..fb2d728a7 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/PrehireCreate.java @@ -0,0 +1,222 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PrehireCreate { + /** + * 个人信息 + *

示例值: + */ + @SerializedName("basic_info") + private BasicInfo basicInfo; + /** + * 职位信息 + *

示例值: + */ + @SerializedName("offer_info") + private OfferInfo offerInfo; + /** + * 教育经历 + *

示例值: + */ + @SerializedName("education_info") + private EducationInfo[] educationInfo; + /** + * 工作经历 + *

示例值: + */ + @SerializedName("work_experience") + private WorkExperience[] workExperience; + /** + * 招聘应用ID + *

示例值:7140946969586010376 + */ + @SerializedName("ats_application_id") + private String atsApplicationId; + + // builder 开始 + public PrehireCreate() { + } + + public PrehireCreate(Builder builder) { + /** + * 个人信息 + *

示例值: + */ + this.basicInfo = builder.basicInfo; + /** + * 职位信息 + *

示例值: + */ + this.offerInfo = builder.offerInfo; + /** + * 教育经历 + *

示例值: + */ + this.educationInfo = builder.educationInfo; + /** + * 工作经历 + *

示例值: + */ + this.workExperience = builder.workExperience; + /** + * 招聘应用ID + *

示例值:7140946969586010376 + */ + this.atsApplicationId = builder.atsApplicationId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public BasicInfo getBasicInfo() { + return this.basicInfo; + } + + public void setBasicInfo(BasicInfo basicInfo) { + this.basicInfo = basicInfo; + } + + public OfferInfo getOfferInfo() { + return this.offerInfo; + } + + public void setOfferInfo(OfferInfo offerInfo) { + this.offerInfo = offerInfo; + } + + public EducationInfo[] getEducationInfo() { + return this.educationInfo; + } + + public void setEducationInfo(EducationInfo[] educationInfo) { + this.educationInfo = educationInfo; + } + + public WorkExperience[] getWorkExperience() { + return this.workExperience; + } + + public void setWorkExperience(WorkExperience[] workExperience) { + this.workExperience = workExperience; + } + + public String getAtsApplicationId() { + return this.atsApplicationId; + } + + public void setAtsApplicationId(String atsApplicationId) { + this.atsApplicationId = atsApplicationId; + } + + public static class Builder { + /** + * 个人信息 + *

示例值: + */ + private BasicInfo basicInfo; + /** + * 职位信息 + *

示例值: + */ + private OfferInfo offerInfo; + /** + * 教育经历 + *

示例值: + */ + private EducationInfo[] educationInfo; + /** + * 工作经历 + *

示例值: + */ + private WorkExperience[] workExperience; + /** + * 招聘应用ID + *

示例值:7140946969586010376 + */ + private String atsApplicationId; + + /** + * 个人信息 + *

示例值: + * + * @param basicInfo + * @return + */ + public Builder basicInfo(BasicInfo basicInfo) { + this.basicInfo = basicInfo; + return this; + } + + + /** + * 职位信息 + *

示例值: + * + * @param offerInfo + * @return + */ + public Builder offerInfo(OfferInfo offerInfo) { + this.offerInfo = offerInfo; + return this; + } + + + /** + * 教育经历 + *

示例值: + * + * @param educationInfo + * @return + */ + public Builder educationInfo(EducationInfo[] educationInfo) { + this.educationInfo = educationInfo; + return this; + } + + + /** + * 工作经历 + *

示例值: + * + * @param workExperience + * @return + */ + public Builder workExperience(WorkExperience[] workExperience) { + this.workExperience = workExperience; + return this; + } + + + /** + * 招聘应用ID + *

示例值:7140946969586010376 + * + * @param atsApplicationId + * @return + */ + public Builder atsApplicationId(String atsApplicationId) { + this.atsApplicationId = atsApplicationId; + return this; + } + + + public PrehireCreate build() { + return new PrehireCreate(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProbationInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProbationInfo.java new file mode 100644 index 000000000..28e4285d2 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProbationInfo.java @@ -0,0 +1,814 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class ProbationInfo { + /** + * 雇佣 ID + *

示例值:6893014062142064135 + */ + @SerializedName("employment_id") + private String employmentId; + /** + * 试用期信息 ID + *

示例值:6893014062142064132 + */ + @SerializedName("probation_id") + private String probationId; + /** + * 试用期开始日期 + *

示例值:2022-05-20 + */ + @SerializedName("probation_start_date") + private String probationStartDate; + /** + * 试用期预计结束日期 + *

示例值:2022-05-28 + */ + @SerializedName("probation_expected_end_date") + private String probationExpectedEndDate; + /** + * 试用期实际结束日期 + *

示例值:2022-06-28 + */ + @SerializedName("actual_probation_end_date") + private String actualProbationEndDate; + /** + * 转正发起日期 + *

示例值:2022-07-28 + */ + @SerializedName("initiating_time") + private String initiatingTime; + /** + * 发起方 + *

示例值:hr_submission + */ + @SerializedName("submission_type") + private Enum submissionType; + /** + * 转正发起人的雇佣 ID,当系统发起转正时该字段为空 + *

示例值:6893014062142061135 + */ + @SerializedName("initiator_id") + private String initiatorId; + /** + * 试用期状态 + *

示例值:converted + */ + @SerializedName("probation_status") + private Enum probationStatus; + /** + * 员工自评 + *

示例值:符合预期 + */ + @SerializedName("self_review") + private String selfReview; + /** + * 备注 + *

示例值:高潜 + */ + @SerializedName("notes") + private String notes; + /** + * 流程实例 ID + *

示例值:6893014062142164135 + */ + @SerializedName("process_id") + private String processId; + /** + * 是否通过 BPM 转正 + *

示例值:false + */ + @SerializedName("converted_via_bpm") + private Boolean convertedViaBpm; + /** + * 自定义字段 + *

示例值: + */ + @SerializedName("custom_fields") + private CustomFieldData[] customFields; + /** + * 试用期考核最终状态 + *

示例值:completed + */ + @SerializedName("final_assessment_status") + private Enum finalAssessmentStatus; + /** + * 试用期考核最终结果 + *

示例值:approved + */ + @SerializedName("final_assessment_result") + private Enum finalAssessmentResult; + /** + * 试用期考核最终得分 + *

示例值:99.9 + */ + @SerializedName("final_assessment_score") + private Double finalAssessmentScore; + /** + * 试用期考核最终等级 + *

示例值:grade_a + */ + @SerializedName("final_assessment_grade") + private Enum finalAssessmentGrade; + /** + * 试用期考核最终评语 + *

示例值:超出预期 + */ + @SerializedName("final_assessment_comment") + private String finalAssessmentComment; + /** + * 最终考核结果页面超链接 + *

示例值:https://qwe112233.feishuapp.bytedance.net/ae/ui/apps//122265873393330/recordPages/1/records/1767139312?objectId=17661180522543&recordPageId=173330728118312 + */ + @SerializedName("final_assessment_detail") + private String finalAssessmentDetail; + /** + * 试用期考核结果列表 + *

示例值: + */ + @SerializedName("assessments") + private Assessment[] assessments; + + // builder 开始 + public ProbationInfo() { + } + + public ProbationInfo(Builder builder) { + /** + * 雇佣 ID + *

示例值:6893014062142064135 + */ + this.employmentId = builder.employmentId; + /** + * 试用期信息 ID + *

示例值:6893014062142064132 + */ + this.probationId = builder.probationId; + /** + * 试用期开始日期 + *

示例值:2022-05-20 + */ + this.probationStartDate = builder.probationStartDate; + /** + * 试用期预计结束日期 + *

示例值:2022-05-28 + */ + this.probationExpectedEndDate = builder.probationExpectedEndDate; + /** + * 试用期实际结束日期 + *

示例值:2022-06-28 + */ + this.actualProbationEndDate = builder.actualProbationEndDate; + /** + * 转正发起日期 + *

示例值:2022-07-28 + */ + this.initiatingTime = builder.initiatingTime; + /** + * 发起方 + *

示例值:hr_submission + */ + this.submissionType = builder.submissionType; + /** + * 转正发起人的雇佣 ID,当系统发起转正时该字段为空 + *

示例值:6893014062142061135 + */ + this.initiatorId = builder.initiatorId; + /** + * 试用期状态 + *

示例值:converted + */ + this.probationStatus = builder.probationStatus; + /** + * 员工自评 + *

示例值:符合预期 + */ + this.selfReview = builder.selfReview; + /** + * 备注 + *

示例值:高潜 + */ + this.notes = builder.notes; + /** + * 流程实例 ID + *

示例值:6893014062142164135 + */ + this.processId = builder.processId; + /** + * 是否通过 BPM 转正 + *

示例值:false + */ + this.convertedViaBpm = builder.convertedViaBpm; + /** + * 自定义字段 + *

示例值: + */ + this.customFields = builder.customFields; + /** + * 试用期考核最终状态 + *

示例值:completed + */ + this.finalAssessmentStatus = builder.finalAssessmentStatus; + /** + * 试用期考核最终结果 + *

示例值:approved + */ + this.finalAssessmentResult = builder.finalAssessmentResult; + /** + * 试用期考核最终得分 + *

示例值:99.9 + */ + this.finalAssessmentScore = builder.finalAssessmentScore; + /** + * 试用期考核最终等级 + *

示例值:grade_a + */ + this.finalAssessmentGrade = builder.finalAssessmentGrade; + /** + * 试用期考核最终评语 + *

示例值:超出预期 + */ + this.finalAssessmentComment = builder.finalAssessmentComment; + /** + * 最终考核结果页面超链接 + *

示例值:https://qwe112233.feishuapp.bytedance.net/ae/ui/apps//122265873393330/recordPages/1/records/1767139312?objectId=17661180522543&recordPageId=173330728118312 + */ + this.finalAssessmentDetail = builder.finalAssessmentDetail; + /** + * 试用期考核结果列表 + *

示例值: + */ + this.assessments = builder.assessments; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getEmploymentId() { + return this.employmentId; + } + + public void setEmploymentId(String employmentId) { + this.employmentId = employmentId; + } + + public String getProbationId() { + return this.probationId; + } + + public void setProbationId(String probationId) { + this.probationId = probationId; + } + + public String getProbationStartDate() { + return this.probationStartDate; + } + + public void setProbationStartDate(String probationStartDate) { + this.probationStartDate = probationStartDate; + } + + public String getProbationExpectedEndDate() { + return this.probationExpectedEndDate; + } + + public void setProbationExpectedEndDate(String probationExpectedEndDate) { + this.probationExpectedEndDate = probationExpectedEndDate; + } + + public String getActualProbationEndDate() { + return this.actualProbationEndDate; + } + + public void setActualProbationEndDate(String actualProbationEndDate) { + this.actualProbationEndDate = actualProbationEndDate; + } + + public String getInitiatingTime() { + return this.initiatingTime; + } + + public void setInitiatingTime(String initiatingTime) { + this.initiatingTime = initiatingTime; + } + + public Enum getSubmissionType() { + return this.submissionType; + } + + public void setSubmissionType(Enum submissionType) { + this.submissionType = submissionType; + } + + public String getInitiatorId() { + return this.initiatorId; + } + + public void setInitiatorId(String initiatorId) { + this.initiatorId = initiatorId; + } + + public Enum getProbationStatus() { + return this.probationStatus; + } + + public void setProbationStatus(Enum probationStatus) { + this.probationStatus = probationStatus; + } + + public String getSelfReview() { + return this.selfReview; + } + + public void setSelfReview(String selfReview) { + this.selfReview = selfReview; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getProcessId() { + return this.processId; + } + + public void setProcessId(String processId) { + this.processId = processId; + } + + public Boolean getConvertedViaBpm() { + return this.convertedViaBpm; + } + + public void setConvertedViaBpm(Boolean convertedViaBpm) { + this.convertedViaBpm = convertedViaBpm; + } + + public CustomFieldData[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(CustomFieldData[] customFields) { + this.customFields = customFields; + } + + public Enum getFinalAssessmentStatus() { + return this.finalAssessmentStatus; + } + + public void setFinalAssessmentStatus(Enum finalAssessmentStatus) { + this.finalAssessmentStatus = finalAssessmentStatus; + } + + public Enum getFinalAssessmentResult() { + return this.finalAssessmentResult; + } + + public void setFinalAssessmentResult(Enum finalAssessmentResult) { + this.finalAssessmentResult = finalAssessmentResult; + } + + public Double getFinalAssessmentScore() { + return this.finalAssessmentScore; + } + + public void setFinalAssessmentScore(Double finalAssessmentScore) { + this.finalAssessmentScore = finalAssessmentScore; + } + + public Enum getFinalAssessmentGrade() { + return this.finalAssessmentGrade; + } + + public void setFinalAssessmentGrade(Enum finalAssessmentGrade) { + this.finalAssessmentGrade = finalAssessmentGrade; + } + + public String getFinalAssessmentComment() { + return this.finalAssessmentComment; + } + + public void setFinalAssessmentComment(String finalAssessmentComment) { + this.finalAssessmentComment = finalAssessmentComment; + } + + public String getFinalAssessmentDetail() { + return this.finalAssessmentDetail; + } + + public void setFinalAssessmentDetail(String finalAssessmentDetail) { + this.finalAssessmentDetail = finalAssessmentDetail; + } + + public Assessment[] getAssessments() { + return this.assessments; + } + + public void setAssessments(Assessment[] assessments) { + this.assessments = assessments; + } + + public static class Builder { + /** + * 雇佣 ID + *

示例值:6893014062142064135 + */ + private String employmentId; + /** + * 试用期信息 ID + *

示例值:6893014062142064132 + */ + private String probationId; + /** + * 试用期开始日期 + *

示例值:2022-05-20 + */ + private String probationStartDate; + /** + * 试用期预计结束日期 + *

示例值:2022-05-28 + */ + private String probationExpectedEndDate; + /** + * 试用期实际结束日期 + *

示例值:2022-06-28 + */ + private String actualProbationEndDate; + /** + * 转正发起日期 + *

示例值:2022-07-28 + */ + private String initiatingTime; + /** + * 发起方 + *

示例值:hr_submission + */ + private Enum submissionType; + /** + * 转正发起人的雇佣 ID,当系统发起转正时该字段为空 + *

示例值:6893014062142061135 + */ + private String initiatorId; + /** + * 试用期状态 + *

示例值:converted + */ + private Enum probationStatus; + /** + * 员工自评 + *

示例值:符合预期 + */ + private String selfReview; + /** + * 备注 + *

示例值:高潜 + */ + private String notes; + /** + * 流程实例 ID + *

示例值:6893014062142164135 + */ + private String processId; + /** + * 是否通过 BPM 转正 + *

示例值:false + */ + private Boolean convertedViaBpm; + /** + * 自定义字段 + *

示例值: + */ + private CustomFieldData[] customFields; + /** + * 试用期考核最终状态 + *

示例值:completed + */ + private Enum finalAssessmentStatus; + /** + * 试用期考核最终结果 + *

示例值:approved + */ + private Enum finalAssessmentResult; + /** + * 试用期考核最终得分 + *

示例值:99.9 + */ + private Double finalAssessmentScore; + /** + * 试用期考核最终等级 + *

示例值:grade_a + */ + private Enum finalAssessmentGrade; + /** + * 试用期考核最终评语 + *

示例值:超出预期 + */ + private String finalAssessmentComment; + /** + * 最终考核结果页面超链接 + *

示例值:https://qwe112233.feishuapp.bytedance.net/ae/ui/apps//122265873393330/recordPages/1/records/1767139312?objectId=17661180522543&recordPageId=173330728118312 + */ + private String finalAssessmentDetail; + /** + * 试用期考核结果列表 + *

示例值: + */ + private Assessment[] assessments; + + /** + * 雇佣 ID + *

示例值:6893014062142064135 + * + * @param employmentId + * @return + */ + public Builder employmentId(String employmentId) { + this.employmentId = employmentId; + return this; + } + + + /** + * 试用期信息 ID + *

示例值:6893014062142064132 + * + * @param probationId + * @return + */ + public Builder probationId(String probationId) { + this.probationId = probationId; + return this; + } + + + /** + * 试用期开始日期 + *

示例值:2022-05-20 + * + * @param probationStartDate + * @return + */ + public Builder probationStartDate(String probationStartDate) { + this.probationStartDate = probationStartDate; + return this; + } + + + /** + * 试用期预计结束日期 + *

示例值:2022-05-28 + * + * @param probationExpectedEndDate + * @return + */ + public Builder probationExpectedEndDate(String probationExpectedEndDate) { + this.probationExpectedEndDate = probationExpectedEndDate; + return this; + } + + + /** + * 试用期实际结束日期 + *

示例值:2022-06-28 + * + * @param actualProbationEndDate + * @return + */ + public Builder actualProbationEndDate(String actualProbationEndDate) { + this.actualProbationEndDate = actualProbationEndDate; + return this; + } + + + /** + * 转正发起日期 + *

示例值:2022-07-28 + * + * @param initiatingTime + * @return + */ + public Builder initiatingTime(String initiatingTime) { + this.initiatingTime = initiatingTime; + return this; + } + + + /** + * 发起方 + *

示例值:hr_submission + * + * @param submissionType + * @return + */ + public Builder submissionType(Enum submissionType) { + this.submissionType = submissionType; + return this; + } + + + /** + * 转正发起人的雇佣 ID,当系统发起转正时该字段为空 + *

示例值:6893014062142061135 + * + * @param initiatorId + * @return + */ + public Builder initiatorId(String initiatorId) { + this.initiatorId = initiatorId; + return this; + } + + + /** + * 试用期状态 + *

示例值:converted + * + * @param probationStatus + * @return + */ + public Builder probationStatus(Enum probationStatus) { + this.probationStatus = probationStatus; + return this; + } + + + /** + * 员工自评 + *

示例值:符合预期 + * + * @param selfReview + * @return + */ + public Builder selfReview(String selfReview) { + this.selfReview = selfReview; + return this; + } + + + /** + * 备注 + *

示例值:高潜 + * + * @param notes + * @return + */ + public Builder notes(String notes) { + this.notes = notes; + return this; + } + + + /** + * 流程实例 ID + *

示例值:6893014062142164135 + * + * @param processId + * @return + */ + public Builder processId(String processId) { + this.processId = processId; + return this; + } + + + /** + * 是否通过 BPM 转正 + *

示例值:false + * + * @param convertedViaBpm + * @return + */ + public Builder convertedViaBpm(Boolean convertedViaBpm) { + this.convertedViaBpm = convertedViaBpm; + return this; + } + + + /** + * 自定义字段 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(CustomFieldData[] customFields) { + this.customFields = customFields; + return this; + } + + + /** + * 试用期考核最终状态 + *

示例值:completed + * + * @param finalAssessmentStatus + * @return + */ + public Builder finalAssessmentStatus(Enum finalAssessmentStatus) { + this.finalAssessmentStatus = finalAssessmentStatus; + return this; + } + + + /** + * 试用期考核最终结果 + *

示例值:approved + * + * @param finalAssessmentResult + * @return + */ + public Builder finalAssessmentResult(Enum finalAssessmentResult) { + this.finalAssessmentResult = finalAssessmentResult; + return this; + } + + + /** + * 试用期考核最终得分 + *

示例值:99.9 + * + * @param finalAssessmentScore + * @return + */ + public Builder finalAssessmentScore(Double finalAssessmentScore) { + this.finalAssessmentScore = finalAssessmentScore; + return this; + } + + + /** + * 试用期考核最终等级 + *

示例值:grade_a + * + * @param finalAssessmentGrade + * @return + */ + public Builder finalAssessmentGrade(Enum finalAssessmentGrade) { + this.finalAssessmentGrade = finalAssessmentGrade; + return this; + } + + + /** + * 试用期考核最终评语 + *

示例值:超出预期 + * + * @param finalAssessmentComment + * @return + */ + public Builder finalAssessmentComment(String finalAssessmentComment) { + this.finalAssessmentComment = finalAssessmentComment; + return this; + } + + + /** + * 最终考核结果页面超链接 + *

示例值:https://qwe112233.feishuapp.bytedance.net/ae/ui/apps//122265873393330/recordPages/1/records/1767139312?objectId=17661180522543&recordPageId=173330728118312 + * + * @param finalAssessmentDetail + * @return + */ + public Builder finalAssessmentDetail(String finalAssessmentDetail) { + this.finalAssessmentDetail = finalAssessmentDetail; + return this; + } + + + /** + * 试用期考核结果列表 + *

示例值: + * + * @param assessments + * @return + */ + public Builder assessments(Assessment[] assessments) { + this.assessments = assessments; + return this; + } + + + public ProbationInfo build() { + return new ProbationInfo(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProbationInfoForSubmit.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProbationInfoForSubmit.java new file mode 100644 index 000000000..406bfbea3 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProbationInfoForSubmit.java @@ -0,0 +1,777 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class ProbationInfoForSubmit { + /** + * 雇佣 ID + *

示例值:6893014062142064135 + */ + @SerializedName("employment_id") + private String employmentId; + /** + * 试用期信息 ID + *

示例值:6893014062142064132 + */ + @SerializedName("probation_id") + private String probationId; + /** + * 试用期开始日期 + *

示例值:2022-05-20 + */ + @SerializedName("probation_start_date") + private String probationStartDate; + /** + * 试用期预计结束日期 + *

示例值:2022-05-28 + */ + @SerializedName("probation_expected_end_date") + private String probationExpectedEndDate; + /** + * 试用期实际结束日期 + *

示例值:2022-06-28 + */ + @SerializedName("actual_probation_end_date") + private String actualProbationEndDate; + /** + * 转正发起日期 + *

示例值:2022-07-28 + */ + @SerializedName("initiating_time") + private String initiatingTime; + /** + * 发起方 + *

示例值:hr_submission + */ + @SerializedName("submission_type") + private Enum submissionType; + /** + * 转正发起人的雇佣 ID,当系统发起转正时该字段为空 + *

示例值:6893014062142061135 + */ + @SerializedName("initiator_id") + private String initiatorId; + /** + * 试用期状态 + *

示例值:converted + */ + @SerializedName("probation_status") + private Enum probationStatus; + /** + * 员工自评 + *

示例值:符合预期 + */ + @SerializedName("self_review") + private String selfReview; + /** + * 备注 + *

示例值:高潜 + */ + @SerializedName("notes") + private String notes; + /** + * 流程实例 ID + *

示例值:6893014062142164135 + */ + @SerializedName("process_id") + private String processId; + /** + * 是否通过 BPM 转正 + *

示例值:false + */ + @SerializedName("converted_via_bpm") + private Boolean convertedViaBpm; + /** + * 自定义字段 + *

示例值: + */ + @SerializedName("custom_fields") + private CustomFieldData[] customFields; + /** + * 试用期考核最终状态 + *

示例值:completed + */ + @SerializedName("final_assessment_status") + private Enum finalAssessmentStatus; + /** + * 试用期考核最终结果 + *

示例值:approved + */ + @SerializedName("final_assessment_result") + private Enum finalAssessmentResult; + /** + * 试用期考核最终得分 + *

示例值:99.9 + */ + @SerializedName("final_assessment_score") + private Double finalAssessmentScore; + /** + * 试用期考核最终等级 + *

示例值:grade_a + */ + @SerializedName("final_assessment_grade") + private Enum finalAssessmentGrade; + /** + * 试用期考核最终评语 + *

示例值:超出预期 + */ + @SerializedName("final_assessment_comment") + private String finalAssessmentComment; + /** + * 最终考核结果页面超链接 + *

示例值:暂无示例 + */ + @SerializedName("final_assessment_detail") + private String finalAssessmentDetail; + + // builder 开始 + public ProbationInfoForSubmit() { + } + + public ProbationInfoForSubmit(Builder builder) { + /** + * 雇佣 ID + *

示例值:6893014062142064135 + */ + this.employmentId = builder.employmentId; + /** + * 试用期信息 ID + *

示例值:6893014062142064132 + */ + this.probationId = builder.probationId; + /** + * 试用期开始日期 + *

示例值:2022-05-20 + */ + this.probationStartDate = builder.probationStartDate; + /** + * 试用期预计结束日期 + *

示例值:2022-05-28 + */ + this.probationExpectedEndDate = builder.probationExpectedEndDate; + /** + * 试用期实际结束日期 + *

示例值:2022-06-28 + */ + this.actualProbationEndDate = builder.actualProbationEndDate; + /** + * 转正发起日期 + *

示例值:2022-07-28 + */ + this.initiatingTime = builder.initiatingTime; + /** + * 发起方 + *

示例值:hr_submission + */ + this.submissionType = builder.submissionType; + /** + * 转正发起人的雇佣 ID,当系统发起转正时该字段为空 + *

示例值:6893014062142061135 + */ + this.initiatorId = builder.initiatorId; + /** + * 试用期状态 + *

示例值:converted + */ + this.probationStatus = builder.probationStatus; + /** + * 员工自评 + *

示例值:符合预期 + */ + this.selfReview = builder.selfReview; + /** + * 备注 + *

示例值:高潜 + */ + this.notes = builder.notes; + /** + * 流程实例 ID + *

示例值:6893014062142164135 + */ + this.processId = builder.processId; + /** + * 是否通过 BPM 转正 + *

示例值:false + */ + this.convertedViaBpm = builder.convertedViaBpm; + /** + * 自定义字段 + *

示例值: + */ + this.customFields = builder.customFields; + /** + * 试用期考核最终状态 + *

示例值:completed + */ + this.finalAssessmentStatus = builder.finalAssessmentStatus; + /** + * 试用期考核最终结果 + *

示例值:approved + */ + this.finalAssessmentResult = builder.finalAssessmentResult; + /** + * 试用期考核最终得分 + *

示例值:99.9 + */ + this.finalAssessmentScore = builder.finalAssessmentScore; + /** + * 试用期考核最终等级 + *

示例值:grade_a + */ + this.finalAssessmentGrade = builder.finalAssessmentGrade; + /** + * 试用期考核最终评语 + *

示例值:超出预期 + */ + this.finalAssessmentComment = builder.finalAssessmentComment; + /** + * 最终考核结果页面超链接 + *

示例值:暂无示例 + */ + this.finalAssessmentDetail = builder.finalAssessmentDetail; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getEmploymentId() { + return this.employmentId; + } + + public void setEmploymentId(String employmentId) { + this.employmentId = employmentId; + } + + public String getProbationId() { + return this.probationId; + } + + public void setProbationId(String probationId) { + this.probationId = probationId; + } + + public String getProbationStartDate() { + return this.probationStartDate; + } + + public void setProbationStartDate(String probationStartDate) { + this.probationStartDate = probationStartDate; + } + + public String getProbationExpectedEndDate() { + return this.probationExpectedEndDate; + } + + public void setProbationExpectedEndDate(String probationExpectedEndDate) { + this.probationExpectedEndDate = probationExpectedEndDate; + } + + public String getActualProbationEndDate() { + return this.actualProbationEndDate; + } + + public void setActualProbationEndDate(String actualProbationEndDate) { + this.actualProbationEndDate = actualProbationEndDate; + } + + public String getInitiatingTime() { + return this.initiatingTime; + } + + public void setInitiatingTime(String initiatingTime) { + this.initiatingTime = initiatingTime; + } + + public Enum getSubmissionType() { + return this.submissionType; + } + + public void setSubmissionType(Enum submissionType) { + this.submissionType = submissionType; + } + + public String getInitiatorId() { + return this.initiatorId; + } + + public void setInitiatorId(String initiatorId) { + this.initiatorId = initiatorId; + } + + public Enum getProbationStatus() { + return this.probationStatus; + } + + public void setProbationStatus(Enum probationStatus) { + this.probationStatus = probationStatus; + } + + public String getSelfReview() { + return this.selfReview; + } + + public void setSelfReview(String selfReview) { + this.selfReview = selfReview; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getProcessId() { + return this.processId; + } + + public void setProcessId(String processId) { + this.processId = processId; + } + + public Boolean getConvertedViaBpm() { + return this.convertedViaBpm; + } + + public void setConvertedViaBpm(Boolean convertedViaBpm) { + this.convertedViaBpm = convertedViaBpm; + } + + public CustomFieldData[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(CustomFieldData[] customFields) { + this.customFields = customFields; + } + + public Enum getFinalAssessmentStatus() { + return this.finalAssessmentStatus; + } + + public void setFinalAssessmentStatus(Enum finalAssessmentStatus) { + this.finalAssessmentStatus = finalAssessmentStatus; + } + + public Enum getFinalAssessmentResult() { + return this.finalAssessmentResult; + } + + public void setFinalAssessmentResult(Enum finalAssessmentResult) { + this.finalAssessmentResult = finalAssessmentResult; + } + + public Double getFinalAssessmentScore() { + return this.finalAssessmentScore; + } + + public void setFinalAssessmentScore(Double finalAssessmentScore) { + this.finalAssessmentScore = finalAssessmentScore; + } + + public Enum getFinalAssessmentGrade() { + return this.finalAssessmentGrade; + } + + public void setFinalAssessmentGrade(Enum finalAssessmentGrade) { + this.finalAssessmentGrade = finalAssessmentGrade; + } + + public String getFinalAssessmentComment() { + return this.finalAssessmentComment; + } + + public void setFinalAssessmentComment(String finalAssessmentComment) { + this.finalAssessmentComment = finalAssessmentComment; + } + + public String getFinalAssessmentDetail() { + return this.finalAssessmentDetail; + } + + public void setFinalAssessmentDetail(String finalAssessmentDetail) { + this.finalAssessmentDetail = finalAssessmentDetail; + } + + public static class Builder { + /** + * 雇佣 ID + *

示例值:6893014062142064135 + */ + private String employmentId; + /** + * 试用期信息 ID + *

示例值:6893014062142064132 + */ + private String probationId; + /** + * 试用期开始日期 + *

示例值:2022-05-20 + */ + private String probationStartDate; + /** + * 试用期预计结束日期 + *

示例值:2022-05-28 + */ + private String probationExpectedEndDate; + /** + * 试用期实际结束日期 + *

示例值:2022-06-28 + */ + private String actualProbationEndDate; + /** + * 转正发起日期 + *

示例值:2022-07-28 + */ + private String initiatingTime; + /** + * 发起方 + *

示例值:hr_submission + */ + private Enum submissionType; + /** + * 转正发起人的雇佣 ID,当系统发起转正时该字段为空 + *

示例值:6893014062142061135 + */ + private String initiatorId; + /** + * 试用期状态 + *

示例值:converted + */ + private Enum probationStatus; + /** + * 员工自评 + *

示例值:符合预期 + */ + private String selfReview; + /** + * 备注 + *

示例值:高潜 + */ + private String notes; + /** + * 流程实例 ID + *

示例值:6893014062142164135 + */ + private String processId; + /** + * 是否通过 BPM 转正 + *

示例值:false + */ + private Boolean convertedViaBpm; + /** + * 自定义字段 + *

示例值: + */ + private CustomFieldData[] customFields; + /** + * 试用期考核最终状态 + *

示例值:completed + */ + private Enum finalAssessmentStatus; + /** + * 试用期考核最终结果 + *

示例值:approved + */ + private Enum finalAssessmentResult; + /** + * 试用期考核最终得分 + *

示例值:99.9 + */ + private Double finalAssessmentScore; + /** + * 试用期考核最终等级 + *

示例值:grade_a + */ + private Enum finalAssessmentGrade; + /** + * 试用期考核最终评语 + *

示例值:超出预期 + */ + private String finalAssessmentComment; + /** + * 最终考核结果页面超链接 + *

示例值:暂无示例 + */ + private String finalAssessmentDetail; + + /** + * 雇佣 ID + *

示例值:6893014062142064135 + * + * @param employmentId + * @return + */ + public Builder employmentId(String employmentId) { + this.employmentId = employmentId; + return this; + } + + + /** + * 试用期信息 ID + *

示例值:6893014062142064132 + * + * @param probationId + * @return + */ + public Builder probationId(String probationId) { + this.probationId = probationId; + return this; + } + + + /** + * 试用期开始日期 + *

示例值:2022-05-20 + * + * @param probationStartDate + * @return + */ + public Builder probationStartDate(String probationStartDate) { + this.probationStartDate = probationStartDate; + return this; + } + + + /** + * 试用期预计结束日期 + *

示例值:2022-05-28 + * + * @param probationExpectedEndDate + * @return + */ + public Builder probationExpectedEndDate(String probationExpectedEndDate) { + this.probationExpectedEndDate = probationExpectedEndDate; + return this; + } + + + /** + * 试用期实际结束日期 + *

示例值:2022-06-28 + * + * @param actualProbationEndDate + * @return + */ + public Builder actualProbationEndDate(String actualProbationEndDate) { + this.actualProbationEndDate = actualProbationEndDate; + return this; + } + + + /** + * 转正发起日期 + *

示例值:2022-07-28 + * + * @param initiatingTime + * @return + */ + public Builder initiatingTime(String initiatingTime) { + this.initiatingTime = initiatingTime; + return this; + } + + + /** + * 发起方 + *

示例值:hr_submission + * + * @param submissionType + * @return + */ + public Builder submissionType(Enum submissionType) { + this.submissionType = submissionType; + return this; + } + + + /** + * 转正发起人的雇佣 ID,当系统发起转正时该字段为空 + *

示例值:6893014062142061135 + * + * @param initiatorId + * @return + */ + public Builder initiatorId(String initiatorId) { + this.initiatorId = initiatorId; + return this; + } + + + /** + * 试用期状态 + *

示例值:converted + * + * @param probationStatus + * @return + */ + public Builder probationStatus(Enum probationStatus) { + this.probationStatus = probationStatus; + return this; + } + + + /** + * 员工自评 + *

示例值:符合预期 + * + * @param selfReview + * @return + */ + public Builder selfReview(String selfReview) { + this.selfReview = selfReview; + return this; + } + + + /** + * 备注 + *

示例值:高潜 + * + * @param notes + * @return + */ + public Builder notes(String notes) { + this.notes = notes; + return this; + } + + + /** + * 流程实例 ID + *

示例值:6893014062142164135 + * + * @param processId + * @return + */ + public Builder processId(String processId) { + this.processId = processId; + return this; + } + + + /** + * 是否通过 BPM 转正 + *

示例值:false + * + * @param convertedViaBpm + * @return + */ + public Builder convertedViaBpm(Boolean convertedViaBpm) { + this.convertedViaBpm = convertedViaBpm; + return this; + } + + + /** + * 自定义字段 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(CustomFieldData[] customFields) { + this.customFields = customFields; + return this; + } + + + /** + * 试用期考核最终状态 + *

示例值:completed + * + * @param finalAssessmentStatus + * @return + */ + public Builder finalAssessmentStatus(Enum finalAssessmentStatus) { + this.finalAssessmentStatus = finalAssessmentStatus; + return this; + } + + + /** + * 试用期考核最终结果 + *

示例值:approved + * + * @param finalAssessmentResult + * @return + */ + public Builder finalAssessmentResult(Enum finalAssessmentResult) { + this.finalAssessmentResult = finalAssessmentResult; + return this; + } + + + /** + * 试用期考核最终得分 + *

示例值:99.9 + * + * @param finalAssessmentScore + * @return + */ + public Builder finalAssessmentScore(Double finalAssessmentScore) { + this.finalAssessmentScore = finalAssessmentScore; + return this; + } + + + /** + * 试用期考核最终等级 + *

示例值:grade_a + * + * @param finalAssessmentGrade + * @return + */ + public Builder finalAssessmentGrade(Enum finalAssessmentGrade) { + this.finalAssessmentGrade = finalAssessmentGrade; + return this; + } + + + /** + * 试用期考核最终评语 + *

示例值:超出预期 + * + * @param finalAssessmentComment + * @return + */ + public Builder finalAssessmentComment(String finalAssessmentComment) { + this.finalAssessmentComment = finalAssessmentComment; + return this; + } + + + /** + * 最终考核结果页面超链接 + *

示例值:暂无示例 + * + * @param finalAssessmentDetail + * @return + */ + public Builder finalAssessmentDetail(String finalAssessmentDetail) { + this.finalAssessmentDetail = finalAssessmentDetail; + return this; + } + + + public ProbationInfoForSubmit build() { + return new ProbationInfoForSubmit(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProcessAbstractItem.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProcessAbstractItem.java new file mode 100644 index 000000000..553fed8a6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProcessAbstractItem.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class ProcessAbstractItem { + /** + * 摘要标题 + *

示例值: + */ + @SerializedName("name") + private DataengineI18n name; + /** + * 摘要值 + *

示例值: + */ + @SerializedName("value") + private DataengineI18n value; + + // builder 开始 + public ProcessAbstractItem() { + } + + public ProcessAbstractItem(Builder builder) { + /** + * 摘要标题 + *

示例值: + */ + this.name = builder.name; + /** + * 摘要值 + *

示例值: + */ + this.value = builder.value; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public DataengineI18n getName() { + return this.name; + } + + public void setName(DataengineI18n name) { + this.name = name; + } + + public DataengineI18n getValue() { + return this.value; + } + + public void setValue(DataengineI18n value) { + this.value = value; + } + + public static class Builder { + /** + * 摘要标题 + *

示例值: + */ + private DataengineI18n name; + /** + * 摘要值 + *

示例值: + */ + private DataengineI18n value; + + /** + * 摘要标题 + *

示例值: + * + * @param name + * @return + */ + public Builder name(DataengineI18n name) { + this.name = name; + return this; + } + + + /** + * 摘要值 + *

示例值: + * + * @param value + * @return + */ + public Builder value(DataengineI18n value) { + this.value = value; + return this; + } + + + public ProcessAbstractItem build() { + return new ProcessAbstractItem(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProcessCcItem.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProcessCcItem.java new file mode 100644 index 000000000..4e94be371 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProcessCcItem.java @@ -0,0 +1,259 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class ProcessCcItem { + /** + * 单据ID + *

示例值:7278949005675988535 + */ + @SerializedName("approver_id") + private String approverId; + /** + * 单据地址 + *

示例值: + */ + @SerializedName("links") + private ProcessLink links; + /** + * 抄送人ID + *

示例值:7124991993901827628 + */ + @SerializedName("operator_id") + private String operatorId; + /** + * 抄送人姓名 + *

示例值: + */ + @SerializedName("operator_name") + private DataengineI18n operatorName; + /** + * 节点名称 + *

示例值: + */ + @SerializedName("node_name") + private DataengineI18n nodeName; + /** + * 抄送时间,Unix毫秒时间戳 + *

示例值:1694769814036 + */ + @SerializedName("create_time") + private String createTime; + + // builder 开始 + public ProcessCcItem() { + } + + public ProcessCcItem(Builder builder) { + /** + * 单据ID + *

示例值:7278949005675988535 + */ + this.approverId = builder.approverId; + /** + * 单据地址 + *

示例值: + */ + this.links = builder.links; + /** + * 抄送人ID + *

示例值:7124991993901827628 + */ + this.operatorId = builder.operatorId; + /** + * 抄送人姓名 + *

示例值: + */ + this.operatorName = builder.operatorName; + /** + * 节点名称 + *

示例值: + */ + this.nodeName = builder.nodeName; + /** + * 抄送时间,Unix毫秒时间戳 + *

示例值:1694769814036 + */ + this.createTime = builder.createTime; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getApproverId() { + return this.approverId; + } + + public void setApproverId(String approverId) { + this.approverId = approverId; + } + + public ProcessLink getLinks() { + return this.links; + } + + public void setLinks(ProcessLink links) { + this.links = links; + } + + public String getOperatorId() { + return this.operatorId; + } + + public void setOperatorId(String operatorId) { + this.operatorId = operatorId; + } + + public DataengineI18n getOperatorName() { + return this.operatorName; + } + + public void setOperatorName(DataengineI18n operatorName) { + this.operatorName = operatorName; + } + + public DataengineI18n getNodeName() { + return this.nodeName; + } + + public void setNodeName(DataengineI18n nodeName) { + this.nodeName = nodeName; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public static class Builder { + /** + * 单据ID + *

示例值:7278949005675988535 + */ + private String approverId; + /** + * 单据地址 + *

示例值: + */ + private ProcessLink links; + /** + * 抄送人ID + *

示例值:7124991993901827628 + */ + private String operatorId; + /** + * 抄送人姓名 + *

示例值: + */ + private DataengineI18n operatorName; + /** + * 节点名称 + *

示例值: + */ + private DataengineI18n nodeName; + /** + * 抄送时间,Unix毫秒时间戳 + *

示例值:1694769814036 + */ + private String createTime; + + /** + * 单据ID + *

示例值:7278949005675988535 + * + * @param approverId + * @return + */ + public Builder approverId(String approverId) { + this.approverId = approverId; + return this; + } + + + /** + * 单据地址 + *

示例值: + * + * @param links + * @return + */ + public Builder links(ProcessLink links) { + this.links = links; + return this; + } + + + /** + * 抄送人ID + *

示例值:7124991993901827628 + * + * @param operatorId + * @return + */ + public Builder operatorId(String operatorId) { + this.operatorId = operatorId; + return this; + } + + + /** + * 抄送人姓名 + *

示例值: + * + * @param operatorName + * @return + */ + public Builder operatorName(DataengineI18n operatorName) { + this.operatorName = operatorName; + return this; + } + + + /** + * 节点名称 + *

示例值: + * + * @param nodeName + * @return + */ + public Builder nodeName(DataengineI18n nodeName) { + this.nodeName = nodeName; + return this; + } + + + /** + * 抄送时间,Unix毫秒时间戳 + *

示例值:1694769814036 + * + * @param createTime + * @return + */ + public Builder createTime(String createTime) { + this.createTime = createTime; + return this; + } + + + public ProcessCcItem build() { + return new ProcessCcItem(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProcessDoneItem.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProcessDoneItem.java new file mode 100644 index 000000000..cec6bfebc --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProcessDoneItem.java @@ -0,0 +1,394 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class ProcessDoneItem { + /** + * 单据ID + *

示例值:7278949005675988535 + */ + @SerializedName("approver_id") + private String approverId; + /** + * 单据类型 + *

示例值:1 + */ + @SerializedName("type") + private Integer type; + /** + * 单据状态 + *

示例值:3 + */ + @SerializedName("status") + private Integer status; + /** + * 单据地址 + *

示例值: + */ + @SerializedName("links") + private ProcessLink links; + /** + * 操作人ID + *

示例值:7124991993901827628 + */ + @SerializedName("operator_id") + private String operatorId; + /** + * 操作人姓名 + *

示例值: + */ + @SerializedName("operator_name") + private DataengineI18n operatorName; + /** + * 节点名称 + *

示例值: + */ + @SerializedName("node_name") + private DataengineI18n nodeName; + /** + * 创建时间,Unix毫秒时间戳 + *

示例值:1694769814036 + */ + @SerializedName("create_time") + private String createTime; + /** + * 完成时间,Unix毫秒时间戳 + *

示例值:1694769814036 + */ + @SerializedName("complete_time") + private String completeTime; + + // builder 开始 + public ProcessDoneItem() { + } + + public ProcessDoneItem(Builder builder) { + /** + * 单据ID + *

示例值:7278949005675988535 + */ + this.approverId = builder.approverId; + /** + * 单据类型 + *

示例值:1 + */ + this.type = builder.type; + /** + * 单据状态 + *

示例值:3 + */ + this.status = builder.status; + /** + * 单据地址 + *

示例值: + */ + this.links = builder.links; + /** + * 操作人ID + *

示例值:7124991993901827628 + */ + this.operatorId = builder.operatorId; + /** + * 操作人姓名 + *

示例值: + */ + this.operatorName = builder.operatorName; + /** + * 节点名称 + *

示例值: + */ + this.nodeName = builder.nodeName; + /** + * 创建时间,Unix毫秒时间戳 + *

示例值:1694769814036 + */ + this.createTime = builder.createTime; + /** + * 完成时间,Unix毫秒时间戳 + *

示例值:1694769814036 + */ + this.completeTime = builder.completeTime; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getApproverId() { + return this.approverId; + } + + public void setApproverId(String approverId) { + this.approverId = approverId; + } + + public Integer getType() { + return this.type; + } + + public void setType(Integer type) { + this.type = type; + } + + public Integer getStatus() { + return this.status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public ProcessLink getLinks() { + return this.links; + } + + public void setLinks(ProcessLink links) { + this.links = links; + } + + public String getOperatorId() { + return this.operatorId; + } + + public void setOperatorId(String operatorId) { + this.operatorId = operatorId; + } + + public DataengineI18n getOperatorName() { + return this.operatorName; + } + + public void setOperatorName(DataengineI18n operatorName) { + this.operatorName = operatorName; + } + + public DataengineI18n getNodeName() { + return this.nodeName; + } + + public void setNodeName(DataengineI18n nodeName) { + this.nodeName = nodeName; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getCompleteTime() { + return this.completeTime; + } + + public void setCompleteTime(String completeTime) { + this.completeTime = completeTime; + } + + public static class Builder { + /** + * 单据ID + *

示例值:7278949005675988535 + */ + private String approverId; + /** + * 单据类型 + *

示例值:1 + */ + private Integer type; + /** + * 单据状态 + *

示例值:3 + */ + private Integer status; + /** + * 单据地址 + *

示例值: + */ + private ProcessLink links; + /** + * 操作人ID + *

示例值:7124991993901827628 + */ + private String operatorId; + /** + * 操作人姓名 + *

示例值: + */ + private DataengineI18n operatorName; + /** + * 节点名称 + *

示例值: + */ + private DataengineI18n nodeName; + /** + * 创建时间,Unix毫秒时间戳 + *

示例值:1694769814036 + */ + private String createTime; + /** + * 完成时间,Unix毫秒时间戳 + *

示例值:1694769814036 + */ + private String completeTime; + + /** + * 单据ID + *

示例值:7278949005675988535 + * + * @param approverId + * @return + */ + public Builder approverId(String approverId) { + this.approverId = approverId; + return this; + } + + + /** + * 单据类型 + *

示例值:1 + * + * @param type + * @return + */ + public Builder type(Integer type) { + this.type = type; + return this; + } + + /** + * 单据类型 + *

示例值:1 + * + * @param type {@link com.lark.oapi.service.corehr.v2.enums.ProcessDoneItemApproverTypeEnum} + * @return + */ + public Builder type(com.lark.oapi.service.corehr.v2.enums.ProcessDoneItemApproverTypeEnum type) { + this.type = type.getValue(); + return this; + } + + + /** + * 单据状态 + *

示例值:3 + * + * @param status + * @return + */ + public Builder status(Integer status) { + this.status = status; + return this; + } + + /** + * 单据状态 + *

示例值:3 + * + * @param status {@link com.lark.oapi.service.corehr.v2.enums.ProcessDoneItemApproverStatusEnum} + * @return + */ + public Builder status(com.lark.oapi.service.corehr.v2.enums.ProcessDoneItemApproverStatusEnum status) { + this.status = status.getValue(); + return this; + } + + + /** + * 单据地址 + *

示例值: + * + * @param links + * @return + */ + public Builder links(ProcessLink links) { + this.links = links; + return this; + } + + + /** + * 操作人ID + *

示例值:7124991993901827628 + * + * @param operatorId + * @return + */ + public Builder operatorId(String operatorId) { + this.operatorId = operatorId; + return this; + } + + + /** + * 操作人姓名 + *

示例值: + * + * @param operatorName + * @return + */ + public Builder operatorName(DataengineI18n operatorName) { + this.operatorName = operatorName; + return this; + } + + + /** + * 节点名称 + *

示例值: + * + * @param nodeName + * @return + */ + public Builder nodeName(DataengineI18n nodeName) { + this.nodeName = nodeName; + return this; + } + + + /** + * 创建时间,Unix毫秒时间戳 + *

示例值:1694769814036 + * + * @param createTime + * @return + */ + public Builder createTime(String createTime) { + this.createTime = createTime; + return this; + } + + + /** + * 完成时间,Unix毫秒时间戳 + *

示例值:1694769814036 + * + * @param completeTime + * @return + */ + public Builder completeTime(String completeTime) { + this.completeTime = completeTime; + return this; + } + + + public ProcessDoneItem build() { + return new ProcessDoneItem(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProcessLink.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProcessLink.java new file mode 100644 index 000000000..93cc3ac22 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProcessLink.java @@ -0,0 +1,148 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class ProcessLink { + /** + * web端单据详情页地址 + *

示例值:http://xxxx.com/xxx/xxx?a=b + */ + @SerializedName("web_link") + private String webLink; + /** + * 飞书pc端单据详情页地址 + *

示例值:https://applink.feishu.cn/client/mini_program/open?appId=xxx + */ + @SerializedName("pc_link") + private String pcLink; + /** + * 飞书移动端单据详情页地址 + *

示例值:https://applink.feishu.cn/client/mini_program/open?appId=xxx + */ + @SerializedName("mobile_link") + private String mobileLink; + + // builder 开始 + public ProcessLink() { + } + + public ProcessLink(Builder builder) { + /** + * web端单据详情页地址 + *

示例值:http://xxxx.com/xxx/xxx?a=b + */ + this.webLink = builder.webLink; + /** + * 飞书pc端单据详情页地址 + *

示例值:https://applink.feishu.cn/client/mini_program/open?appId=xxx + */ + this.pcLink = builder.pcLink; + /** + * 飞书移动端单据详情页地址 + *

示例值:https://applink.feishu.cn/client/mini_program/open?appId=xxx + */ + this.mobileLink = builder.mobileLink; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getWebLink() { + return this.webLink; + } + + public void setWebLink(String webLink) { + this.webLink = webLink; + } + + public String getPcLink() { + return this.pcLink; + } + + public void setPcLink(String pcLink) { + this.pcLink = pcLink; + } + + public String getMobileLink() { + return this.mobileLink; + } + + public void setMobileLink(String mobileLink) { + this.mobileLink = mobileLink; + } + + public static class Builder { + /** + * web端单据详情页地址 + *

示例值:http://xxxx.com/xxx/xxx?a=b + */ + private String webLink; + /** + * 飞书pc端单据详情页地址 + *

示例值:https://applink.feishu.cn/client/mini_program/open?appId=xxx + */ + private String pcLink; + /** + * 飞书移动端单据详情页地址 + *

示例值:https://applink.feishu.cn/client/mini_program/open?appId=xxx + */ + private String mobileLink; + + /** + * web端单据详情页地址 + *

示例值:http://xxxx.com/xxx/xxx?a=b + * + * @param webLink + * @return + */ + public Builder webLink(String webLink) { + this.webLink = webLink; + return this; + } + + + /** + * 飞书pc端单据详情页地址 + *

示例值:https://applink.feishu.cn/client/mini_program/open?appId=xxx + * + * @param pcLink + * @return + */ + public Builder pcLink(String pcLink) { + this.pcLink = pcLink; + return this; + } + + + /** + * 飞书移动端单据详情页地址 + *

示例值:https://applink.feishu.cn/client/mini_program/open?appId=xxx + * + * @param mobileLink + * @return + */ + public Builder mobileLink(String mobileLink) { + this.mobileLink = mobileLink; + return this; + } + + + public ProcessLink build() { + return new ProcessLink(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProcessTodoItem.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProcessTodoItem.java new file mode 100644 index 000000000..7286a00fd --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ProcessTodoItem.java @@ -0,0 +1,308 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class ProcessTodoItem { + /** + * 单据ID + *

示例值:7278949005675988535 + */ + @SerializedName("approver_id") + private String approverId; + /** + * 单据类型 + *

示例值:1 + */ + @SerializedName("type") + private Integer type; + /** + * 单据地址 + *

示例值: + */ + @SerializedName("links") + private ProcessLink links; + /** + * 操作人ID + *

示例值:7124991993901827628 + */ + @SerializedName("operator_id") + private String operatorId; + /** + * 操作人姓名 + *

示例值: + */ + @SerializedName("operator_name") + private DataengineI18n operatorName; + /** + * 节点名称 + *

示例值: + */ + @SerializedName("node_name") + private DataengineI18n nodeName; + /** + * 创建时间,Unix毫秒时间戳 + *

示例值:1694769814036 + */ + @SerializedName("create_time") + private String createTime; + + // builder 开始 + public ProcessTodoItem() { + } + + public ProcessTodoItem(Builder builder) { + /** + * 单据ID + *

示例值:7278949005675988535 + */ + this.approverId = builder.approverId; + /** + * 单据类型 + *

示例值:1 + */ + this.type = builder.type; + /** + * 单据地址 + *

示例值: + */ + this.links = builder.links; + /** + * 操作人ID + *

示例值:7124991993901827628 + */ + this.operatorId = builder.operatorId; + /** + * 操作人姓名 + *

示例值: + */ + this.operatorName = builder.operatorName; + /** + * 节点名称 + *

示例值: + */ + this.nodeName = builder.nodeName; + /** + * 创建时间,Unix毫秒时间戳 + *

示例值:1694769814036 + */ + this.createTime = builder.createTime; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getApproverId() { + return this.approverId; + } + + public void setApproverId(String approverId) { + this.approverId = approverId; + } + + public Integer getType() { + return this.type; + } + + public void setType(Integer type) { + this.type = type; + } + + public ProcessLink getLinks() { + return this.links; + } + + public void setLinks(ProcessLink links) { + this.links = links; + } + + public String getOperatorId() { + return this.operatorId; + } + + public void setOperatorId(String operatorId) { + this.operatorId = operatorId; + } + + public DataengineI18n getOperatorName() { + return this.operatorName; + } + + public void setOperatorName(DataengineI18n operatorName) { + this.operatorName = operatorName; + } + + public DataengineI18n getNodeName() { + return this.nodeName; + } + + public void setNodeName(DataengineI18n nodeName) { + this.nodeName = nodeName; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public static class Builder { + /** + * 单据ID + *

示例值:7278949005675988535 + */ + private String approverId; + /** + * 单据类型 + *

示例值:1 + */ + private Integer type; + /** + * 单据地址 + *

示例值: + */ + private ProcessLink links; + /** + * 操作人ID + *

示例值:7124991993901827628 + */ + private String operatorId; + /** + * 操作人姓名 + *

示例值: + */ + private DataengineI18n operatorName; + /** + * 节点名称 + *

示例值: + */ + private DataengineI18n nodeName; + /** + * 创建时间,Unix毫秒时间戳 + *

示例值:1694769814036 + */ + private String createTime; + + /** + * 单据ID + *

示例值:7278949005675988535 + * + * @param approverId + * @return + */ + public Builder approverId(String approverId) { + this.approverId = approverId; + return this; + } + + + /** + * 单据类型 + *

示例值:1 + * + * @param type + * @return + */ + public Builder type(Integer type) { + this.type = type; + return this; + } + + /** + * 单据类型 + *

示例值:1 + * + * @param type {@link com.lark.oapi.service.corehr.v2.enums.ProcessTodoItemApproverTypeEnum} + * @return + */ + public Builder type(com.lark.oapi.service.corehr.v2.enums.ProcessTodoItemApproverTypeEnum type) { + this.type = type.getValue(); + return this; + } + + + /** + * 单据地址 + *

示例值: + * + * @param links + * @return + */ + public Builder links(ProcessLink links) { + this.links = links; + return this; + } + + + /** + * 操作人ID + *

示例值:7124991993901827628 + * + * @param operatorId + * @return + */ + public Builder operatorId(String operatorId) { + this.operatorId = operatorId; + return this; + } + + + /** + * 操作人姓名 + *

示例值: + * + * @param operatorName + * @return + */ + public Builder operatorName(DataengineI18n operatorName) { + this.operatorName = operatorName; + return this; + } + + + /** + * 节点名称 + *

示例值: + * + * @param nodeName + * @return + */ + public Builder nodeName(DataengineI18n nodeName) { + this.nodeName = nodeName; + return this; + } + + + /** + * 创建时间,Unix毫秒时间戳 + *

示例值:1694769814036 + * + * @param createTime + * @return + */ + public Builder createTime(String createTime) { + this.createTime = createTime; + return this; + } + + + public ProcessTodoItem build() { + return new ProcessTodoItem(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/QueryEmployeesJobDataReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/QueryEmployeesJobDataReq.java new file mode 100644 index 000000000..e23f0fee5 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/QueryEmployeesJobDataReq.java @@ -0,0 +1,222 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Query; + +public class QueryEmployeesJobDataReq { + /** + * 分页大小,最大 100 + *

示例值:100 + */ + @Query + @SerializedName("page_size") + private Integer pageSize; + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:6891251722631890445 + */ + @Query + @SerializedName("page_token") + private String pageToken; + /** + * 用户 ID 类型 + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:people_corehr_department_id + */ + @Query + @SerializedName("department_id_type") + private String departmentIdType; + @Body + private QueryEmployeesJobDataReqBody body; + + // builder 开始 + public QueryEmployeesJobDataReq() { + } + + public QueryEmployeesJobDataReq(Builder builder) { + /** + * 分页大小,最大 100 + *

示例值:100 + */ + this.pageSize = builder.pageSize; + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:6891251722631890445 + */ + this.pageToken = builder.pageToken; + /** + * 用户 ID 类型 + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:people_corehr_department_id + */ + this.departmentIdType = builder.departmentIdType; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Integer getPageSize() { + return this.pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getDepartmentIdType() { + return this.departmentIdType; + } + + public void setDepartmentIdType(String departmentIdType) { + this.departmentIdType = departmentIdType; + } + + public QueryEmployeesJobDataReqBody getQueryEmployeesJobDataReqBody() { + return this.body; + } + + public void setQueryEmployeesJobDataReqBody(QueryEmployeesJobDataReqBody body) { + this.body = body; + } + + public static class Builder { + private Integer pageSize; // 分页大小,最大 100 + private String pageToken; // 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + private String userIdType; // 用户 ID 类型 + private String departmentIdType; // 此次调用中使用的部门 ID 类型 + private QueryEmployeesJobDataReqBody body; + + /** + * 分页大小,最大 100 + *

示例值:100 + * + * @param pageSize + * @return + */ + public Builder pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:6891251722631890445 + * + * @param pageToken + * @return + */ + public Builder pageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + /** + * 用户 ID 类型 + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 用户 ID 类型 + *

示例值:open_id + * + * @param userIdType {@link com.lark.oapi.service.corehr.v2.enums.QueryEmployeesJobDataUserIdTypeEnum} + * @return + */ + public Builder userIdType(com.lark.oapi.service.corehr.v2.enums.QueryEmployeesJobDataUserIdTypeEnum userIdType) { + this.userIdType = userIdType.getValue(); + return this; + } + + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:people_corehr_department_id + * + * @param departmentIdType + * @return + */ + public Builder departmentIdType(String departmentIdType) { + this.departmentIdType = departmentIdType; + return this; + } + + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:people_corehr_department_id + * + * @param departmentIdType {@link com.lark.oapi.service.corehr.v2.enums.QueryEmployeesJobDataDepartmentIdTypeEnum} + * @return + */ + public Builder departmentIdType(com.lark.oapi.service.corehr.v2.enums.QueryEmployeesJobDataDepartmentIdTypeEnum departmentIdType) { + this.departmentIdType = departmentIdType.getValue(); + return this; + } + + public QueryEmployeesJobDataReqBody getQueryEmployeesJobDataReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder queryEmployeesJobDataReqBody(QueryEmployeesJobDataReqBody body) { + this.body = body; + return this; + } + + public QueryEmployeesJobDataReq build() { + return new QueryEmployeesJobDataReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/QueryEmployeesJobDataReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/QueryEmployeesJobDataReqBody.java new file mode 100644 index 000000000..ef5948147 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/QueryEmployeesJobDataReqBody.java @@ -0,0 +1,185 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class QueryEmployeesJobDataReqBody { + /** + * 是否获取所有任职记录,true 为获取员工所有版本的任职记录,false 为仅获取当前生效的任职记录,默认为 false + *

示例值:false + */ + @SerializedName("get_all_version") + private Boolean getAllVersion; + /** + * 查看数据日期 + *

示例值:2020-01-01 + */ + @SerializedName("data_date") + private String dataDate; + /** + * 生效日期 - 搜索范围开始 + *

示例值:2020-01-01 + */ + @SerializedName("effective_date_start") + private String effectiveDateStart; + /** + * 生效日期 - 搜索范围结束 + *

示例值:2020-01-01 + */ + @SerializedName("effective_date_end") + private String effectiveDateEnd; + + // builder 开始 + public QueryEmployeesJobDataReqBody() { + } + + public QueryEmployeesJobDataReqBody(Builder builder) { + /** + * 是否获取所有任职记录,true 为获取员工所有版本的任职记录,false 为仅获取当前生效的任职记录,默认为 false + *

示例值:false + */ + this.getAllVersion = builder.getAllVersion; + /** + * 查看数据日期 + *

示例值:2020-01-01 + */ + this.dataDate = builder.dataDate; + /** + * 生效日期 - 搜索范围开始 + *

示例值:2020-01-01 + */ + this.effectiveDateStart = builder.effectiveDateStart; + /** + * 生效日期 - 搜索范围结束 + *

示例值:2020-01-01 + */ + this.effectiveDateEnd = builder.effectiveDateEnd; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Boolean getGetAllVersion() { + return this.getAllVersion; + } + + public void setGetAllVersion(Boolean getAllVersion) { + this.getAllVersion = getAllVersion; + } + + public String getDataDate() { + return this.dataDate; + } + + public void setDataDate(String dataDate) { + this.dataDate = dataDate; + } + + public String getEffectiveDateStart() { + return this.effectiveDateStart; + } + + public void setEffectiveDateStart(String effectiveDateStart) { + this.effectiveDateStart = effectiveDateStart; + } + + public String getEffectiveDateEnd() { + return this.effectiveDateEnd; + } + + public void setEffectiveDateEnd(String effectiveDateEnd) { + this.effectiveDateEnd = effectiveDateEnd; + } + + public static class Builder { + /** + * 是否获取所有任职记录,true 为获取员工所有版本的任职记录,false 为仅获取当前生效的任职记录,默认为 false + *

示例值:false + */ + private Boolean getAllVersion; + /** + * 查看数据日期 + *

示例值:2020-01-01 + */ + private String dataDate; + /** + * 生效日期 - 搜索范围开始 + *

示例值:2020-01-01 + */ + private String effectiveDateStart; + /** + * 生效日期 - 搜索范围结束 + *

示例值:2020-01-01 + */ + private String effectiveDateEnd; + + /** + * 是否获取所有任职记录,true 为获取员工所有版本的任职记录,false 为仅获取当前生效的任职记录,默认为 false + *

示例值:false + * + * @param getAllVersion + * @return + */ + public Builder getAllVersion(Boolean getAllVersion) { + this.getAllVersion = getAllVersion; + return this; + } + + + /** + * 查看数据日期 + *

示例值:2020-01-01 + * + * @param dataDate + * @return + */ + public Builder dataDate(String dataDate) { + this.dataDate = dataDate; + return this; + } + + + /** + * 生效日期 - 搜索范围开始 + *

示例值:2020-01-01 + * + * @param effectiveDateStart + * @return + */ + public Builder effectiveDateStart(String effectiveDateStart) { + this.effectiveDateStart = effectiveDateStart; + return this; + } + + + /** + * 生效日期 - 搜索范围结束 + *

示例值:2020-01-01 + * + * @param effectiveDateEnd + * @return + */ + public Builder effectiveDateEnd(String effectiveDateEnd) { + this.effectiveDateEnd = effectiveDateEnd; + return this; + } + + + public QueryEmployeesJobDataReqBody build() { + return new QueryEmployeesJobDataReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/QueryEmployeesJobDataResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/QueryEmployeesJobDataResp.java new file mode 100644 index 000000000..69634a3c4 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/QueryEmployeesJobDataResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class QueryEmployeesJobDataResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/QueryEmployeesJobDataRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/QueryEmployeesJobDataRespBody.java new file mode 100644 index 000000000..49f9ae1dd --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/QueryEmployeesJobDataRespBody.java @@ -0,0 +1,62 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class QueryEmployeesJobDataRespBody { + /** + * 任职信息 + *

示例值: + */ + @SerializedName("items") + private EmployeeJobData[] items; + /** + * 分页标记,当 has_more 为 true 时,会同时返回新的 page_token,否则不返回 page_token + *

示例值: + */ + @SerializedName("page_token") + private String pageToken; + /** + * 是否还有更多项 + *

示例值: + */ + @SerializedName("has_more") + private Boolean hasMore; + + public EmployeeJobData[] getItems() { + return this.items; + } + + public void setItems(EmployeeJobData[] items) { + this.items = items; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public Boolean getHasMore() { + return this.hasMore; + } + + public void setHasMore(Boolean hasMore) { + this.hasMore = hasMore; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ReorganizationInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ReorganizationInfo.java new file mode 100644 index 000000000..fbe468ae7 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ReorganizationInfo.java @@ -0,0 +1,740 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class ReorganizationInfo { + /** + * 原部门名称 + *

示例值: + */ + @SerializedName("original_department_names") + private I18n[] originalDepartmentNames; + /** + * 调整后部门名称 + *

示例值: + */ + @SerializedName("target_department_names") + private I18n[] targetDepartmentNames; + /** + * 原部门编码 + *

示例值:D00000456 + */ + @SerializedName("original_department_code") + private String originalDepartmentCode; + /** + * 调整后部门编码 + *

示例值:D00000456 + */ + @SerializedName("target_department_code") + private String targetDepartmentCode; + /** + * 原部门类型,枚举值可通过文档【飞书人事枚举常量】部门子类型(department_sub_type)枚举定义部分获得 + *

示例值: + */ + @SerializedName("original_sub_type") + private Enum originalSubType; + /** + * 调整后部门类型,枚举值可通过文档【飞书人事枚举常量】部门子类型(department_sub_type)枚举定义部分获得 + *

示例值: + */ + @SerializedName("target_sub_type") + private Enum targetSubType; + /** + * 原部门负责人 + *

示例值:6974648866876573198 + */ + @SerializedName("original_department_manager") + private String originalDepartmentManager; + /** + * 调整后部门负责人 + *

示例值:7013328578351842852 + */ + @SerializedName("target_department_manager") + private String targetDepartmentManager; + /** + * 原描述 + *

示例值: + */ + @SerializedName("original_descriptions") + private I18n[] originalDescriptions; + /** + * 调整后描述 + *

示例值: + */ + @SerializedName("target_descriptions") + private I18n[] targetDescriptions; + /** + * 原默认成本中心 + *

示例值: + */ + @SerializedName("original_cost_center") + private CostCenter originalCostCenter; + /** + * 调整后默认成本中心 + *

示例值: + */ + @SerializedName("target_cost_center") + private CostCenter targetCostCenter; + /** + * 原是否保密 + *

示例值:true + */ + @SerializedName("original_is_confidential") + private Boolean originalIsConfidential; + /** + * 调整后是否保密 + *

示例值:true + */ + @SerializedName("target_is_confidential") + private Boolean targetIsConfidential; + /** + * 原是否使用职务 + *

示例值:true + */ + @SerializedName("original_staffing_model") + private Boolean originalStaffingModel; + /** + * 调整后是否使用职务 + *

示例值:false + */ + @SerializedName("target_staffing_model") + private Boolean targetStaffingModel; + /** + * 原上级部门 + *

示例值:6974659700705068581 + */ + @SerializedName("original_parent_department_id") + private String originalParentDepartmentId; + /** + * 调整后上级部门 + *

示例值:6974659700705068581 + */ + @SerializedName("target_parent_department_id") + private String targetParentDepartmentId; + /** + * 自定义字段 + *

示例值: + */ + @SerializedName("custom_fields") + private ChangeFieldPair[] customFields; + + // builder 开始 + public ReorganizationInfo() { + } + + public ReorganizationInfo(Builder builder) { + /** + * 原部门名称 + *

示例值: + */ + this.originalDepartmentNames = builder.originalDepartmentNames; + /** + * 调整后部门名称 + *

示例值: + */ + this.targetDepartmentNames = builder.targetDepartmentNames; + /** + * 原部门编码 + *

示例值:D00000456 + */ + this.originalDepartmentCode = builder.originalDepartmentCode; + /** + * 调整后部门编码 + *

示例值:D00000456 + */ + this.targetDepartmentCode = builder.targetDepartmentCode; + /** + * 原部门类型,枚举值可通过文档【飞书人事枚举常量】部门子类型(department_sub_type)枚举定义部分获得 + *

示例值: + */ + this.originalSubType = builder.originalSubType; + /** + * 调整后部门类型,枚举值可通过文档【飞书人事枚举常量】部门子类型(department_sub_type)枚举定义部分获得 + *

示例值: + */ + this.targetSubType = builder.targetSubType; + /** + * 原部门负责人 + *

示例值:6974648866876573198 + */ + this.originalDepartmentManager = builder.originalDepartmentManager; + /** + * 调整后部门负责人 + *

示例值:7013328578351842852 + */ + this.targetDepartmentManager = builder.targetDepartmentManager; + /** + * 原描述 + *

示例值: + */ + this.originalDescriptions = builder.originalDescriptions; + /** + * 调整后描述 + *

示例值: + */ + this.targetDescriptions = builder.targetDescriptions; + /** + * 原默认成本中心 + *

示例值: + */ + this.originalCostCenter = builder.originalCostCenter; + /** + * 调整后默认成本中心 + *

示例值: + */ + this.targetCostCenter = builder.targetCostCenter; + /** + * 原是否保密 + *

示例值:true + */ + this.originalIsConfidential = builder.originalIsConfidential; + /** + * 调整后是否保密 + *

示例值:true + */ + this.targetIsConfidential = builder.targetIsConfidential; + /** + * 原是否使用职务 + *

示例值:true + */ + this.originalStaffingModel = builder.originalStaffingModel; + /** + * 调整后是否使用职务 + *

示例值:false + */ + this.targetStaffingModel = builder.targetStaffingModel; + /** + * 原上级部门 + *

示例值:6974659700705068581 + */ + this.originalParentDepartmentId = builder.originalParentDepartmentId; + /** + * 调整后上级部门 + *

示例值:6974659700705068581 + */ + this.targetParentDepartmentId = builder.targetParentDepartmentId; + /** + * 自定义字段 + *

示例值: + */ + this.customFields = builder.customFields; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public I18n[] getOriginalDepartmentNames() { + return this.originalDepartmentNames; + } + + public void setOriginalDepartmentNames(I18n[] originalDepartmentNames) { + this.originalDepartmentNames = originalDepartmentNames; + } + + public I18n[] getTargetDepartmentNames() { + return this.targetDepartmentNames; + } + + public void setTargetDepartmentNames(I18n[] targetDepartmentNames) { + this.targetDepartmentNames = targetDepartmentNames; + } + + public String getOriginalDepartmentCode() { + return this.originalDepartmentCode; + } + + public void setOriginalDepartmentCode(String originalDepartmentCode) { + this.originalDepartmentCode = originalDepartmentCode; + } + + public String getTargetDepartmentCode() { + return this.targetDepartmentCode; + } + + public void setTargetDepartmentCode(String targetDepartmentCode) { + this.targetDepartmentCode = targetDepartmentCode; + } + + public Enum getOriginalSubType() { + return this.originalSubType; + } + + public void setOriginalSubType(Enum originalSubType) { + this.originalSubType = originalSubType; + } + + public Enum getTargetSubType() { + return this.targetSubType; + } + + public void setTargetSubType(Enum targetSubType) { + this.targetSubType = targetSubType; + } + + public String getOriginalDepartmentManager() { + return this.originalDepartmentManager; + } + + public void setOriginalDepartmentManager(String originalDepartmentManager) { + this.originalDepartmentManager = originalDepartmentManager; + } + + public String getTargetDepartmentManager() { + return this.targetDepartmentManager; + } + + public void setTargetDepartmentManager(String targetDepartmentManager) { + this.targetDepartmentManager = targetDepartmentManager; + } + + public I18n[] getOriginalDescriptions() { + return this.originalDescriptions; + } + + public void setOriginalDescriptions(I18n[] originalDescriptions) { + this.originalDescriptions = originalDescriptions; + } + + public I18n[] getTargetDescriptions() { + return this.targetDescriptions; + } + + public void setTargetDescriptions(I18n[] targetDescriptions) { + this.targetDescriptions = targetDescriptions; + } + + public CostCenter getOriginalCostCenter() { + return this.originalCostCenter; + } + + public void setOriginalCostCenter(CostCenter originalCostCenter) { + this.originalCostCenter = originalCostCenter; + } + + public CostCenter getTargetCostCenter() { + return this.targetCostCenter; + } + + public void setTargetCostCenter(CostCenter targetCostCenter) { + this.targetCostCenter = targetCostCenter; + } + + public Boolean getOriginalIsConfidential() { + return this.originalIsConfidential; + } + + public void setOriginalIsConfidential(Boolean originalIsConfidential) { + this.originalIsConfidential = originalIsConfidential; + } + + public Boolean getTargetIsConfidential() { + return this.targetIsConfidential; + } + + public void setTargetIsConfidential(Boolean targetIsConfidential) { + this.targetIsConfidential = targetIsConfidential; + } + + public Boolean getOriginalStaffingModel() { + return this.originalStaffingModel; + } + + public void setOriginalStaffingModel(Boolean originalStaffingModel) { + this.originalStaffingModel = originalStaffingModel; + } + + public Boolean getTargetStaffingModel() { + return this.targetStaffingModel; + } + + public void setTargetStaffingModel(Boolean targetStaffingModel) { + this.targetStaffingModel = targetStaffingModel; + } + + public String getOriginalParentDepartmentId() { + return this.originalParentDepartmentId; + } + + public void setOriginalParentDepartmentId(String originalParentDepartmentId) { + this.originalParentDepartmentId = originalParentDepartmentId; + } + + public String getTargetParentDepartmentId() { + return this.targetParentDepartmentId; + } + + public void setTargetParentDepartmentId(String targetParentDepartmentId) { + this.targetParentDepartmentId = targetParentDepartmentId; + } + + public ChangeFieldPair[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(ChangeFieldPair[] customFields) { + this.customFields = customFields; + } + + public static class Builder { + /** + * 原部门名称 + *

示例值: + */ + private I18n[] originalDepartmentNames; + /** + * 调整后部门名称 + *

示例值: + */ + private I18n[] targetDepartmentNames; + /** + * 原部门编码 + *

示例值:D00000456 + */ + private String originalDepartmentCode; + /** + * 调整后部门编码 + *

示例值:D00000456 + */ + private String targetDepartmentCode; + /** + * 原部门类型,枚举值可通过文档【飞书人事枚举常量】部门子类型(department_sub_type)枚举定义部分获得 + *

示例值: + */ + private Enum originalSubType; + /** + * 调整后部门类型,枚举值可通过文档【飞书人事枚举常量】部门子类型(department_sub_type)枚举定义部分获得 + *

示例值: + */ + private Enum targetSubType; + /** + * 原部门负责人 + *

示例值:6974648866876573198 + */ + private String originalDepartmentManager; + /** + * 调整后部门负责人 + *

示例值:7013328578351842852 + */ + private String targetDepartmentManager; + /** + * 原描述 + *

示例值: + */ + private I18n[] originalDescriptions; + /** + * 调整后描述 + *

示例值: + */ + private I18n[] targetDescriptions; + /** + * 原默认成本中心 + *

示例值: + */ + private CostCenter originalCostCenter; + /** + * 调整后默认成本中心 + *

示例值: + */ + private CostCenter targetCostCenter; + /** + * 原是否保密 + *

示例值:true + */ + private Boolean originalIsConfidential; + /** + * 调整后是否保密 + *

示例值:true + */ + private Boolean targetIsConfidential; + /** + * 原是否使用职务 + *

示例值:true + */ + private Boolean originalStaffingModel; + /** + * 调整后是否使用职务 + *

示例值:false + */ + private Boolean targetStaffingModel; + /** + * 原上级部门 + *

示例值:6974659700705068581 + */ + private String originalParentDepartmentId; + /** + * 调整后上级部门 + *

示例值:6974659700705068581 + */ + private String targetParentDepartmentId; + /** + * 自定义字段 + *

示例值: + */ + private ChangeFieldPair[] customFields; + + /** + * 原部门名称 + *

示例值: + * + * @param originalDepartmentNames + * @return + */ + public Builder originalDepartmentNames(I18n[] originalDepartmentNames) { + this.originalDepartmentNames = originalDepartmentNames; + return this; + } + + + /** + * 调整后部门名称 + *

示例值: + * + * @param targetDepartmentNames + * @return + */ + public Builder targetDepartmentNames(I18n[] targetDepartmentNames) { + this.targetDepartmentNames = targetDepartmentNames; + return this; + } + + + /** + * 原部门编码 + *

示例值:D00000456 + * + * @param originalDepartmentCode + * @return + */ + public Builder originalDepartmentCode(String originalDepartmentCode) { + this.originalDepartmentCode = originalDepartmentCode; + return this; + } + + + /** + * 调整后部门编码 + *

示例值:D00000456 + * + * @param targetDepartmentCode + * @return + */ + public Builder targetDepartmentCode(String targetDepartmentCode) { + this.targetDepartmentCode = targetDepartmentCode; + return this; + } + + + /** + * 原部门类型,枚举值可通过文档【飞书人事枚举常量】部门子类型(department_sub_type)枚举定义部分获得 + *

示例值: + * + * @param originalSubType + * @return + */ + public Builder originalSubType(Enum originalSubType) { + this.originalSubType = originalSubType; + return this; + } + + + /** + * 调整后部门类型,枚举值可通过文档【飞书人事枚举常量】部门子类型(department_sub_type)枚举定义部分获得 + *

示例值: + * + * @param targetSubType + * @return + */ + public Builder targetSubType(Enum targetSubType) { + this.targetSubType = targetSubType; + return this; + } + + + /** + * 原部门负责人 + *

示例值:6974648866876573198 + * + * @param originalDepartmentManager + * @return + */ + public Builder originalDepartmentManager(String originalDepartmentManager) { + this.originalDepartmentManager = originalDepartmentManager; + return this; + } + + + /** + * 调整后部门负责人 + *

示例值:7013328578351842852 + * + * @param targetDepartmentManager + * @return + */ + public Builder targetDepartmentManager(String targetDepartmentManager) { + this.targetDepartmentManager = targetDepartmentManager; + return this; + } + + + /** + * 原描述 + *

示例值: + * + * @param originalDescriptions + * @return + */ + public Builder originalDescriptions(I18n[] originalDescriptions) { + this.originalDescriptions = originalDescriptions; + return this; + } + + + /** + * 调整后描述 + *

示例值: + * + * @param targetDescriptions + * @return + */ + public Builder targetDescriptions(I18n[] targetDescriptions) { + this.targetDescriptions = targetDescriptions; + return this; + } + + + /** + * 原默认成本中心 + *

示例值: + * + * @param originalCostCenter + * @return + */ + public Builder originalCostCenter(CostCenter originalCostCenter) { + this.originalCostCenter = originalCostCenter; + return this; + } + + + /** + * 调整后默认成本中心 + *

示例值: + * + * @param targetCostCenter + * @return + */ + public Builder targetCostCenter(CostCenter targetCostCenter) { + this.targetCostCenter = targetCostCenter; + return this; + } + + + /** + * 原是否保密 + *

示例值:true + * + * @param originalIsConfidential + * @return + */ + public Builder originalIsConfidential(Boolean originalIsConfidential) { + this.originalIsConfidential = originalIsConfidential; + return this; + } + + + /** + * 调整后是否保密 + *

示例值:true + * + * @param targetIsConfidential + * @return + */ + public Builder targetIsConfidential(Boolean targetIsConfidential) { + this.targetIsConfidential = targetIsConfidential; + return this; + } + + + /** + * 原是否使用职务 + *

示例值:true + * + * @param originalStaffingModel + * @return + */ + public Builder originalStaffingModel(Boolean originalStaffingModel) { + this.originalStaffingModel = originalStaffingModel; + return this; + } + + + /** + * 调整后是否使用职务 + *

示例值:false + * + * @param targetStaffingModel + * @return + */ + public Builder targetStaffingModel(Boolean targetStaffingModel) { + this.targetStaffingModel = targetStaffingModel; + return this; + } + + + /** + * 原上级部门 + *

示例值:6974659700705068581 + * + * @param originalParentDepartmentId + * @return + */ + public Builder originalParentDepartmentId(String originalParentDepartmentId) { + this.originalParentDepartmentId = originalParentDepartmentId; + return this; + } + + + /** + * 调整后上级部门 + *

示例值:6974659700705068581 + * + * @param targetParentDepartmentId + * @return + */ + public Builder targetParentDepartmentId(String targetParentDepartmentId) { + this.targetParentDepartmentId = targetParentDepartmentId; + return this; + } + + + /** + * 自定义字段 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(ChangeFieldPair[] customFields) { + this.customFields = customFields; + return this; + } + + + public ReorganizationInfo build() { + return new ReorganizationInfo(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ResidentTax.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ResidentTax.java new file mode 100644 index 000000000..92acaa10c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/ResidentTax.java @@ -0,0 +1,185 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class ResidentTax { + /** + * 年度 + *

示例值:2023 + */ + @SerializedName("year_resident_tax") + private String yearResidentTax; + /** + * -| 居民身份,枚举值 api_name 可通过【获取字段详情】接口查询,查询参数如下: - object_api_name = "resident_tax" - custom_api_name = "resident_status" + *

示例值: + */ + @SerializedName("resident_status") + private Enum residentStatus; + /** + * 国家/地区,可通过【查询国家/地区信息】 接口查询 + *

示例值:中国 + */ + @SerializedName("tax_country_region_id") + private String taxCountryRegionId; + /** + * 自定义字段 + *

示例值: + */ + @SerializedName("custom_fields") + private ObjectFieldData[] customFields; + + // builder 开始 + public ResidentTax() { + } + + public ResidentTax(Builder builder) { + /** + * 年度 + *

示例值:2023 + */ + this.yearResidentTax = builder.yearResidentTax; + /** + * -| 居民身份,枚举值 api_name 可通过【获取字段详情】接口查询,查询参数如下: - object_api_name = "resident_tax" - custom_api_name = "resident_status" + *

示例值: + */ + this.residentStatus = builder.residentStatus; + /** + * 国家/地区,可通过【查询国家/地区信息】 接口查询 + *

示例值:中国 + */ + this.taxCountryRegionId = builder.taxCountryRegionId; + /** + * 自定义字段 + *

示例值: + */ + this.customFields = builder.customFields; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getYearResidentTax() { + return this.yearResidentTax; + } + + public void setYearResidentTax(String yearResidentTax) { + this.yearResidentTax = yearResidentTax; + } + + public Enum getResidentStatus() { + return this.residentStatus; + } + + public void setResidentStatus(Enum residentStatus) { + this.residentStatus = residentStatus; + } + + public String getTaxCountryRegionId() { + return this.taxCountryRegionId; + } + + public void setTaxCountryRegionId(String taxCountryRegionId) { + this.taxCountryRegionId = taxCountryRegionId; + } + + public ObjectFieldData[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(ObjectFieldData[] customFields) { + this.customFields = customFields; + } + + public static class Builder { + /** + * 年度 + *

示例值:2023 + */ + private String yearResidentTax; + /** + * -| 居民身份,枚举值 api_name 可通过【获取字段详情】接口查询,查询参数如下: - object_api_name = "resident_tax" - custom_api_name = "resident_status" + *

示例值: + */ + private Enum residentStatus; + /** + * 国家/地区,可通过【查询国家/地区信息】 接口查询 + *

示例值:中国 + */ + private String taxCountryRegionId; + /** + * 自定义字段 + *

示例值: + */ + private ObjectFieldData[] customFields; + + /** + * 年度 + *

示例值:2023 + * + * @param yearResidentTax + * @return + */ + public Builder yearResidentTax(String yearResidentTax) { + this.yearResidentTax = yearResidentTax; + return this; + } + + + /** + * -| 居民身份,枚举值 api_name 可通过【获取字段详情】接口查询,查询参数如下: - object_api_name = "resident_tax" - custom_api_name = "resident_status" + *

示例值: + * + * @param residentStatus + * @return + */ + public Builder residentStatus(Enum residentStatus) { + this.residentStatus = residentStatus; + return this; + } + + + /** + * 国家/地区,可通过【查询国家/地区信息】 接口查询 + *

示例值:中国 + * + * @param taxCountryRegionId + * @return + */ + public Builder taxCountryRegionId(String taxCountryRegionId) { + this.taxCountryRegionId = taxCountryRegionId; + return this; + } + + + /** + * 自定义字段 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(ObjectFieldData[] customFields) { + this.customFields = customFields; + return this; + } + + + public ResidentTax build() { + return new ResidentTax(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchContractReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchContractReq.java new file mode 100644 index 000000000..4c316ded7 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchContractReq.java @@ -0,0 +1,177 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Query; + +public class SearchContractReq { + /** + * 分页大小,最大 100 + *

示例值:100 + */ + @Query + @SerializedName("page_size") + private Integer pageSize; + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:6891251722631890445 + */ + @Query + @SerializedName("page_token") + private String pageToken; + /** + * 用户 ID 类型 + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + @Body + private SearchContractReqBody body; + + // builder 开始 + public SearchContractReq() { + } + + public SearchContractReq(Builder builder) { + /** + * 分页大小,最大 100 + *

示例值:100 + */ + this.pageSize = builder.pageSize; + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:6891251722631890445 + */ + this.pageToken = builder.pageToken; + /** + * 用户 ID 类型 + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Integer getPageSize() { + return this.pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public SearchContractReqBody getSearchContractReqBody() { + return this.body; + } + + public void setSearchContractReqBody(SearchContractReqBody body) { + this.body = body; + } + + public static class Builder { + private Integer pageSize; // 分页大小,最大 100 + private String pageToken; // 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + private String userIdType; // 用户 ID 类型 + private SearchContractReqBody body; + + /** + * 分页大小,最大 100 + *

示例值:100 + * + * @param pageSize + * @return + */ + public Builder pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:6891251722631890445 + * + * @param pageToken + * @return + */ + public Builder pageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + /** + * 用户 ID 类型 + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 用户 ID 类型 + *

示例值:open_id + * + * @param userIdType {@link com.lark.oapi.service.corehr.v2.enums.SearchContractUserIdTypeEnum} + * @return + */ + public Builder userIdType(com.lark.oapi.service.corehr.v2.enums.SearchContractUserIdTypeEnum userIdType) { + this.userIdType = userIdType.getValue(); + return this; + } + + public SearchContractReqBody getSearchContractReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder searchContractReqBody(SearchContractReqBody body) { + this.body = body; + return this; + } + + public SearchContractReq build() { + return new SearchContractReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchContractReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchContractReqBody.java new file mode 100644 index 000000000..a567d9c4d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchContractReqBody.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class SearchContractReqBody { + /** + * 雇佣 ID 列表 + *

示例值: + */ + @SerializedName("employment_id_list") + private String[] employmentIdList; + /** + * 合同ID列表 + *

示例值: + */ + @SerializedName("contract_id_list") + private String[] contractIdList; + + // builder 开始 + public SearchContractReqBody() { + } + + public SearchContractReqBody(Builder builder) { + /** + * 雇佣 ID 列表 + *

示例值: + */ + this.employmentIdList = builder.employmentIdList; + /** + * 合同ID列表 + *

示例值: + */ + this.contractIdList = builder.contractIdList; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String[] getEmploymentIdList() { + return this.employmentIdList; + } + + public void setEmploymentIdList(String[] employmentIdList) { + this.employmentIdList = employmentIdList; + } + + public String[] getContractIdList() { + return this.contractIdList; + } + + public void setContractIdList(String[] contractIdList) { + this.contractIdList = contractIdList; + } + + public static class Builder { + /** + * 雇佣 ID 列表 + *

示例值: + */ + private String[] employmentIdList; + /** + * 合同ID列表 + *

示例值: + */ + private String[] contractIdList; + + /** + * 雇佣 ID 列表 + *

示例值: + * + * @param employmentIdList + * @return + */ + public Builder employmentIdList(String[] employmentIdList) { + this.employmentIdList = employmentIdList; + return this; + } + + + /** + * 合同ID列表 + *

示例值: + * + * @param contractIdList + * @return + */ + public Builder contractIdList(String[] contractIdList) { + this.contractIdList = contractIdList; + return this; + } + + + public SearchContractReqBody build() { + return new SearchContractReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchContractResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchContractResp.java new file mode 100644 index 000000000..45aac9150 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchContractResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class SearchContractResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchContractRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchContractRespBody.java new file mode 100644 index 000000000..e7e6b16a4 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchContractRespBody.java @@ -0,0 +1,62 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class SearchContractRespBody { + /** + * 查询的合同信息 + *

示例值: + */ + @SerializedName("items") + private Contract[] items; + /** + * 下一页页码 + *

示例值: + */ + @SerializedName("page_token") + private String pageToken; + /** + * 是否有下一页 + *

示例值: + */ + @SerializedName("has_more") + private Boolean hasMore; + + public Contract[] getItems() { + return this.items; + } + + public void setItems(Contract[] items) { + this.items = items; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public Boolean getHasMore() { + return this.hasMore; + } + + public void setHasMore(Boolean hasMore) { + this.hasMore = hasMore; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchDepartmentReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchDepartmentReq.java new file mode 100644 index 000000000..68549ff99 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchDepartmentReq.java @@ -0,0 +1,222 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Query; + +public class SearchDepartmentReq { + /** + * 分页大小,最大 100 + *

示例值:100 + */ + @Query + @SerializedName("page_size") + private Integer pageSize; + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:6891251722631890445 + */ + @Query + @SerializedName("page_token") + private String pageToken; + /** + * 用户 ID 类型 + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + */ + @Query + @SerializedName("department_id_type") + private String departmentIdType; + @Body + private SearchDepartmentReqBody body; + + // builder 开始 + public SearchDepartmentReq() { + } + + public SearchDepartmentReq(Builder builder) { + /** + * 分页大小,最大 100 + *

示例值:100 + */ + this.pageSize = builder.pageSize; + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:6891251722631890445 + */ + this.pageToken = builder.pageToken; + /** + * 用户 ID 类型 + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + */ + this.departmentIdType = builder.departmentIdType; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Integer getPageSize() { + return this.pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getDepartmentIdType() { + return this.departmentIdType; + } + + public void setDepartmentIdType(String departmentIdType) { + this.departmentIdType = departmentIdType; + } + + public SearchDepartmentReqBody getSearchDepartmentReqBody() { + return this.body; + } + + public void setSearchDepartmentReqBody(SearchDepartmentReqBody body) { + this.body = body; + } + + public static class Builder { + private Integer pageSize; // 分页大小,最大 100 + private String pageToken; // 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + private String userIdType; // 用户 ID 类型 + private String departmentIdType; // 此次调用中使用的部门 ID 类型 + private SearchDepartmentReqBody body; + + /** + * 分页大小,最大 100 + *

示例值:100 + * + * @param pageSize + * @return + */ + public Builder pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:6891251722631890445 + * + * @param pageToken + * @return + */ + public Builder pageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + /** + * 用户 ID 类型 + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 用户 ID 类型 + *

示例值:open_id + * + * @param userIdType {@link com.lark.oapi.service.corehr.v2.enums.SearchDepartmentUserIdTypeEnum} + * @return + */ + public Builder userIdType(com.lark.oapi.service.corehr.v2.enums.SearchDepartmentUserIdTypeEnum userIdType) { + this.userIdType = userIdType.getValue(); + return this; + } + + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + * + * @param departmentIdType + * @return + */ + public Builder departmentIdType(String departmentIdType) { + this.departmentIdType = departmentIdType; + return this; + } + + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + * + * @param departmentIdType {@link com.lark.oapi.service.corehr.v2.enums.SearchDepartmentDepartmentIdTypeEnum} + * @return + */ + public Builder departmentIdType(com.lark.oapi.service.corehr.v2.enums.SearchDepartmentDepartmentIdTypeEnum departmentIdType) { + this.departmentIdType = departmentIdType.getValue(); + return this; + } + + public SearchDepartmentReqBody getSearchDepartmentReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder searchDepartmentReqBody(SearchDepartmentReqBody body) { + this.body = body; + return this; + } + + public SearchDepartmentReq build() { + return new SearchDepartmentReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchDepartmentReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchDepartmentReqBody.java new file mode 100644 index 000000000..03ffbfd6c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchDepartmentReqBody.java @@ -0,0 +1,333 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class SearchDepartmentReqBody { + /** + * 是否启用 + *

示例值:true + */ + @SerializedName("active") + private Boolean active; + /** + * 当通过上级部门 ID 查询时,填写 true 返回所有子部门,填写 false 只返回直接下级部门 + *

示例值:false + */ + @SerializedName("get_all_children") + private Boolean getAllChildren; + /** + * manager ID 列表;**字段权限要求:按照部门负责人搜索 (corehr:department.manager.search:read)** + *

示例值: + */ + @SerializedName("manager_list") + private String[] managerList; + /** + * 部门 ID 列表 + *

示例值: + */ + @SerializedName("department_id_list") + private String[] departmentIdList; + /** + * 部门名称列表,需精确匹配 + *

示例值: + */ + @SerializedName("name_list") + private String[] nameList; + /** + * 上级部门 ID ,可查询直接下级部门;**字段权限要求:按照上级部门搜索 (corehr:department.organize.search:read) ** + *

示例值:7094136522860922222 + */ + @SerializedName("parent_department_id") + private String parentDepartmentId; + /** + * 部门 code 列表 + *

示例值: + */ + @SerializedName("code_list") + private String[] codeList; + /** + * 返回数据的字段列表 + *

示例值: + */ + @SerializedName("fields") + private String[] fields; + + // builder 开始 + public SearchDepartmentReqBody() { + } + + public SearchDepartmentReqBody(Builder builder) { + /** + * 是否启用 + *

示例值:true + */ + this.active = builder.active; + /** + * 当通过上级部门 ID 查询时,填写 true 返回所有子部门,填写 false 只返回直接下级部门 + *

示例值:false + */ + this.getAllChildren = builder.getAllChildren; + /** + * manager ID 列表;**字段权限要求:按照部门负责人搜索 (corehr:department.manager.search:read)** + *

示例值: + */ + this.managerList = builder.managerList; + /** + * 部门 ID 列表 + *

示例值: + */ + this.departmentIdList = builder.departmentIdList; + /** + * 部门名称列表,需精确匹配 + *

示例值: + */ + this.nameList = builder.nameList; + /** + * 上级部门 ID ,可查询直接下级部门;**字段权限要求:按照上级部门搜索 (corehr:department.organize.search:read) ** + *

示例值:7094136522860922222 + */ + this.parentDepartmentId = builder.parentDepartmentId; + /** + * 部门 code 列表 + *

示例值: + */ + this.codeList = builder.codeList; + /** + * 返回数据的字段列表 + *

示例值: + */ + this.fields = builder.fields; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Boolean getActive() { + return this.active; + } + + public void setActive(Boolean active) { + this.active = active; + } + + public Boolean getGetAllChildren() { + return this.getAllChildren; + } + + public void setGetAllChildren(Boolean getAllChildren) { + this.getAllChildren = getAllChildren; + } + + public String[] getManagerList() { + return this.managerList; + } + + public void setManagerList(String[] managerList) { + this.managerList = managerList; + } + + public String[] getDepartmentIdList() { + return this.departmentIdList; + } + + public void setDepartmentIdList(String[] departmentIdList) { + this.departmentIdList = departmentIdList; + } + + public String[] getNameList() { + return this.nameList; + } + + public void setNameList(String[] nameList) { + this.nameList = nameList; + } + + public String getParentDepartmentId() { + return this.parentDepartmentId; + } + + public void setParentDepartmentId(String parentDepartmentId) { + this.parentDepartmentId = parentDepartmentId; + } + + public String[] getCodeList() { + return this.codeList; + } + + public void setCodeList(String[] codeList) { + this.codeList = codeList; + } + + public String[] getFields() { + return this.fields; + } + + public void setFields(String[] fields) { + this.fields = fields; + } + + public static class Builder { + /** + * 是否启用 + *

示例值:true + */ + private Boolean active; + /** + * 当通过上级部门 ID 查询时,填写 true 返回所有子部门,填写 false 只返回直接下级部门 + *

示例值:false + */ + private Boolean getAllChildren; + /** + * manager ID 列表;**字段权限要求:按照部门负责人搜索 (corehr:department.manager.search:read)** + *

示例值: + */ + private String[] managerList; + /** + * 部门 ID 列表 + *

示例值: + */ + private String[] departmentIdList; + /** + * 部门名称列表,需精确匹配 + *

示例值: + */ + private String[] nameList; + /** + * 上级部门 ID ,可查询直接下级部门;**字段权限要求:按照上级部门搜索 (corehr:department.organize.search:read) ** + *

示例值:7094136522860922222 + */ + private String parentDepartmentId; + /** + * 部门 code 列表 + *

示例值: + */ + private String[] codeList; + /** + * 返回数据的字段列表 + *

示例值: + */ + private String[] fields; + + /** + * 是否启用 + *

示例值:true + * + * @param active + * @return + */ + public Builder active(Boolean active) { + this.active = active; + return this; + } + + + /** + * 当通过上级部门 ID 查询时,填写 true 返回所有子部门,填写 false 只返回直接下级部门 + *

示例值:false + * + * @param getAllChildren + * @return + */ + public Builder getAllChildren(Boolean getAllChildren) { + this.getAllChildren = getAllChildren; + return this; + } + + + /** + * manager ID 列表;**字段权限要求:按照部门负责人搜索 (corehr:department.manager.search:read)** + *

示例值: + * + * @param managerList + * @return + */ + public Builder managerList(String[] managerList) { + this.managerList = managerList; + return this; + } + + + /** + * 部门 ID 列表 + *

示例值: + * + * @param departmentIdList + * @return + */ + public Builder departmentIdList(String[] departmentIdList) { + this.departmentIdList = departmentIdList; + return this; + } + + + /** + * 部门名称列表,需精确匹配 + *

示例值: + * + * @param nameList + * @return + */ + public Builder nameList(String[] nameList) { + this.nameList = nameList; + return this; + } + + + /** + * 上级部门 ID ,可查询直接下级部门;**字段权限要求:按照上级部门搜索 (corehr:department.organize.search:read) ** + *

示例值:7094136522860922222 + * + * @param parentDepartmentId + * @return + */ + public Builder parentDepartmentId(String parentDepartmentId) { + this.parentDepartmentId = parentDepartmentId; + return this; + } + + + /** + * 部门 code 列表 + *

示例值: + * + * @param codeList + * @return + */ + public Builder codeList(String[] codeList) { + this.codeList = codeList; + return this; + } + + + /** + * 返回数据的字段列表 + *

示例值: + * + * @param fields + * @return + */ + public Builder fields(String[] fields) { + this.fields = fields; + return this; + } + + + public SearchDepartmentReqBody build() { + return new SearchDepartmentReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchDepartmentResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchDepartmentResp.java new file mode 100644 index 000000000..433c2c26a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchDepartmentResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class SearchDepartmentResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchDepartmentRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchDepartmentRespBody.java new file mode 100644 index 000000000..22ffcd1f7 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchDepartmentRespBody.java @@ -0,0 +1,62 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class SearchDepartmentRespBody { + /** + * 查询的部门信息 + *

示例值: + */ + @SerializedName("items") + private Department[] items; + /** + * 下一页页码 + *

示例值: + */ + @SerializedName("page_token") + private String pageToken; + /** + * 是否有下一页 + *

示例值: + */ + @SerializedName("has_more") + private Boolean hasMore; + + public Department[] getItems() { + return this.items; + } + + public void setItems(Department[] items) { + this.items = items; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public Boolean getHasMore() { + return this.hasMore; + } + + public void setHasMore(Boolean hasMore) { + this.hasMore = hasMore; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchEmployeeReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchEmployeeReq.java new file mode 100644 index 000000000..968734d8b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchEmployeeReq.java @@ -0,0 +1,222 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Query; + +public class SearchEmployeeReq { + /** + * 分页大小,最大 100 + *

示例值:100 + */ + @Query + @SerializedName("page_size") + private Integer pageSize; + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:6891251722631890445 + */ + @Query + @SerializedName("page_token") + private String pageToken; + /** + * 用户 ID 类型 + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + */ + @Query + @SerializedName("department_id_type") + private String departmentIdType; + @Body + private SearchEmployeeReqBody body; + + // builder 开始 + public SearchEmployeeReq() { + } + + public SearchEmployeeReq(Builder builder) { + /** + * 分页大小,最大 100 + *

示例值:100 + */ + this.pageSize = builder.pageSize; + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:6891251722631890445 + */ + this.pageToken = builder.pageToken; + /** + * 用户 ID 类型 + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + */ + this.departmentIdType = builder.departmentIdType; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Integer getPageSize() { + return this.pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getDepartmentIdType() { + return this.departmentIdType; + } + + public void setDepartmentIdType(String departmentIdType) { + this.departmentIdType = departmentIdType; + } + + public SearchEmployeeReqBody getSearchEmployeeReqBody() { + return this.body; + } + + public void setSearchEmployeeReqBody(SearchEmployeeReqBody body) { + this.body = body; + } + + public static class Builder { + private Integer pageSize; // 分页大小,最大 100 + private String pageToken; // 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + private String userIdType; // 用户 ID 类型 + private String departmentIdType; // 此次调用中使用的部门 ID 类型 + private SearchEmployeeReqBody body; + + /** + * 分页大小,最大 100 + *

示例值:100 + * + * @param pageSize + * @return + */ + public Builder pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:6891251722631890445 + * + * @param pageToken + * @return + */ + public Builder pageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + /** + * 用户 ID 类型 + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 用户 ID 类型 + *

示例值:open_id + * + * @param userIdType {@link com.lark.oapi.service.corehr.v2.enums.SearchEmployeeUserIdTypeEnum} + * @return + */ + public Builder userIdType(com.lark.oapi.service.corehr.v2.enums.SearchEmployeeUserIdTypeEnum userIdType) { + this.userIdType = userIdType.getValue(); + return this; + } + + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + * + * @param departmentIdType + * @return + */ + public Builder departmentIdType(String departmentIdType) { + this.departmentIdType = departmentIdType; + return this; + } + + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + * + * @param departmentIdType {@link com.lark.oapi.service.corehr.v2.enums.SearchEmployeeDepartmentIdTypeEnum} + * @return + */ + public Builder departmentIdType(com.lark.oapi.service.corehr.v2.enums.SearchEmployeeDepartmentIdTypeEnum departmentIdType) { + this.departmentIdType = departmentIdType.getValue(); + return this; + } + + public SearchEmployeeReqBody getSearchEmployeeReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder searchEmployeeReqBody(SearchEmployeeReqBody body) { + this.body = body; + return this; + } + + public SearchEmployeeReq build() { + return new SearchEmployeeReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchEmployeeReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchEmployeeReqBody.java new file mode 100644 index 000000000..44cfd6d5d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchEmployeeReqBody.java @@ -0,0 +1,863 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class SearchEmployeeReqBody { + /** + * 返回数据的字段列表,填写方式:为空时默认仅返回 ID + *

示例值: + */ + @SerializedName("fields") + private String[] fields; + /** + * 雇佣 ID 列表 + *

示例值: + */ + @SerializedName("employment_id_list") + private String[] employmentIdList; + /** + * 工号列表 + *

示例值: + */ + @SerializedName("employee_number_list") + private String[] employeeNumberList; + /** + * 邮箱,精确匹配查询 + *

示例值:13312345678@qq.com + */ + @SerializedName("work_email") + private String workEmail; + /** + * 个人电话,精确匹配查询 + *

示例值:16760342300 + */ + @SerializedName("phone_number") + private String phoneNumber; + /** + * 搜索关键字,支持对邮箱、工号和姓名的模糊匹配 + *

示例值:张三 + */ + @SerializedName("key_word") + private String keyWord; + /** + * 雇佣状态 + *

示例值: + */ + @SerializedName("employment_status") + private String employmentStatus; + /** + * 人员类型 ID + *

示例值:6971090097697521314 + */ + @SerializedName("employee_type_id") + private String employeeTypeId; + /** + * 部门 ID,根据员工主职的直接部门查询,可以通过【查询部门】API 获取 部门 ID + *

示例值: + */ + @SerializedName("department_id_list") + private String[] departmentIdList; + /** + * 直接上级的雇佣 ID,根据员工主职的直接上级查询 + *

示例值:7027024823985447820 + */ + @SerializedName("direct_manager_id_list") + private String[] directManagerIdList; + /** + * 虚线上级的雇佣 ID,根据员工主职的虚线上级查询 + *

示例值:7027024823985117820 + */ + @SerializedName("dotted_line_manager_id_list") + private String[] dottedLineManagerIdList; + /** + * 转正式员工日期-搜索范围开始 + *

示例值:2020-01-01 + */ + @SerializedName("regular_employee_start_date_start") + private String regularEmployeeStartDateStart; + /** + * 转正式员工日期-搜索范围结束 + *

示例值:2020-01-01 + */ + @SerializedName("regular_employee_start_date_end") + private String regularEmployeeStartDateEnd; + /** + * 入职日期-搜索范围开始,需要与搜索范围结束一同使用 + *

示例值:2020-01-01 + */ + @SerializedName("effective_time_start") + private String effectiveTimeStart; + /** + * 入职日期-搜索范围结束 + *

示例值:2020-01-01 + */ + @SerializedName("effective_time_end") + private String effectiveTimeEnd; + /** + * 工作地点 ID 列表,查询属于该工作地点及下级工作地点的员工 + *

示例值: + */ + @SerializedName("work_location_id_list_include_sub") + private String[] workLocationIdListIncludeSub; + /** + * 常用英文全名精确搜索 + *

示例值: + */ + @SerializedName("preferred_english_full_name_list") + private String[] preferredEnglishFullNameList; + /** + * 常用本地全名精确搜索 + *

示例值: + */ + @SerializedName("preferred_local_full_name_list") + private String[] preferredLocalFullNameList; + /** + * 居民身份证件号码精确搜索 + *

示例值: + */ + @SerializedName("national_id_number_list") + private String[] nationalIdNumberList; + /** + * 个人电话列表,精确匹配查询 + *

示例值: + */ + @SerializedName("phone_number_list") + private String[] phoneNumberList; + /** + * 工作邮箱地址列表,精确匹配查询 + *

示例值: + */ + @SerializedName("email_address_list") + private String[] emailAddressList; + /** + * 部门 ID 列表,查询属于该部门及下级部门的员工 + *

示例值: + */ + @SerializedName("department_id_list_include_sub") + private String[] departmentIdListIncludeSub; + + // builder 开始 + public SearchEmployeeReqBody() { + } + + public SearchEmployeeReqBody(Builder builder) { + /** + * 返回数据的字段列表,填写方式:为空时默认仅返回 ID + *

示例值: + */ + this.fields = builder.fields; + /** + * 雇佣 ID 列表 + *

示例值: + */ + this.employmentIdList = builder.employmentIdList; + /** + * 工号列表 + *

示例值: + */ + this.employeeNumberList = builder.employeeNumberList; + /** + * 邮箱,精确匹配查询 + *

示例值:13312345678@qq.com + */ + this.workEmail = builder.workEmail; + /** + * 个人电话,精确匹配查询 + *

示例值:16760342300 + */ + this.phoneNumber = builder.phoneNumber; + /** + * 搜索关键字,支持对邮箱、工号和姓名的模糊匹配 + *

示例值:张三 + */ + this.keyWord = builder.keyWord; + /** + * 雇佣状态 + *

示例值: + */ + this.employmentStatus = builder.employmentStatus; + /** + * 人员类型 ID + *

示例值:6971090097697521314 + */ + this.employeeTypeId = builder.employeeTypeId; + /** + * 部门 ID,根据员工主职的直接部门查询,可以通过【查询部门】API 获取 部门 ID + *

示例值: + */ + this.departmentIdList = builder.departmentIdList; + /** + * 直接上级的雇佣 ID,根据员工主职的直接上级查询 + *

示例值:7027024823985447820 + */ + this.directManagerIdList = builder.directManagerIdList; + /** + * 虚线上级的雇佣 ID,根据员工主职的虚线上级查询 + *

示例值:7027024823985117820 + */ + this.dottedLineManagerIdList = builder.dottedLineManagerIdList; + /** + * 转正式员工日期-搜索范围开始 + *

示例值:2020-01-01 + */ + this.regularEmployeeStartDateStart = builder.regularEmployeeStartDateStart; + /** + * 转正式员工日期-搜索范围结束 + *

示例值:2020-01-01 + */ + this.regularEmployeeStartDateEnd = builder.regularEmployeeStartDateEnd; + /** + * 入职日期-搜索范围开始,需要与搜索范围结束一同使用 + *

示例值:2020-01-01 + */ + this.effectiveTimeStart = builder.effectiveTimeStart; + /** + * 入职日期-搜索范围结束 + *

示例值:2020-01-01 + */ + this.effectiveTimeEnd = builder.effectiveTimeEnd; + /** + * 工作地点 ID 列表,查询属于该工作地点及下级工作地点的员工 + *

示例值: + */ + this.workLocationIdListIncludeSub = builder.workLocationIdListIncludeSub; + /** + * 常用英文全名精确搜索 + *

示例值: + */ + this.preferredEnglishFullNameList = builder.preferredEnglishFullNameList; + /** + * 常用本地全名精确搜索 + *

示例值: + */ + this.preferredLocalFullNameList = builder.preferredLocalFullNameList; + /** + * 居民身份证件号码精确搜索 + *

示例值: + */ + this.nationalIdNumberList = builder.nationalIdNumberList; + /** + * 个人电话列表,精确匹配查询 + *

示例值: + */ + this.phoneNumberList = builder.phoneNumberList; + /** + * 工作邮箱地址列表,精确匹配查询 + *

示例值: + */ + this.emailAddressList = builder.emailAddressList; + /** + * 部门 ID 列表,查询属于该部门及下级部门的员工 + *

示例值: + */ + this.departmentIdListIncludeSub = builder.departmentIdListIncludeSub; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String[] getFields() { + return this.fields; + } + + public void setFields(String[] fields) { + this.fields = fields; + } + + public String[] getEmploymentIdList() { + return this.employmentIdList; + } + + public void setEmploymentIdList(String[] employmentIdList) { + this.employmentIdList = employmentIdList; + } + + public String[] getEmployeeNumberList() { + return this.employeeNumberList; + } + + public void setEmployeeNumberList(String[] employeeNumberList) { + this.employeeNumberList = employeeNumberList; + } + + public String getWorkEmail() { + return this.workEmail; + } + + public void setWorkEmail(String workEmail) { + this.workEmail = workEmail; + } + + public String getPhoneNumber() { + return this.phoneNumber; + } + + public void setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + public String getKeyWord() { + return this.keyWord; + } + + public void setKeyWord(String keyWord) { + this.keyWord = keyWord; + } + + public String getEmploymentStatus() { + return this.employmentStatus; + } + + public void setEmploymentStatus(String employmentStatus) { + this.employmentStatus = employmentStatus; + } + + public String getEmployeeTypeId() { + return this.employeeTypeId; + } + + public void setEmployeeTypeId(String employeeTypeId) { + this.employeeTypeId = employeeTypeId; + } + + public String[] getDepartmentIdList() { + return this.departmentIdList; + } + + public void setDepartmentIdList(String[] departmentIdList) { + this.departmentIdList = departmentIdList; + } + + public String[] getDirectManagerIdList() { + return this.directManagerIdList; + } + + public void setDirectManagerIdList(String[] directManagerIdList) { + this.directManagerIdList = directManagerIdList; + } + + public String[] getDottedLineManagerIdList() { + return this.dottedLineManagerIdList; + } + + public void setDottedLineManagerIdList(String[] dottedLineManagerIdList) { + this.dottedLineManagerIdList = dottedLineManagerIdList; + } + + public String getRegularEmployeeStartDateStart() { + return this.regularEmployeeStartDateStart; + } + + public void setRegularEmployeeStartDateStart(String regularEmployeeStartDateStart) { + this.regularEmployeeStartDateStart = regularEmployeeStartDateStart; + } + + public String getRegularEmployeeStartDateEnd() { + return this.regularEmployeeStartDateEnd; + } + + public void setRegularEmployeeStartDateEnd(String regularEmployeeStartDateEnd) { + this.regularEmployeeStartDateEnd = regularEmployeeStartDateEnd; + } + + public String getEffectiveTimeStart() { + return this.effectiveTimeStart; + } + + public void setEffectiveTimeStart(String effectiveTimeStart) { + this.effectiveTimeStart = effectiveTimeStart; + } + + public String getEffectiveTimeEnd() { + return this.effectiveTimeEnd; + } + + public void setEffectiveTimeEnd(String effectiveTimeEnd) { + this.effectiveTimeEnd = effectiveTimeEnd; + } + + public String[] getWorkLocationIdListIncludeSub() { + return this.workLocationIdListIncludeSub; + } + + public void setWorkLocationIdListIncludeSub(String[] workLocationIdListIncludeSub) { + this.workLocationIdListIncludeSub = workLocationIdListIncludeSub; + } + + public String[] getPreferredEnglishFullNameList() { + return this.preferredEnglishFullNameList; + } + + public void setPreferredEnglishFullNameList(String[] preferredEnglishFullNameList) { + this.preferredEnglishFullNameList = preferredEnglishFullNameList; + } + + public String[] getPreferredLocalFullNameList() { + return this.preferredLocalFullNameList; + } + + public void setPreferredLocalFullNameList(String[] preferredLocalFullNameList) { + this.preferredLocalFullNameList = preferredLocalFullNameList; + } + + public String[] getNationalIdNumberList() { + return this.nationalIdNumberList; + } + + public void setNationalIdNumberList(String[] nationalIdNumberList) { + this.nationalIdNumberList = nationalIdNumberList; + } + + public String[] getPhoneNumberList() { + return this.phoneNumberList; + } + + public void setPhoneNumberList(String[] phoneNumberList) { + this.phoneNumberList = phoneNumberList; + } + + public String[] getEmailAddressList() { + return this.emailAddressList; + } + + public void setEmailAddressList(String[] emailAddressList) { + this.emailAddressList = emailAddressList; + } + + public String[] getDepartmentIdListIncludeSub() { + return this.departmentIdListIncludeSub; + } + + public void setDepartmentIdListIncludeSub(String[] departmentIdListIncludeSub) { + this.departmentIdListIncludeSub = departmentIdListIncludeSub; + } + + public static class Builder { + /** + * 返回数据的字段列表,填写方式:为空时默认仅返回 ID + *

示例值: + */ + private String[] fields; + /** + * 雇佣 ID 列表 + *

示例值: + */ + private String[] employmentIdList; + /** + * 工号列表 + *

示例值: + */ + private String[] employeeNumberList; + /** + * 邮箱,精确匹配查询 + *

示例值:13312345678@qq.com + */ + private String workEmail; + /** + * 个人电话,精确匹配查询 + *

示例值:16760342300 + */ + private String phoneNumber; + /** + * 搜索关键字,支持对邮箱、工号和姓名的模糊匹配 + *

示例值:张三 + */ + private String keyWord; + /** + * 雇佣状态 + *

示例值: + */ + private String employmentStatus; + /** + * 人员类型 ID + *

示例值:6971090097697521314 + */ + private String employeeTypeId; + /** + * 部门 ID,根据员工主职的直接部门查询,可以通过【查询部门】API 获取 部门 ID + *

示例值: + */ + private String[] departmentIdList; + /** + * 直接上级的雇佣 ID,根据员工主职的直接上级查询 + *

示例值:7027024823985447820 + */ + private String[] directManagerIdList; + /** + * 虚线上级的雇佣 ID,根据员工主职的虚线上级查询 + *

示例值:7027024823985117820 + */ + private String[] dottedLineManagerIdList; + /** + * 转正式员工日期-搜索范围开始 + *

示例值:2020-01-01 + */ + private String regularEmployeeStartDateStart; + /** + * 转正式员工日期-搜索范围结束 + *

示例值:2020-01-01 + */ + private String regularEmployeeStartDateEnd; + /** + * 入职日期-搜索范围开始,需要与搜索范围结束一同使用 + *

示例值:2020-01-01 + */ + private String effectiveTimeStart; + /** + * 入职日期-搜索范围结束 + *

示例值:2020-01-01 + */ + private String effectiveTimeEnd; + /** + * 工作地点 ID 列表,查询属于该工作地点及下级工作地点的员工 + *

示例值: + */ + private String[] workLocationIdListIncludeSub; + /** + * 常用英文全名精确搜索 + *

示例值: + */ + private String[] preferredEnglishFullNameList; + /** + * 常用本地全名精确搜索 + *

示例值: + */ + private String[] preferredLocalFullNameList; + /** + * 居民身份证件号码精确搜索 + *

示例值: + */ + private String[] nationalIdNumberList; + /** + * 个人电话列表,精确匹配查询 + *

示例值: + */ + private String[] phoneNumberList; + /** + * 工作邮箱地址列表,精确匹配查询 + *

示例值: + */ + private String[] emailAddressList; + /** + * 部门 ID 列表,查询属于该部门及下级部门的员工 + *

示例值: + */ + private String[] departmentIdListIncludeSub; + + /** + * 返回数据的字段列表,填写方式:为空时默认仅返回 ID + *

示例值: + * + * @param fields + * @return + */ + public Builder fields(String[] fields) { + this.fields = fields; + return this; + } + + + /** + * 雇佣 ID 列表 + *

示例值: + * + * @param employmentIdList + * @return + */ + public Builder employmentIdList(String[] employmentIdList) { + this.employmentIdList = employmentIdList; + return this; + } + + + /** + * 工号列表 + *

示例值: + * + * @param employeeNumberList + * @return + */ + public Builder employeeNumberList(String[] employeeNumberList) { + this.employeeNumberList = employeeNumberList; + return this; + } + + + /** + * 邮箱,精确匹配查询 + *

示例值:13312345678@qq.com + * + * @param workEmail + * @return + */ + public Builder workEmail(String workEmail) { + this.workEmail = workEmail; + return this; + } + + + /** + * 个人电话,精确匹配查询 + *

示例值:16760342300 + * + * @param phoneNumber + * @return + */ + public Builder phoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + + /** + * 搜索关键字,支持对邮箱、工号和姓名的模糊匹配 + *

示例值:张三 + * + * @param keyWord + * @return + */ + public Builder keyWord(String keyWord) { + this.keyWord = keyWord; + return this; + } + + + /** + * 雇佣状态 + *

示例值: + * + * @param employmentStatus + * @return + */ + public Builder employmentStatus(String employmentStatus) { + this.employmentStatus = employmentStatus; + return this; + } + + /** + * 雇佣状态 + *

示例值: + * + * @param employmentStatus {@link com.lark.oapi.service.corehr.v2.enums.SearchEmployeeEmploymentStatusEnum} + * @return + */ + public Builder employmentStatus(com.lark.oapi.service.corehr.v2.enums.SearchEmployeeEmploymentStatusEnum employmentStatus) { + this.employmentStatus = employmentStatus.getValue(); + return this; + } + + + /** + * 人员类型 ID + *

示例值:6971090097697521314 + * + * @param employeeTypeId + * @return + */ + public Builder employeeTypeId(String employeeTypeId) { + this.employeeTypeId = employeeTypeId; + return this; + } + + + /** + * 部门 ID,根据员工主职的直接部门查询,可以通过【查询部门】API 获取 部门 ID + *

示例值: + * + * @param departmentIdList + * @return + */ + public Builder departmentIdList(String[] departmentIdList) { + this.departmentIdList = departmentIdList; + return this; + } + + + /** + * 直接上级的雇佣 ID,根据员工主职的直接上级查询 + *

示例值:7027024823985447820 + * + * @param directManagerIdList + * @return + */ + public Builder directManagerIdList(String[] directManagerIdList) { + this.directManagerIdList = directManagerIdList; + return this; + } + + + /** + * 虚线上级的雇佣 ID,根据员工主职的虚线上级查询 + *

示例值:7027024823985117820 + * + * @param dottedLineManagerIdList + * @return + */ + public Builder dottedLineManagerIdList(String[] dottedLineManagerIdList) { + this.dottedLineManagerIdList = dottedLineManagerIdList; + return this; + } + + + /** + * 转正式员工日期-搜索范围开始 + *

示例值:2020-01-01 + * + * @param regularEmployeeStartDateStart + * @return + */ + public Builder regularEmployeeStartDateStart(String regularEmployeeStartDateStart) { + this.regularEmployeeStartDateStart = regularEmployeeStartDateStart; + return this; + } + + + /** + * 转正式员工日期-搜索范围结束 + *

示例值:2020-01-01 + * + * @param regularEmployeeStartDateEnd + * @return + */ + public Builder regularEmployeeStartDateEnd(String regularEmployeeStartDateEnd) { + this.regularEmployeeStartDateEnd = regularEmployeeStartDateEnd; + return this; + } + + + /** + * 入职日期-搜索范围开始,需要与搜索范围结束一同使用 + *

示例值:2020-01-01 + * + * @param effectiveTimeStart + * @return + */ + public Builder effectiveTimeStart(String effectiveTimeStart) { + this.effectiveTimeStart = effectiveTimeStart; + return this; + } + + + /** + * 入职日期-搜索范围结束 + *

示例值:2020-01-01 + * + * @param effectiveTimeEnd + * @return + */ + public Builder effectiveTimeEnd(String effectiveTimeEnd) { + this.effectiveTimeEnd = effectiveTimeEnd; + return this; + } + + + /** + * 工作地点 ID 列表,查询属于该工作地点及下级工作地点的员工 + *

示例值: + * + * @param workLocationIdListIncludeSub + * @return + */ + public Builder workLocationIdListIncludeSub(String[] workLocationIdListIncludeSub) { + this.workLocationIdListIncludeSub = workLocationIdListIncludeSub; + return this; + } + + + /** + * 常用英文全名精确搜索 + *

示例值: + * + * @param preferredEnglishFullNameList + * @return + */ + public Builder preferredEnglishFullNameList(String[] preferredEnglishFullNameList) { + this.preferredEnglishFullNameList = preferredEnglishFullNameList; + return this; + } + + + /** + * 常用本地全名精确搜索 + *

示例值: + * + * @param preferredLocalFullNameList + * @return + */ + public Builder preferredLocalFullNameList(String[] preferredLocalFullNameList) { + this.preferredLocalFullNameList = preferredLocalFullNameList; + return this; + } + + + /** + * 居民身份证件号码精确搜索 + *

示例值: + * + * @param nationalIdNumberList + * @return + */ + public Builder nationalIdNumberList(String[] nationalIdNumberList) { + this.nationalIdNumberList = nationalIdNumberList; + return this; + } + + + /** + * 个人电话列表,精确匹配查询 + *

示例值: + * + * @param phoneNumberList + * @return + */ + public Builder phoneNumberList(String[] phoneNumberList) { + this.phoneNumberList = phoneNumberList; + return this; + } + + + /** + * 工作邮箱地址列表,精确匹配查询 + *

示例值: + * + * @param emailAddressList + * @return + */ + public Builder emailAddressList(String[] emailAddressList) { + this.emailAddressList = emailAddressList; + return this; + } + + + /** + * 部门 ID 列表,查询属于该部门及下级部门的员工 + *

示例值: + * + * @param departmentIdListIncludeSub + * @return + */ + public Builder departmentIdListIncludeSub(String[] departmentIdListIncludeSub) { + this.departmentIdListIncludeSub = departmentIdListIncludeSub; + return this; + } + + + public SearchEmployeeReqBody build() { + return new SearchEmployeeReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchEmployeeResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchEmployeeResp.java new file mode 100644 index 000000000..b58c58eb6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchEmployeeResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class SearchEmployeeResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchEmployeeRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchEmployeeRespBody.java new file mode 100644 index 000000000..26da11711 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchEmployeeRespBody.java @@ -0,0 +1,62 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class SearchEmployeeRespBody { + /** + * 查询的雇佣信息 + *

示例值: + */ + @SerializedName("items") + private Employee[] items; + /** + * 下一页页码 + *

示例值: + */ + @SerializedName("page_token") + private String pageToken; + /** + * 是否有下一页 + *

示例值: + */ + @SerializedName("has_more") + private Boolean hasMore; + + public Employee[] getItems() { + return this.items; + } + + public void setItems(Employee[] items) { + this.items = items; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public Boolean getHasMore() { + return this.hasMore; + } + + public void setHasMore(Boolean hasMore) { + this.hasMore = hasMore; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchJobChangeReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchJobChangeReq.java new file mode 100644 index 000000000..efcd816c8 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchJobChangeReq.java @@ -0,0 +1,222 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Query; + +public class SearchJobChangeReq { + /** + * 分页大小,最大 100 + *

示例值:100 + */ + @Query + @SerializedName("page_size") + private Integer pageSize; + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:6891251722631890445 + */ + @Query + @SerializedName("page_token") + private String pageToken; + /** + * 用户 ID 类型 + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + */ + @Query + @SerializedName("department_id_type") + private String departmentIdType; + @Body + private SearchJobChangeReqBody body; + + // builder 开始 + public SearchJobChangeReq() { + } + + public SearchJobChangeReq(Builder builder) { + /** + * 分页大小,最大 100 + *

示例值:100 + */ + this.pageSize = builder.pageSize; + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:6891251722631890445 + */ + this.pageToken = builder.pageToken; + /** + * 用户 ID 类型 + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + */ + this.departmentIdType = builder.departmentIdType; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Integer getPageSize() { + return this.pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getDepartmentIdType() { + return this.departmentIdType; + } + + public void setDepartmentIdType(String departmentIdType) { + this.departmentIdType = departmentIdType; + } + + public SearchJobChangeReqBody getSearchJobChangeReqBody() { + return this.body; + } + + public void setSearchJobChangeReqBody(SearchJobChangeReqBody body) { + this.body = body; + } + + public static class Builder { + private Integer pageSize; // 分页大小,最大 100 + private String pageToken; // 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + private String userIdType; // 用户 ID 类型 + private String departmentIdType; // 此次调用中使用的部门 ID 类型 + private SearchJobChangeReqBody body; + + /** + * 分页大小,最大 100 + *

示例值:100 + * + * @param pageSize + * @return + */ + public Builder pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:6891251722631890445 + * + * @param pageToken + * @return + */ + public Builder pageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + /** + * 用户 ID 类型 + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 用户 ID 类型 + *

示例值:open_id + * + * @param userIdType {@link com.lark.oapi.service.corehr.v2.enums.SearchJobChangeUserIdTypeEnum} + * @return + */ + public Builder userIdType(com.lark.oapi.service.corehr.v2.enums.SearchJobChangeUserIdTypeEnum userIdType) { + this.userIdType = userIdType.getValue(); + return this; + } + + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + * + * @param departmentIdType + * @return + */ + public Builder departmentIdType(String departmentIdType) { + this.departmentIdType = departmentIdType; + return this; + } + + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + * + * @param departmentIdType {@link com.lark.oapi.service.corehr.v2.enums.SearchJobChangeDepartmentIdTypeEnum} + * @return + */ + public Builder departmentIdType(com.lark.oapi.service.corehr.v2.enums.SearchJobChangeDepartmentIdTypeEnum departmentIdType) { + this.departmentIdType = departmentIdType.getValue(); + return this; + } + + public SearchJobChangeReqBody getSearchJobChangeReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder searchJobChangeReqBody(SearchJobChangeReqBody body) { + this.body = body; + return this; + } + + public SearchJobChangeReq build() { + return new SearchJobChangeReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchJobChangeReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchJobChangeReqBody.java new file mode 100644 index 000000000..bca92342b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchJobChangeReqBody.java @@ -0,0 +1,148 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class SearchJobChangeReqBody { + /** + * 雇员 ID 列表 + *

示例值: + */ + @SerializedName("employment_ids") + private String[] employmentIds; + /** + * 异动记录 ID 列表 + *

示例值: + */ + @SerializedName("job_change_ids") + private String[] jobChangeIds; + /** + * 异动状态,多个状态之间为「或」的关系 + *

示例值:Approved + */ + @SerializedName("statuses") + private String[] statuses; + + // builder 开始 + public SearchJobChangeReqBody() { + } + + public SearchJobChangeReqBody(Builder builder) { + /** + * 雇员 ID 列表 + *

示例值: + */ + this.employmentIds = builder.employmentIds; + /** + * 异动记录 ID 列表 + *

示例值: + */ + this.jobChangeIds = builder.jobChangeIds; + /** + * 异动状态,多个状态之间为「或」的关系 + *

示例值:Approved + */ + this.statuses = builder.statuses; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String[] getEmploymentIds() { + return this.employmentIds; + } + + public void setEmploymentIds(String[] employmentIds) { + this.employmentIds = employmentIds; + } + + public String[] getJobChangeIds() { + return this.jobChangeIds; + } + + public void setJobChangeIds(String[] jobChangeIds) { + this.jobChangeIds = jobChangeIds; + } + + public String[] getStatuses() { + return this.statuses; + } + + public void setStatuses(String[] statuses) { + this.statuses = statuses; + } + + public static class Builder { + /** + * 雇员 ID 列表 + *

示例值: + */ + private String[] employmentIds; + /** + * 异动记录 ID 列表 + *

示例值: + */ + private String[] jobChangeIds; + /** + * 异动状态,多个状态之间为「或」的关系 + *

示例值:Approved + */ + private String[] statuses; + + /** + * 雇员 ID 列表 + *

示例值: + * + * @param employmentIds + * @return + */ + public Builder employmentIds(String[] employmentIds) { + this.employmentIds = employmentIds; + return this; + } + + + /** + * 异动记录 ID 列表 + *

示例值: + * + * @param jobChangeIds + * @return + */ + public Builder jobChangeIds(String[] jobChangeIds) { + this.jobChangeIds = jobChangeIds; + return this; + } + + + /** + * 异动状态,多个状态之间为「或」的关系 + *

示例值:Approved + * + * @param statuses + * @return + */ + public Builder statuses(String[] statuses) { + this.statuses = statuses; + return this; + } + + + public SearchJobChangeReqBody build() { + return new SearchJobChangeReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchJobChangeResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchJobChangeResp.java new file mode 100644 index 000000000..9354a8c05 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchJobChangeResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class SearchJobChangeResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchJobChangeRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchJobChangeRespBody.java new file mode 100644 index 000000000..52c61a7df --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchJobChangeRespBody.java @@ -0,0 +1,62 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class SearchJobChangeRespBody { + /** + * 员工异动列表 + *

示例值: + */ + @SerializedName("items") + private JobChange[] items; + /** + * 是否有下一页 + *

示例值:true + */ + @SerializedName("has_more") + private Boolean hasMore; + /** + * 下一页页码 + *

示例值:6891251722631890445 + */ + @SerializedName("page_token") + private String pageToken; + + public JobChange[] getItems() { + return this.items; + } + + public void setItems(JobChange[] items) { + this.items = items; + } + + public Boolean getHasMore() { + return this.hasMore; + } + + public void setHasMore(Boolean hasMore) { + this.hasMore = hasMore; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchProbationReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchProbationReq.java new file mode 100644 index 000000000..b4b119e73 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchProbationReq.java @@ -0,0 +1,222 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Query; + +public class SearchProbationReq { + /** + * 分页大小,最大 100 + *

示例值:100 + */ + @Query + @SerializedName("page_size") + private Integer pageSize; + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:6891251722631890445 + */ + @Query + @SerializedName("page_token") + private String pageToken; + /** + * 用户 ID 类型 + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + */ + @Query + @SerializedName("department_id_type") + private String departmentIdType; + @Body + private SearchProbationReqBody body; + + // builder 开始 + public SearchProbationReq() { + } + + public SearchProbationReq(Builder builder) { + /** + * 分页大小,最大 100 + *

示例值:100 + */ + this.pageSize = builder.pageSize; + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:6891251722631890445 + */ + this.pageToken = builder.pageToken; + /** + * 用户 ID 类型 + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + */ + this.departmentIdType = builder.departmentIdType; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Integer getPageSize() { + return this.pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getDepartmentIdType() { + return this.departmentIdType; + } + + public void setDepartmentIdType(String departmentIdType) { + this.departmentIdType = departmentIdType; + } + + public SearchProbationReqBody getSearchProbationReqBody() { + return this.body; + } + + public void setSearchProbationReqBody(SearchProbationReqBody body) { + this.body = body; + } + + public static class Builder { + private Integer pageSize; // 分页大小,最大 100 + private String pageToken; // 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + private String userIdType; // 用户 ID 类型 + private String departmentIdType; // 此次调用中使用的部门 ID 类型 + private SearchProbationReqBody body; + + /** + * 分页大小,最大 100 + *

示例值:100 + * + * @param pageSize + * @return + */ + public Builder pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:6891251722631890445 + * + * @param pageToken + * @return + */ + public Builder pageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + /** + * 用户 ID 类型 + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 用户 ID 类型 + *

示例值:open_id + * + * @param userIdType {@link com.lark.oapi.service.corehr.v2.enums.SearchProbationUserIdTypeEnum} + * @return + */ + public Builder userIdType(com.lark.oapi.service.corehr.v2.enums.SearchProbationUserIdTypeEnum userIdType) { + this.userIdType = userIdType.getValue(); + return this; + } + + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + * + * @param departmentIdType + * @return + */ + public Builder departmentIdType(String departmentIdType) { + this.departmentIdType = departmentIdType; + return this; + } + + /** + * 此次调用中使用的部门 ID 类型 + *

示例值:open_department_id + * + * @param departmentIdType {@link com.lark.oapi.service.corehr.v2.enums.SearchProbationDepartmentIdTypeEnum} + * @return + */ + public Builder departmentIdType(com.lark.oapi.service.corehr.v2.enums.SearchProbationDepartmentIdTypeEnum departmentIdType) { + this.departmentIdType = departmentIdType.getValue(); + return this; + } + + public SearchProbationReqBody getSearchProbationReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder searchProbationReqBody(SearchProbationReqBody body) { + this.body = body; + return this; + } + + public SearchProbationReq build() { + return new SearchProbationReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchProbationReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchProbationReqBody.java new file mode 100644 index 000000000..1d45ac591 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchProbationReqBody.java @@ -0,0 +1,542 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class SearchProbationReqBody { + /** + * 雇佣 ID 列表 + *

示例值: + */ + @SerializedName("employment_ids") + private String[] employmentIds; + /** + * 部门 ID 列表 + *

示例值: + */ + @SerializedName("department_ids") + private String[] departmentIds; + /** + * 试用期开始日期 - 搜索范围开始,需要与搜索范围结束一同使用 + *

示例值:2022-05-18 + */ + @SerializedName("probation_start_date_start") + private String probationStartDateStart; + /** + * 试用期开始日期 - 搜索范围结束 + *

示例值:2022-05-20 + */ + @SerializedName("probation_start_date_end") + private String probationStartDateEnd; + /** + * 试用期预计结束日期 - 搜索范围开始,需要与搜索范围结束一同使用 + *

示例值:2022-06-20 + */ + @SerializedName("probation_expected_end_date_start") + private String probationExpectedEndDateStart; + /** + * 试用期预计结束日期 - 搜索范围结束 + *

示例值:2022-07-20 + */ + @SerializedName("probation_expected_end_date_end") + private String probationExpectedEndDateEnd; + /** + * 试用期实际结束日期 - 搜索范围开始,需要与搜索范围结束一同使用 + *

示例值:2022-08-20 + */ + @SerializedName("actual_probation_end_date_start") + private String actualProbationEndDateStart; + /** + * 试用期实际结束日期 - 搜索范围结束 + *

示例值:2022-09-20 + */ + @SerializedName("actual_probation_end_date_end") + private String actualProbationEndDateEnd; + /** + * 转正发起日期 - 搜索范围开始,需要与搜索范围结束一同使用 + *

示例值:2022-10-20 + */ + @SerializedName("initiating_time_start") + private String initiatingTimeStart; + /** + * 转正发起日期 - 搜索范围结束 + *

示例值:2022-11-20 + */ + @SerializedName("initiating_time_end") + private String initiatingTimeEnd; + /** + * 试用期状态 + *

示例值:approved + */ + @SerializedName("probation_status") + private String probationStatus; + /** + * 试用期最终考核结果 + *

示例值:approved + */ + @SerializedName("final_assessment_result") + private String finalAssessmentResult; + /** + * 试用期最终考核等级 + *

示例值:grade_a + */ + @SerializedName("final_assessment_grade") + private String finalAssessmentGrade; + + // builder 开始 + public SearchProbationReqBody() { + } + + public SearchProbationReqBody(Builder builder) { + /** + * 雇佣 ID 列表 + *

示例值: + */ + this.employmentIds = builder.employmentIds; + /** + * 部门 ID 列表 + *

示例值: + */ + this.departmentIds = builder.departmentIds; + /** + * 试用期开始日期 - 搜索范围开始,需要与搜索范围结束一同使用 + *

示例值:2022-05-18 + */ + this.probationStartDateStart = builder.probationStartDateStart; + /** + * 试用期开始日期 - 搜索范围结束 + *

示例值:2022-05-20 + */ + this.probationStartDateEnd = builder.probationStartDateEnd; + /** + * 试用期预计结束日期 - 搜索范围开始,需要与搜索范围结束一同使用 + *

示例值:2022-06-20 + */ + this.probationExpectedEndDateStart = builder.probationExpectedEndDateStart; + /** + * 试用期预计结束日期 - 搜索范围结束 + *

示例值:2022-07-20 + */ + this.probationExpectedEndDateEnd = builder.probationExpectedEndDateEnd; + /** + * 试用期实际结束日期 - 搜索范围开始,需要与搜索范围结束一同使用 + *

示例值:2022-08-20 + */ + this.actualProbationEndDateStart = builder.actualProbationEndDateStart; + /** + * 试用期实际结束日期 - 搜索范围结束 + *

示例值:2022-09-20 + */ + this.actualProbationEndDateEnd = builder.actualProbationEndDateEnd; + /** + * 转正发起日期 - 搜索范围开始,需要与搜索范围结束一同使用 + *

示例值:2022-10-20 + */ + this.initiatingTimeStart = builder.initiatingTimeStart; + /** + * 转正发起日期 - 搜索范围结束 + *

示例值:2022-11-20 + */ + this.initiatingTimeEnd = builder.initiatingTimeEnd; + /** + * 试用期状态 + *

示例值:approved + */ + this.probationStatus = builder.probationStatus; + /** + * 试用期最终考核结果 + *

示例值:approved + */ + this.finalAssessmentResult = builder.finalAssessmentResult; + /** + * 试用期最终考核等级 + *

示例值:grade_a + */ + this.finalAssessmentGrade = builder.finalAssessmentGrade; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String[] getEmploymentIds() { + return this.employmentIds; + } + + public void setEmploymentIds(String[] employmentIds) { + this.employmentIds = employmentIds; + } + + public String[] getDepartmentIds() { + return this.departmentIds; + } + + public void setDepartmentIds(String[] departmentIds) { + this.departmentIds = departmentIds; + } + + public String getProbationStartDateStart() { + return this.probationStartDateStart; + } + + public void setProbationStartDateStart(String probationStartDateStart) { + this.probationStartDateStart = probationStartDateStart; + } + + public String getProbationStartDateEnd() { + return this.probationStartDateEnd; + } + + public void setProbationStartDateEnd(String probationStartDateEnd) { + this.probationStartDateEnd = probationStartDateEnd; + } + + public String getProbationExpectedEndDateStart() { + return this.probationExpectedEndDateStart; + } + + public void setProbationExpectedEndDateStart(String probationExpectedEndDateStart) { + this.probationExpectedEndDateStart = probationExpectedEndDateStart; + } + + public String getProbationExpectedEndDateEnd() { + return this.probationExpectedEndDateEnd; + } + + public void setProbationExpectedEndDateEnd(String probationExpectedEndDateEnd) { + this.probationExpectedEndDateEnd = probationExpectedEndDateEnd; + } + + public String getActualProbationEndDateStart() { + return this.actualProbationEndDateStart; + } + + public void setActualProbationEndDateStart(String actualProbationEndDateStart) { + this.actualProbationEndDateStart = actualProbationEndDateStart; + } + + public String getActualProbationEndDateEnd() { + return this.actualProbationEndDateEnd; + } + + public void setActualProbationEndDateEnd(String actualProbationEndDateEnd) { + this.actualProbationEndDateEnd = actualProbationEndDateEnd; + } + + public String getInitiatingTimeStart() { + return this.initiatingTimeStart; + } + + public void setInitiatingTimeStart(String initiatingTimeStart) { + this.initiatingTimeStart = initiatingTimeStart; + } + + public String getInitiatingTimeEnd() { + return this.initiatingTimeEnd; + } + + public void setInitiatingTimeEnd(String initiatingTimeEnd) { + this.initiatingTimeEnd = initiatingTimeEnd; + } + + public String getProbationStatus() { + return this.probationStatus; + } + + public void setProbationStatus(String probationStatus) { + this.probationStatus = probationStatus; + } + + public String getFinalAssessmentResult() { + return this.finalAssessmentResult; + } + + public void setFinalAssessmentResult(String finalAssessmentResult) { + this.finalAssessmentResult = finalAssessmentResult; + } + + public String getFinalAssessmentGrade() { + return this.finalAssessmentGrade; + } + + public void setFinalAssessmentGrade(String finalAssessmentGrade) { + this.finalAssessmentGrade = finalAssessmentGrade; + } + + public static class Builder { + /** + * 雇佣 ID 列表 + *

示例值: + */ + private String[] employmentIds; + /** + * 部门 ID 列表 + *

示例值: + */ + private String[] departmentIds; + /** + * 试用期开始日期 - 搜索范围开始,需要与搜索范围结束一同使用 + *

示例值:2022-05-18 + */ + private String probationStartDateStart; + /** + * 试用期开始日期 - 搜索范围结束 + *

示例值:2022-05-20 + */ + private String probationStartDateEnd; + /** + * 试用期预计结束日期 - 搜索范围开始,需要与搜索范围结束一同使用 + *

示例值:2022-06-20 + */ + private String probationExpectedEndDateStart; + /** + * 试用期预计结束日期 - 搜索范围结束 + *

示例值:2022-07-20 + */ + private String probationExpectedEndDateEnd; + /** + * 试用期实际结束日期 - 搜索范围开始,需要与搜索范围结束一同使用 + *

示例值:2022-08-20 + */ + private String actualProbationEndDateStart; + /** + * 试用期实际结束日期 - 搜索范围结束 + *

示例值:2022-09-20 + */ + private String actualProbationEndDateEnd; + /** + * 转正发起日期 - 搜索范围开始,需要与搜索范围结束一同使用 + *

示例值:2022-10-20 + */ + private String initiatingTimeStart; + /** + * 转正发起日期 - 搜索范围结束 + *

示例值:2022-11-20 + */ + private String initiatingTimeEnd; + /** + * 试用期状态 + *

示例值:approved + */ + private String probationStatus; + /** + * 试用期最终考核结果 + *

示例值:approved + */ + private String finalAssessmentResult; + /** + * 试用期最终考核等级 + *

示例值:grade_a + */ + private String finalAssessmentGrade; + + /** + * 雇佣 ID 列表 + *

示例值: + * + * @param employmentIds + * @return + */ + public Builder employmentIds(String[] employmentIds) { + this.employmentIds = employmentIds; + return this; + } + + + /** + * 部门 ID 列表 + *

示例值: + * + * @param departmentIds + * @return + */ + public Builder departmentIds(String[] departmentIds) { + this.departmentIds = departmentIds; + return this; + } + + + /** + * 试用期开始日期 - 搜索范围开始,需要与搜索范围结束一同使用 + *

示例值:2022-05-18 + * + * @param probationStartDateStart + * @return + */ + public Builder probationStartDateStart(String probationStartDateStart) { + this.probationStartDateStart = probationStartDateStart; + return this; + } + + + /** + * 试用期开始日期 - 搜索范围结束 + *

示例值:2022-05-20 + * + * @param probationStartDateEnd + * @return + */ + public Builder probationStartDateEnd(String probationStartDateEnd) { + this.probationStartDateEnd = probationStartDateEnd; + return this; + } + + + /** + * 试用期预计结束日期 - 搜索范围开始,需要与搜索范围结束一同使用 + *

示例值:2022-06-20 + * + * @param probationExpectedEndDateStart + * @return + */ + public Builder probationExpectedEndDateStart(String probationExpectedEndDateStart) { + this.probationExpectedEndDateStart = probationExpectedEndDateStart; + return this; + } + + + /** + * 试用期预计结束日期 - 搜索范围结束 + *

示例值:2022-07-20 + * + * @param probationExpectedEndDateEnd + * @return + */ + public Builder probationExpectedEndDateEnd(String probationExpectedEndDateEnd) { + this.probationExpectedEndDateEnd = probationExpectedEndDateEnd; + return this; + } + + + /** + * 试用期实际结束日期 - 搜索范围开始,需要与搜索范围结束一同使用 + *

示例值:2022-08-20 + * + * @param actualProbationEndDateStart + * @return + */ + public Builder actualProbationEndDateStart(String actualProbationEndDateStart) { + this.actualProbationEndDateStart = actualProbationEndDateStart; + return this; + } + + + /** + * 试用期实际结束日期 - 搜索范围结束 + *

示例值:2022-09-20 + * + * @param actualProbationEndDateEnd + * @return + */ + public Builder actualProbationEndDateEnd(String actualProbationEndDateEnd) { + this.actualProbationEndDateEnd = actualProbationEndDateEnd; + return this; + } + + + /** + * 转正发起日期 - 搜索范围开始,需要与搜索范围结束一同使用 + *

示例值:2022-10-20 + * + * @param initiatingTimeStart + * @return + */ + public Builder initiatingTimeStart(String initiatingTimeStart) { + this.initiatingTimeStart = initiatingTimeStart; + return this; + } + + + /** + * 转正发起日期 - 搜索范围结束 + *

示例值:2022-11-20 + * + * @param initiatingTimeEnd + * @return + */ + public Builder initiatingTimeEnd(String initiatingTimeEnd) { + this.initiatingTimeEnd = initiatingTimeEnd; + return this; + } + + + /** + * 试用期状态 + *

示例值:approved + * + * @param probationStatus + * @return + */ + public Builder probationStatus(String probationStatus) { + this.probationStatus = probationStatus; + return this; + } + + /** + * 试用期状态 + *

示例值:approved + * + * @param probationStatus {@link com.lark.oapi.service.corehr.v2.enums.SearchProbationProbationStatusEnum} + * @return + */ + public Builder probationStatus(com.lark.oapi.service.corehr.v2.enums.SearchProbationProbationStatusEnum probationStatus) { + this.probationStatus = probationStatus.getValue(); + return this; + } + + + /** + * 试用期最终考核结果 + *

示例值:approved + * + * @param finalAssessmentResult + * @return + */ + public Builder finalAssessmentResult(String finalAssessmentResult) { + this.finalAssessmentResult = finalAssessmentResult; + return this; + } + + /** + * 试用期最终考核结果 + *

示例值:approved + * + * @param finalAssessmentResult {@link com.lark.oapi.service.corehr.v2.enums.SearchProbationFinalAssessmentResultEnum} + * @return + */ + public Builder finalAssessmentResult(com.lark.oapi.service.corehr.v2.enums.SearchProbationFinalAssessmentResultEnum finalAssessmentResult) { + this.finalAssessmentResult = finalAssessmentResult.getValue(); + return this; + } + + + /** + * 试用期最终考核等级 + *

示例值:grade_a + * + * @param finalAssessmentGrade + * @return + */ + public Builder finalAssessmentGrade(String finalAssessmentGrade) { + this.finalAssessmentGrade = finalAssessmentGrade; + return this; + } + + + public SearchProbationReqBody build() { + return new SearchProbationReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchProbationResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchProbationResp.java new file mode 100644 index 000000000..990bed387 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchProbationResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class SearchProbationResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchProbationRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchProbationRespBody.java new file mode 100644 index 000000000..bd72e2023 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SearchProbationRespBody.java @@ -0,0 +1,62 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class SearchProbationRespBody { + /** + * 查询的试用期信息 + *

示例值: + */ + @SerializedName("items") + private ProbationInfo[] items; + /** + * 下一页页码 + *

示例值: + */ + @SerializedName("page_token") + private String pageToken; + /** + * 是否有下一页 + *

示例值: + */ + @SerializedName("has_more") + private Boolean hasMore; + + public ProbationInfo[] getItems() { + return this.items; + } + + public void setItems(ProbationInfo[] items) { + this.items = items; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public Boolean getHasMore() { + return this.hasMore; + } + + public void setHasMore(Boolean hasMore) { + this.hasMore = hasMore; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SignatureFile.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SignatureFile.java new file mode 100644 index 000000000..94dff9279 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/SignatureFile.java @@ -0,0 +1,296 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class SignatureFile { + /** + * 电子签文件ID + *

示例值:7147527056140813828 + */ + @SerializedName("signature_file_id") + private String signatureFileId; + /** + * 名称 + *

示例值: + */ + @SerializedName("names") + private I18n[] names; + /** + * 创建时间 + *

示例值:2023-01-01 00:00:00 + */ + @SerializedName("create_time") + private String createTime; + /** + * 更新时间 + *

示例值:2023-01-01 00:00:00 + */ + @SerializedName("update_time") + private String updateTime; + /** + * 雇员 id + *

示例值:ou_a294793e8fa21529f2a60e3e9de45520 + */ + @SerializedName("employment_id") + private String employmentId; + /** + * 电子签文件状态,枚举值可通过文档【飞书人事枚举常量】电子签文件状态(signature_file_state)枚举定义部分获得 + *

示例值: + */ + @SerializedName("signature_file_state") + private Enum signatureFileState; + /** + * 供应商侧的合同编号,作为幂等key + *

示例值:48793beea04f4e2583d50732e481d507 + */ + @SerializedName("contract_code") + private String contractCode; + + // builder 开始 + public SignatureFile() { + } + + public SignatureFile(Builder builder) { + /** + * 电子签文件ID + *

示例值:7147527056140813828 + */ + this.signatureFileId = builder.signatureFileId; + /** + * 名称 + *

示例值: + */ + this.names = builder.names; + /** + * 创建时间 + *

示例值:2023-01-01 00:00:00 + */ + this.createTime = builder.createTime; + /** + * 更新时间 + *

示例值:2023-01-01 00:00:00 + */ + this.updateTime = builder.updateTime; + /** + * 雇员 id + *

示例值:ou_a294793e8fa21529f2a60e3e9de45520 + */ + this.employmentId = builder.employmentId; + /** + * 电子签文件状态,枚举值可通过文档【飞书人事枚举常量】电子签文件状态(signature_file_state)枚举定义部分获得 + *

示例值: + */ + this.signatureFileState = builder.signatureFileState; + /** + * 供应商侧的合同编号,作为幂等key + *

示例值:48793beea04f4e2583d50732e481d507 + */ + this.contractCode = builder.contractCode; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getSignatureFileId() { + return this.signatureFileId; + } + + public void setSignatureFileId(String signatureFileId) { + this.signatureFileId = signatureFileId; + } + + public I18n[] getNames() { + return this.names; + } + + public void setNames(I18n[] names) { + this.names = names; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getEmploymentId() { + return this.employmentId; + } + + public void setEmploymentId(String employmentId) { + this.employmentId = employmentId; + } + + public Enum getSignatureFileState() { + return this.signatureFileState; + } + + public void setSignatureFileState(Enum signatureFileState) { + this.signatureFileState = signatureFileState; + } + + public String getContractCode() { + return this.contractCode; + } + + public void setContractCode(String contractCode) { + this.contractCode = contractCode; + } + + public static class Builder { + /** + * 电子签文件ID + *

示例值:7147527056140813828 + */ + private String signatureFileId; + /** + * 名称 + *

示例值: + */ + private I18n[] names; + /** + * 创建时间 + *

示例值:2023-01-01 00:00:00 + */ + private String createTime; + /** + * 更新时间 + *

示例值:2023-01-01 00:00:00 + */ + private String updateTime; + /** + * 雇员 id + *

示例值:ou_a294793e8fa21529f2a60e3e9de45520 + */ + private String employmentId; + /** + * 电子签文件状态,枚举值可通过文档【飞书人事枚举常量】电子签文件状态(signature_file_state)枚举定义部分获得 + *

示例值: + */ + private Enum signatureFileState; + /** + * 供应商侧的合同编号,作为幂等key + *

示例值:48793beea04f4e2583d50732e481d507 + */ + private String contractCode; + + /** + * 电子签文件ID + *

示例值:7147527056140813828 + * + * @param signatureFileId + * @return + */ + public Builder signatureFileId(String signatureFileId) { + this.signatureFileId = signatureFileId; + return this; + } + + + /** + * 名称 + *

示例值: + * + * @param names + * @return + */ + public Builder names(I18n[] names) { + this.names = names; + return this; + } + + + /** + * 创建时间 + *

示例值:2023-01-01 00:00:00 + * + * @param createTime + * @return + */ + public Builder createTime(String createTime) { + this.createTime = createTime; + return this; + } + + + /** + * 更新时间 + *

示例值:2023-01-01 00:00:00 + * + * @param updateTime + * @return + */ + public Builder updateTime(String updateTime) { + this.updateTime = updateTime; + return this; + } + + + /** + * 雇员 id + *

示例值:ou_a294793e8fa21529f2a60e3e9de45520 + * + * @param employmentId + * @return + */ + public Builder employmentId(String employmentId) { + this.employmentId = employmentId; + return this; + } + + + /** + * 电子签文件状态,枚举值可通过文档【飞书人事枚举常量】电子签文件状态(signature_file_state)枚举定义部分获得 + *

示例值: + * + * @param signatureFileState + * @return + */ + public Builder signatureFileState(Enum signatureFileState) { + this.signatureFileState = signatureFileState; + return this; + } + + + /** + * 供应商侧的合同编号,作为幂等key + *

示例值:48793beea04f4e2583d50732e481d507 + * + * @param contractCode + * @return + */ + public Builder contractCode(String contractCode) { + this.contractCode = contractCode; + return this; + } + + + public SignatureFile build() { + return new SignatureFile(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/TranferEmploymentInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/TranferEmploymentInfo.java new file mode 100644 index 000000000..f3ade6bd4 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/TranferEmploymentInfo.java @@ -0,0 +1,185 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class TranferEmploymentInfo { + /** + * 转正式员工日期 + *

示例值:2023-01-01 + */ + @SerializedName("regular_employee_start_date") + private String regularEmployeeStartDate; + /** + * 司龄起算日期 + *

示例值:2023-01-01 + */ + @SerializedName("seniority_date") + private String seniorityDate; + /** + * 员工编号 + *

示例值:1111111 + */ + @SerializedName("employee_number") + private String employeeNumber; + /** + * 自定义字段 + *

示例值: + */ + @SerializedName("custom_fields") + private CustomFieldData[] customFields; + + // builder 开始 + public TranferEmploymentInfo() { + } + + public TranferEmploymentInfo(Builder builder) { + /** + * 转正式员工日期 + *

示例值:2023-01-01 + */ + this.regularEmployeeStartDate = builder.regularEmployeeStartDate; + /** + * 司龄起算日期 + *

示例值:2023-01-01 + */ + this.seniorityDate = builder.seniorityDate; + /** + * 员工编号 + *

示例值:1111111 + */ + this.employeeNumber = builder.employeeNumber; + /** + * 自定义字段 + *

示例值: + */ + this.customFields = builder.customFields; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getRegularEmployeeStartDate() { + return this.regularEmployeeStartDate; + } + + public void setRegularEmployeeStartDate(String regularEmployeeStartDate) { + this.regularEmployeeStartDate = regularEmployeeStartDate; + } + + public String getSeniorityDate() { + return this.seniorityDate; + } + + public void setSeniorityDate(String seniorityDate) { + this.seniorityDate = seniorityDate; + } + + public String getEmployeeNumber() { + return this.employeeNumber; + } + + public void setEmployeeNumber(String employeeNumber) { + this.employeeNumber = employeeNumber; + } + + public CustomFieldData[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(CustomFieldData[] customFields) { + this.customFields = customFields; + } + + public static class Builder { + /** + * 转正式员工日期 + *

示例值:2023-01-01 + */ + private String regularEmployeeStartDate; + /** + * 司龄起算日期 + *

示例值:2023-01-01 + */ + private String seniorityDate; + /** + * 员工编号 + *

示例值:1111111 + */ + private String employeeNumber; + /** + * 自定义字段 + *

示例值: + */ + private CustomFieldData[] customFields; + + /** + * 转正式员工日期 + *

示例值:2023-01-01 + * + * @param regularEmployeeStartDate + * @return + */ + public Builder regularEmployeeStartDate(String regularEmployeeStartDate) { + this.regularEmployeeStartDate = regularEmployeeStartDate; + return this; + } + + + /** + * 司龄起算日期 + *

示例值:2023-01-01 + * + * @param seniorityDate + * @return + */ + public Builder seniorityDate(String seniorityDate) { + this.seniorityDate = seniorityDate; + return this; + } + + + /** + * 员工编号 + *

示例值:1111111 + * + * @param employeeNumber + * @return + */ + public Builder employeeNumber(String employeeNumber) { + this.employeeNumber = employeeNumber; + return this; + } + + + /** + * 自定义字段 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(CustomFieldData[] customFields) { + this.customFields = customFields; + return this; + } + + + public TranferEmploymentInfo build() { + return new TranferEmploymentInfo(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/TransferInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/TransferInfo.java new file mode 100644 index 000000000..7a62941ba --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/TransferInfo.java @@ -0,0 +1,1887 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class TransferInfo { + /** + * 备注 + *

示例值:异动详情 + */ + @SerializedName("remark") + private String remark; + /** + * offer信息 + *

示例值:优质人才,加急处理 + */ + @SerializedName("offer_info") + private String offerInfo; + /** + * 是否撤销虚线上级 + *

示例值:true + */ + @SerializedName("target_dotted_manager_clean") + private Boolean targetDottedManagerClean; + /** + * 是否有试用期 + *

示例值:false + */ + @SerializedName("probation_exist") + private Boolean probationExist; + /** + * 原部门 + *

示例值:6966236933198579208 + */ + @SerializedName("original_department") + private String originalDepartment; + /** + * 新部门 + *

示例值:6966236933198579208 + */ + @SerializedName("target_department") + private String targetDepartment; + /** + * 原工作地点 + *

示例值:6967271100992587295 + */ + @SerializedName("original_work_location") + private String originalWorkLocation; + /** + * 新工作地点 + *

示例值:6967271100992587295 + */ + @SerializedName("target_work_location") + private String targetWorkLocation; + /** + * 原直属上级 + *

示例值:6974641477444060708 + */ + @SerializedName("original_direct_manager") + private String originalDirectManager; + /** + * 新直属上级 + *

示例值:7013619729281713671 + */ + @SerializedName("target_direct_manager") + private String targetDirectManager; + /** + * 原虚线上级 + *

示例值:6974648866876573198 + */ + @SerializedName("original_dotted_manager") + private String originalDottedManager; + /** + * 新虚线上级 + *

示例值:7013328578351842852 + */ + @SerializedName("target_dotted_manager") + private String targetDottedManager; + /** + * 原职务 + *

示例值:6969469398088287751 + */ + @SerializedName("original_job") + private String originalJob; + /** + * 新职务 + *

示例值:6969469557836760606 + */ + @SerializedName("target_job") + private String targetJob; + /** + * 原序列 + *

示例值:6967287547462419975 + */ + @SerializedName("original_job_family") + private String originalJobFamily; + /** + * 新序列 + *

示例值:6967287547462419975 + */ + @SerializedName("target_job_family") + private String targetJobFamily; + /** + * 原级别 + *

示例值:6972085707674355214 + */ + @SerializedName("original_job_level") + private String originalJobLevel; + /** + * 新级别 + *

示例值:6972085707674355214 + */ + @SerializedName("target_job_level") + private String targetJobLevel; + /** + * 原人员类型 + *

示例值:6968386026792289828 + */ + @SerializedName("original_workforce_type") + private String originalWorkforceType; + /** + * 新人员类型 + *

示例值:7036268995372303885 + */ + @SerializedName("target_workforce_type") + private String targetWorkforceType; + /** + * 原公司 + *

示例值:6974659700705068581 + */ + @SerializedName("original_company") + private String originalCompany; + /** + * 新公司 + *

示例值:6974659700705068581 + */ + @SerializedName("target_company") + private String targetCompany; + /** + * 原合同编号 + *

示例值:55332 + */ + @SerializedName("original_contract_number") + private String originalContractNumber; + /** + * 新合同编号 + *

示例值:55333 + */ + @SerializedName("target_contract_number") + private String targetContractNumber; + /** + * 原合同类型 + *

示例值:labor_contract + */ + @SerializedName("original_contract_type") + private String originalContractType; + /** + * 新合同类型 + *

示例值:labor_contract + */ + @SerializedName("target_contract_type") + private String targetContractType; + /** + * 原期限类型 + *

示例值:fixed_term + */ + @SerializedName("original_duration_type") + private String originalDurationType; + /** + * 新期限类型 + *

示例值:fixed_term + */ + @SerializedName("target_duration_type") + private String targetDurationType; + /** + * 原签订类型 + *

示例值:new + */ + @SerializedName("original_signing_type") + private String originalSigningType; + /** + * 新签订类型 + *

示例值:new + */ + @SerializedName("target_signing_type") + private String targetSigningType; + /** + * 原合同开始日期 + *

示例值:2021-07-01 + */ + @SerializedName("original_contract_start_date") + private String originalContractStartDate; + /** + * 新合同开始日期 + *

示例值:2021-07-01 + */ + @SerializedName("target_contract_start_date") + private String targetContractStartDate; + /** + * 原合同结束日期 + *

示例值:2024-07-01 + */ + @SerializedName("original_contract_end_date") + private String originalContractEndDate; + /** + * 新合同结束日期 + *

示例值:2024-07-01 + */ + @SerializedName("target_contract_end_date") + private String targetContractEndDate; + /** + * 原工时制度 + *

示例值:6969087376740206087 + */ + @SerializedName("original_working_hours_type") + private String originalWorkingHoursType; + /** + * 新工时制度 + *

示例值:6969087376740206087 + */ + @SerializedName("target_working_hours_type") + private String targetWorkingHoursType; + /** + * 原工作日历 + *

示例值:6969087376740236087 + */ + @SerializedName("original_working_calendar") + private String originalWorkingCalendar; + /** + * 新工作日历 + *

示例值:6969087376740236087 + */ + @SerializedName("target_working_calendar") + private String targetWorkingCalendar; + /** + * 原试用期预计结束日期 + *

示例值:2021-11-17 + */ + @SerializedName("original_probation_end_date") + private String originalProbationEndDate; + /** + * 新试用期预计结束日期 + *

示例值:2021-11-17 + */ + @SerializedName("target_probation_end_date") + private String targetProbationEndDate; + /** + * 原周工作时长 + *

示例值:162 + */ + @SerializedName("original_weekly_working_hours") + private String originalWeeklyWorkingHours; + /** + * 新周工作时长 + *

示例值:160 + */ + @SerializedName("target_weekly_working_hours") + private String targetWeeklyWorkingHours; + /** + * 原排班 + *

示例值:work_shift + */ + @SerializedName("original_work_shift") + private String originalWorkShift; + /** + * 新排班 + *

示例值:non_work_shift + */ + @SerializedName("target_work_shift") + private String targetWorkShift; + /** + * 原成本中心分摊方式 + *

示例值: + */ + @SerializedName("original_cost_center_rate") + private JobDataCostCenter[] originalCostCenterRate; + /** + * 新成本中心分摊方式 + *

示例值: + */ + @SerializedName("target_cost_center_rate") + private JobDataCostCenter[] targetCostCenterRate; + /** + * 原工作信息 + *

示例值: + */ + @SerializedName("original_employment_change") + private TranferEmploymentInfo originalEmploymentChange; + /** + * 新工作信息 + *

示例值: + */ + @SerializedName("target_employment_change") + private TranferEmploymentInfo targetEmploymentChange; + /** + * 原职等 + *

示例值:7289005963599693366 + */ + @SerializedName("original_job_grade") + private String originalJobGrade; + /** + * 新职等 + *

示例值:7289005963599693366 + */ + @SerializedName("target_job_grade") + private String targetJobGrade; + + // builder 开始 + public TransferInfo() { + } + + public TransferInfo(Builder builder) { + /** + * 备注 + *

示例值:异动详情 + */ + this.remark = builder.remark; + /** + * offer信息 + *

示例值:优质人才,加急处理 + */ + this.offerInfo = builder.offerInfo; + /** + * 是否撤销虚线上级 + *

示例值:true + */ + this.targetDottedManagerClean = builder.targetDottedManagerClean; + /** + * 是否有试用期 + *

示例值:false + */ + this.probationExist = builder.probationExist; + /** + * 原部门 + *

示例值:6966236933198579208 + */ + this.originalDepartment = builder.originalDepartment; + /** + * 新部门 + *

示例值:6966236933198579208 + */ + this.targetDepartment = builder.targetDepartment; + /** + * 原工作地点 + *

示例值:6967271100992587295 + */ + this.originalWorkLocation = builder.originalWorkLocation; + /** + * 新工作地点 + *

示例值:6967271100992587295 + */ + this.targetWorkLocation = builder.targetWorkLocation; + /** + * 原直属上级 + *

示例值:6974641477444060708 + */ + this.originalDirectManager = builder.originalDirectManager; + /** + * 新直属上级 + *

示例值:7013619729281713671 + */ + this.targetDirectManager = builder.targetDirectManager; + /** + * 原虚线上级 + *

示例值:6974648866876573198 + */ + this.originalDottedManager = builder.originalDottedManager; + /** + * 新虚线上级 + *

示例值:7013328578351842852 + */ + this.targetDottedManager = builder.targetDottedManager; + /** + * 原职务 + *

示例值:6969469398088287751 + */ + this.originalJob = builder.originalJob; + /** + * 新职务 + *

示例值:6969469557836760606 + */ + this.targetJob = builder.targetJob; + /** + * 原序列 + *

示例值:6967287547462419975 + */ + this.originalJobFamily = builder.originalJobFamily; + /** + * 新序列 + *

示例值:6967287547462419975 + */ + this.targetJobFamily = builder.targetJobFamily; + /** + * 原级别 + *

示例值:6972085707674355214 + */ + this.originalJobLevel = builder.originalJobLevel; + /** + * 新级别 + *

示例值:6972085707674355214 + */ + this.targetJobLevel = builder.targetJobLevel; + /** + * 原人员类型 + *

示例值:6968386026792289828 + */ + this.originalWorkforceType = builder.originalWorkforceType; + /** + * 新人员类型 + *

示例值:7036268995372303885 + */ + this.targetWorkforceType = builder.targetWorkforceType; + /** + * 原公司 + *

示例值:6974659700705068581 + */ + this.originalCompany = builder.originalCompany; + /** + * 新公司 + *

示例值:6974659700705068581 + */ + this.targetCompany = builder.targetCompany; + /** + * 原合同编号 + *

示例值:55332 + */ + this.originalContractNumber = builder.originalContractNumber; + /** + * 新合同编号 + *

示例值:55333 + */ + this.targetContractNumber = builder.targetContractNumber; + /** + * 原合同类型 + *

示例值:labor_contract + */ + this.originalContractType = builder.originalContractType; + /** + * 新合同类型 + *

示例值:labor_contract + */ + this.targetContractType = builder.targetContractType; + /** + * 原期限类型 + *

示例值:fixed_term + */ + this.originalDurationType = builder.originalDurationType; + /** + * 新期限类型 + *

示例值:fixed_term + */ + this.targetDurationType = builder.targetDurationType; + /** + * 原签订类型 + *

示例值:new + */ + this.originalSigningType = builder.originalSigningType; + /** + * 新签订类型 + *

示例值:new + */ + this.targetSigningType = builder.targetSigningType; + /** + * 原合同开始日期 + *

示例值:2021-07-01 + */ + this.originalContractStartDate = builder.originalContractStartDate; + /** + * 新合同开始日期 + *

示例值:2021-07-01 + */ + this.targetContractStartDate = builder.targetContractStartDate; + /** + * 原合同结束日期 + *

示例值:2024-07-01 + */ + this.originalContractEndDate = builder.originalContractEndDate; + /** + * 新合同结束日期 + *

示例值:2024-07-01 + */ + this.targetContractEndDate = builder.targetContractEndDate; + /** + * 原工时制度 + *

示例值:6969087376740206087 + */ + this.originalWorkingHoursType = builder.originalWorkingHoursType; + /** + * 新工时制度 + *

示例值:6969087376740206087 + */ + this.targetWorkingHoursType = builder.targetWorkingHoursType; + /** + * 原工作日历 + *

示例值:6969087376740236087 + */ + this.originalWorkingCalendar = builder.originalWorkingCalendar; + /** + * 新工作日历 + *

示例值:6969087376740236087 + */ + this.targetWorkingCalendar = builder.targetWorkingCalendar; + /** + * 原试用期预计结束日期 + *

示例值:2021-11-17 + */ + this.originalProbationEndDate = builder.originalProbationEndDate; + /** + * 新试用期预计结束日期 + *

示例值:2021-11-17 + */ + this.targetProbationEndDate = builder.targetProbationEndDate; + /** + * 原周工作时长 + *

示例值:162 + */ + this.originalWeeklyWorkingHours = builder.originalWeeklyWorkingHours; + /** + * 新周工作时长 + *

示例值:160 + */ + this.targetWeeklyWorkingHours = builder.targetWeeklyWorkingHours; + /** + * 原排班 + *

示例值:work_shift + */ + this.originalWorkShift = builder.originalWorkShift; + /** + * 新排班 + *

示例值:non_work_shift + */ + this.targetWorkShift = builder.targetWorkShift; + /** + * 原成本中心分摊方式 + *

示例值: + */ + this.originalCostCenterRate = builder.originalCostCenterRate; + /** + * 新成本中心分摊方式 + *

示例值: + */ + this.targetCostCenterRate = builder.targetCostCenterRate; + /** + * 原工作信息 + *

示例值: + */ + this.originalEmploymentChange = builder.originalEmploymentChange; + /** + * 新工作信息 + *

示例值: + */ + this.targetEmploymentChange = builder.targetEmploymentChange; + /** + * 原职等 + *

示例值:7289005963599693366 + */ + this.originalJobGrade = builder.originalJobGrade; + /** + * 新职等 + *

示例值:7289005963599693366 + */ + this.targetJobGrade = builder.targetJobGrade; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getRemark() { + return this.remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getOfferInfo() { + return this.offerInfo; + } + + public void setOfferInfo(String offerInfo) { + this.offerInfo = offerInfo; + } + + public Boolean getTargetDottedManagerClean() { + return this.targetDottedManagerClean; + } + + public void setTargetDottedManagerClean(Boolean targetDottedManagerClean) { + this.targetDottedManagerClean = targetDottedManagerClean; + } + + public Boolean getProbationExist() { + return this.probationExist; + } + + public void setProbationExist(Boolean probationExist) { + this.probationExist = probationExist; + } + + public String getOriginalDepartment() { + return this.originalDepartment; + } + + public void setOriginalDepartment(String originalDepartment) { + this.originalDepartment = originalDepartment; + } + + public String getTargetDepartment() { + return this.targetDepartment; + } + + public void setTargetDepartment(String targetDepartment) { + this.targetDepartment = targetDepartment; + } + + public String getOriginalWorkLocation() { + return this.originalWorkLocation; + } + + public void setOriginalWorkLocation(String originalWorkLocation) { + this.originalWorkLocation = originalWorkLocation; + } + + public String getTargetWorkLocation() { + return this.targetWorkLocation; + } + + public void setTargetWorkLocation(String targetWorkLocation) { + this.targetWorkLocation = targetWorkLocation; + } + + public String getOriginalDirectManager() { + return this.originalDirectManager; + } + + public void setOriginalDirectManager(String originalDirectManager) { + this.originalDirectManager = originalDirectManager; + } + + public String getTargetDirectManager() { + return this.targetDirectManager; + } + + public void setTargetDirectManager(String targetDirectManager) { + this.targetDirectManager = targetDirectManager; + } + + public String getOriginalDottedManager() { + return this.originalDottedManager; + } + + public void setOriginalDottedManager(String originalDottedManager) { + this.originalDottedManager = originalDottedManager; + } + + public String getTargetDottedManager() { + return this.targetDottedManager; + } + + public void setTargetDottedManager(String targetDottedManager) { + this.targetDottedManager = targetDottedManager; + } + + public String getOriginalJob() { + return this.originalJob; + } + + public void setOriginalJob(String originalJob) { + this.originalJob = originalJob; + } + + public String getTargetJob() { + return this.targetJob; + } + + public void setTargetJob(String targetJob) { + this.targetJob = targetJob; + } + + public String getOriginalJobFamily() { + return this.originalJobFamily; + } + + public void setOriginalJobFamily(String originalJobFamily) { + this.originalJobFamily = originalJobFamily; + } + + public String getTargetJobFamily() { + return this.targetJobFamily; + } + + public void setTargetJobFamily(String targetJobFamily) { + this.targetJobFamily = targetJobFamily; + } + + public String getOriginalJobLevel() { + return this.originalJobLevel; + } + + public void setOriginalJobLevel(String originalJobLevel) { + this.originalJobLevel = originalJobLevel; + } + + public String getTargetJobLevel() { + return this.targetJobLevel; + } + + public void setTargetJobLevel(String targetJobLevel) { + this.targetJobLevel = targetJobLevel; + } + + public String getOriginalWorkforceType() { + return this.originalWorkforceType; + } + + public void setOriginalWorkforceType(String originalWorkforceType) { + this.originalWorkforceType = originalWorkforceType; + } + + public String getTargetWorkforceType() { + return this.targetWorkforceType; + } + + public void setTargetWorkforceType(String targetWorkforceType) { + this.targetWorkforceType = targetWorkforceType; + } + + public String getOriginalCompany() { + return this.originalCompany; + } + + public void setOriginalCompany(String originalCompany) { + this.originalCompany = originalCompany; + } + + public String getTargetCompany() { + return this.targetCompany; + } + + public void setTargetCompany(String targetCompany) { + this.targetCompany = targetCompany; + } + + public String getOriginalContractNumber() { + return this.originalContractNumber; + } + + public void setOriginalContractNumber(String originalContractNumber) { + this.originalContractNumber = originalContractNumber; + } + + public String getTargetContractNumber() { + return this.targetContractNumber; + } + + public void setTargetContractNumber(String targetContractNumber) { + this.targetContractNumber = targetContractNumber; + } + + public String getOriginalContractType() { + return this.originalContractType; + } + + public void setOriginalContractType(String originalContractType) { + this.originalContractType = originalContractType; + } + + public String getTargetContractType() { + return this.targetContractType; + } + + public void setTargetContractType(String targetContractType) { + this.targetContractType = targetContractType; + } + + public String getOriginalDurationType() { + return this.originalDurationType; + } + + public void setOriginalDurationType(String originalDurationType) { + this.originalDurationType = originalDurationType; + } + + public String getTargetDurationType() { + return this.targetDurationType; + } + + public void setTargetDurationType(String targetDurationType) { + this.targetDurationType = targetDurationType; + } + + public String getOriginalSigningType() { + return this.originalSigningType; + } + + public void setOriginalSigningType(String originalSigningType) { + this.originalSigningType = originalSigningType; + } + + public String getTargetSigningType() { + return this.targetSigningType; + } + + public void setTargetSigningType(String targetSigningType) { + this.targetSigningType = targetSigningType; + } + + public String getOriginalContractStartDate() { + return this.originalContractStartDate; + } + + public void setOriginalContractStartDate(String originalContractStartDate) { + this.originalContractStartDate = originalContractStartDate; + } + + public String getTargetContractStartDate() { + return this.targetContractStartDate; + } + + public void setTargetContractStartDate(String targetContractStartDate) { + this.targetContractStartDate = targetContractStartDate; + } + + public String getOriginalContractEndDate() { + return this.originalContractEndDate; + } + + public void setOriginalContractEndDate(String originalContractEndDate) { + this.originalContractEndDate = originalContractEndDate; + } + + public String getTargetContractEndDate() { + return this.targetContractEndDate; + } + + public void setTargetContractEndDate(String targetContractEndDate) { + this.targetContractEndDate = targetContractEndDate; + } + + public String getOriginalWorkingHoursType() { + return this.originalWorkingHoursType; + } + + public void setOriginalWorkingHoursType(String originalWorkingHoursType) { + this.originalWorkingHoursType = originalWorkingHoursType; + } + + public String getTargetWorkingHoursType() { + return this.targetWorkingHoursType; + } + + public void setTargetWorkingHoursType(String targetWorkingHoursType) { + this.targetWorkingHoursType = targetWorkingHoursType; + } + + public String getOriginalWorkingCalendar() { + return this.originalWorkingCalendar; + } + + public void setOriginalWorkingCalendar(String originalWorkingCalendar) { + this.originalWorkingCalendar = originalWorkingCalendar; + } + + public String getTargetWorkingCalendar() { + return this.targetWorkingCalendar; + } + + public void setTargetWorkingCalendar(String targetWorkingCalendar) { + this.targetWorkingCalendar = targetWorkingCalendar; + } + + public String getOriginalProbationEndDate() { + return this.originalProbationEndDate; + } + + public void setOriginalProbationEndDate(String originalProbationEndDate) { + this.originalProbationEndDate = originalProbationEndDate; + } + + public String getTargetProbationEndDate() { + return this.targetProbationEndDate; + } + + public void setTargetProbationEndDate(String targetProbationEndDate) { + this.targetProbationEndDate = targetProbationEndDate; + } + + public String getOriginalWeeklyWorkingHours() { + return this.originalWeeklyWorkingHours; + } + + public void setOriginalWeeklyWorkingHours(String originalWeeklyWorkingHours) { + this.originalWeeklyWorkingHours = originalWeeklyWorkingHours; + } + + public String getTargetWeeklyWorkingHours() { + return this.targetWeeklyWorkingHours; + } + + public void setTargetWeeklyWorkingHours(String targetWeeklyWorkingHours) { + this.targetWeeklyWorkingHours = targetWeeklyWorkingHours; + } + + public String getOriginalWorkShift() { + return this.originalWorkShift; + } + + public void setOriginalWorkShift(String originalWorkShift) { + this.originalWorkShift = originalWorkShift; + } + + public String getTargetWorkShift() { + return this.targetWorkShift; + } + + public void setTargetWorkShift(String targetWorkShift) { + this.targetWorkShift = targetWorkShift; + } + + public JobDataCostCenter[] getOriginalCostCenterRate() { + return this.originalCostCenterRate; + } + + public void setOriginalCostCenterRate(JobDataCostCenter[] originalCostCenterRate) { + this.originalCostCenterRate = originalCostCenterRate; + } + + public JobDataCostCenter[] getTargetCostCenterRate() { + return this.targetCostCenterRate; + } + + public void setTargetCostCenterRate(JobDataCostCenter[] targetCostCenterRate) { + this.targetCostCenterRate = targetCostCenterRate; + } + + public TranferEmploymentInfo getOriginalEmploymentChange() { + return this.originalEmploymentChange; + } + + public void setOriginalEmploymentChange(TranferEmploymentInfo originalEmploymentChange) { + this.originalEmploymentChange = originalEmploymentChange; + } + + public TranferEmploymentInfo getTargetEmploymentChange() { + return this.targetEmploymentChange; + } + + public void setTargetEmploymentChange(TranferEmploymentInfo targetEmploymentChange) { + this.targetEmploymentChange = targetEmploymentChange; + } + + public String getOriginalJobGrade() { + return this.originalJobGrade; + } + + public void setOriginalJobGrade(String originalJobGrade) { + this.originalJobGrade = originalJobGrade; + } + + public String getTargetJobGrade() { + return this.targetJobGrade; + } + + public void setTargetJobGrade(String targetJobGrade) { + this.targetJobGrade = targetJobGrade; + } + + public static class Builder { + /** + * 备注 + *

示例值:异动详情 + */ + private String remark; + /** + * offer信息 + *

示例值:优质人才,加急处理 + */ + private String offerInfo; + /** + * 是否撤销虚线上级 + *

示例值:true + */ + private Boolean targetDottedManagerClean; + /** + * 是否有试用期 + *

示例值:false + */ + private Boolean probationExist; + /** + * 原部门 + *

示例值:6966236933198579208 + */ + private String originalDepartment; + /** + * 新部门 + *

示例值:6966236933198579208 + */ + private String targetDepartment; + /** + * 原工作地点 + *

示例值:6967271100992587295 + */ + private String originalWorkLocation; + /** + * 新工作地点 + *

示例值:6967271100992587295 + */ + private String targetWorkLocation; + /** + * 原直属上级 + *

示例值:6974641477444060708 + */ + private String originalDirectManager; + /** + * 新直属上级 + *

示例值:7013619729281713671 + */ + private String targetDirectManager; + /** + * 原虚线上级 + *

示例值:6974648866876573198 + */ + private String originalDottedManager; + /** + * 新虚线上级 + *

示例值:7013328578351842852 + */ + private String targetDottedManager; + /** + * 原职务 + *

示例值:6969469398088287751 + */ + private String originalJob; + /** + * 新职务 + *

示例值:6969469557836760606 + */ + private String targetJob; + /** + * 原序列 + *

示例值:6967287547462419975 + */ + private String originalJobFamily; + /** + * 新序列 + *

示例值:6967287547462419975 + */ + private String targetJobFamily; + /** + * 原级别 + *

示例值:6972085707674355214 + */ + private String originalJobLevel; + /** + * 新级别 + *

示例值:6972085707674355214 + */ + private String targetJobLevel; + /** + * 原人员类型 + *

示例值:6968386026792289828 + */ + private String originalWorkforceType; + /** + * 新人员类型 + *

示例值:7036268995372303885 + */ + private String targetWorkforceType; + /** + * 原公司 + *

示例值:6974659700705068581 + */ + private String originalCompany; + /** + * 新公司 + *

示例值:6974659700705068581 + */ + private String targetCompany; + /** + * 原合同编号 + *

示例值:55332 + */ + private String originalContractNumber; + /** + * 新合同编号 + *

示例值:55333 + */ + private String targetContractNumber; + /** + * 原合同类型 + *

示例值:labor_contract + */ + private String originalContractType; + /** + * 新合同类型 + *

示例值:labor_contract + */ + private String targetContractType; + /** + * 原期限类型 + *

示例值:fixed_term + */ + private String originalDurationType; + /** + * 新期限类型 + *

示例值:fixed_term + */ + private String targetDurationType; + /** + * 原签订类型 + *

示例值:new + */ + private String originalSigningType; + /** + * 新签订类型 + *

示例值:new + */ + private String targetSigningType; + /** + * 原合同开始日期 + *

示例值:2021-07-01 + */ + private String originalContractStartDate; + /** + * 新合同开始日期 + *

示例值:2021-07-01 + */ + private String targetContractStartDate; + /** + * 原合同结束日期 + *

示例值:2024-07-01 + */ + private String originalContractEndDate; + /** + * 新合同结束日期 + *

示例值:2024-07-01 + */ + private String targetContractEndDate; + /** + * 原工时制度 + *

示例值:6969087376740206087 + */ + private String originalWorkingHoursType; + /** + * 新工时制度 + *

示例值:6969087376740206087 + */ + private String targetWorkingHoursType; + /** + * 原工作日历 + *

示例值:6969087376740236087 + */ + private String originalWorkingCalendar; + /** + * 新工作日历 + *

示例值:6969087376740236087 + */ + private String targetWorkingCalendar; + /** + * 原试用期预计结束日期 + *

示例值:2021-11-17 + */ + private String originalProbationEndDate; + /** + * 新试用期预计结束日期 + *

示例值:2021-11-17 + */ + private String targetProbationEndDate; + /** + * 原周工作时长 + *

示例值:162 + */ + private String originalWeeklyWorkingHours; + /** + * 新周工作时长 + *

示例值:160 + */ + private String targetWeeklyWorkingHours; + /** + * 原排班 + *

示例值:work_shift + */ + private String originalWorkShift; + /** + * 新排班 + *

示例值:non_work_shift + */ + private String targetWorkShift; + /** + * 原成本中心分摊方式 + *

示例值: + */ + private JobDataCostCenter[] originalCostCenterRate; + /** + * 新成本中心分摊方式 + *

示例值: + */ + private JobDataCostCenter[] targetCostCenterRate; + /** + * 原工作信息 + *

示例值: + */ + private TranferEmploymentInfo originalEmploymentChange; + /** + * 新工作信息 + *

示例值: + */ + private TranferEmploymentInfo targetEmploymentChange; + /** + * 原职等 + *

示例值:7289005963599693366 + */ + private String originalJobGrade; + /** + * 新职等 + *

示例值:7289005963599693366 + */ + private String targetJobGrade; + + /** + * 备注 + *

示例值:异动详情 + * + * @param remark + * @return + */ + public Builder remark(String remark) { + this.remark = remark; + return this; + } + + + /** + * offer信息 + *

示例值:优质人才,加急处理 + * + * @param offerInfo + * @return + */ + public Builder offerInfo(String offerInfo) { + this.offerInfo = offerInfo; + return this; + } + + + /** + * 是否撤销虚线上级 + *

示例值:true + * + * @param targetDottedManagerClean + * @return + */ + public Builder targetDottedManagerClean(Boolean targetDottedManagerClean) { + this.targetDottedManagerClean = targetDottedManagerClean; + return this; + } + + + /** + * 是否有试用期 + *

示例值:false + * + * @param probationExist + * @return + */ + public Builder probationExist(Boolean probationExist) { + this.probationExist = probationExist; + return this; + } + + + /** + * 原部门 + *

示例值:6966236933198579208 + * + * @param originalDepartment + * @return + */ + public Builder originalDepartment(String originalDepartment) { + this.originalDepartment = originalDepartment; + return this; + } + + + /** + * 新部门 + *

示例值:6966236933198579208 + * + * @param targetDepartment + * @return + */ + public Builder targetDepartment(String targetDepartment) { + this.targetDepartment = targetDepartment; + return this; + } + + + /** + * 原工作地点 + *

示例值:6967271100992587295 + * + * @param originalWorkLocation + * @return + */ + public Builder originalWorkLocation(String originalWorkLocation) { + this.originalWorkLocation = originalWorkLocation; + return this; + } + + + /** + * 新工作地点 + *

示例值:6967271100992587295 + * + * @param targetWorkLocation + * @return + */ + public Builder targetWorkLocation(String targetWorkLocation) { + this.targetWorkLocation = targetWorkLocation; + return this; + } + + + /** + * 原直属上级 + *

示例值:6974641477444060708 + * + * @param originalDirectManager + * @return + */ + public Builder originalDirectManager(String originalDirectManager) { + this.originalDirectManager = originalDirectManager; + return this; + } + + + /** + * 新直属上级 + *

示例值:7013619729281713671 + * + * @param targetDirectManager + * @return + */ + public Builder targetDirectManager(String targetDirectManager) { + this.targetDirectManager = targetDirectManager; + return this; + } + + + /** + * 原虚线上级 + *

示例值:6974648866876573198 + * + * @param originalDottedManager + * @return + */ + public Builder originalDottedManager(String originalDottedManager) { + this.originalDottedManager = originalDottedManager; + return this; + } + + + /** + * 新虚线上级 + *

示例值:7013328578351842852 + * + * @param targetDottedManager + * @return + */ + public Builder targetDottedManager(String targetDottedManager) { + this.targetDottedManager = targetDottedManager; + return this; + } + + + /** + * 原职务 + *

示例值:6969469398088287751 + * + * @param originalJob + * @return + */ + public Builder originalJob(String originalJob) { + this.originalJob = originalJob; + return this; + } + + + /** + * 新职务 + *

示例值:6969469557836760606 + * + * @param targetJob + * @return + */ + public Builder targetJob(String targetJob) { + this.targetJob = targetJob; + return this; + } + + + /** + * 原序列 + *

示例值:6967287547462419975 + * + * @param originalJobFamily + * @return + */ + public Builder originalJobFamily(String originalJobFamily) { + this.originalJobFamily = originalJobFamily; + return this; + } + + + /** + * 新序列 + *

示例值:6967287547462419975 + * + * @param targetJobFamily + * @return + */ + public Builder targetJobFamily(String targetJobFamily) { + this.targetJobFamily = targetJobFamily; + return this; + } + + + /** + * 原级别 + *

示例值:6972085707674355214 + * + * @param originalJobLevel + * @return + */ + public Builder originalJobLevel(String originalJobLevel) { + this.originalJobLevel = originalJobLevel; + return this; + } + + + /** + * 新级别 + *

示例值:6972085707674355214 + * + * @param targetJobLevel + * @return + */ + public Builder targetJobLevel(String targetJobLevel) { + this.targetJobLevel = targetJobLevel; + return this; + } + + + /** + * 原人员类型 + *

示例值:6968386026792289828 + * + * @param originalWorkforceType + * @return + */ + public Builder originalWorkforceType(String originalWorkforceType) { + this.originalWorkforceType = originalWorkforceType; + return this; + } + + + /** + * 新人员类型 + *

示例值:7036268995372303885 + * + * @param targetWorkforceType + * @return + */ + public Builder targetWorkforceType(String targetWorkforceType) { + this.targetWorkforceType = targetWorkforceType; + return this; + } + + + /** + * 原公司 + *

示例值:6974659700705068581 + * + * @param originalCompany + * @return + */ + public Builder originalCompany(String originalCompany) { + this.originalCompany = originalCompany; + return this; + } + + + /** + * 新公司 + *

示例值:6974659700705068581 + * + * @param targetCompany + * @return + */ + public Builder targetCompany(String targetCompany) { + this.targetCompany = targetCompany; + return this; + } + + + /** + * 原合同编号 + *

示例值:55332 + * + * @param originalContractNumber + * @return + */ + public Builder originalContractNumber(String originalContractNumber) { + this.originalContractNumber = originalContractNumber; + return this; + } + + + /** + * 新合同编号 + *

示例值:55333 + * + * @param targetContractNumber + * @return + */ + public Builder targetContractNumber(String targetContractNumber) { + this.targetContractNumber = targetContractNumber; + return this; + } + + + /** + * 原合同类型 + *

示例值:labor_contract + * + * @param originalContractType + * @return + */ + public Builder originalContractType(String originalContractType) { + this.originalContractType = originalContractType; + return this; + } + + + /** + * 新合同类型 + *

示例值:labor_contract + * + * @param targetContractType + * @return + */ + public Builder targetContractType(String targetContractType) { + this.targetContractType = targetContractType; + return this; + } + + + /** + * 原期限类型 + *

示例值:fixed_term + * + * @param originalDurationType + * @return + */ + public Builder originalDurationType(String originalDurationType) { + this.originalDurationType = originalDurationType; + return this; + } + + + /** + * 新期限类型 + *

示例值:fixed_term + * + * @param targetDurationType + * @return + */ + public Builder targetDurationType(String targetDurationType) { + this.targetDurationType = targetDurationType; + return this; + } + + + /** + * 原签订类型 + *

示例值:new + * + * @param originalSigningType + * @return + */ + public Builder originalSigningType(String originalSigningType) { + this.originalSigningType = originalSigningType; + return this; + } + + + /** + * 新签订类型 + *

示例值:new + * + * @param targetSigningType + * @return + */ + public Builder targetSigningType(String targetSigningType) { + this.targetSigningType = targetSigningType; + return this; + } + + + /** + * 原合同开始日期 + *

示例值:2021-07-01 + * + * @param originalContractStartDate + * @return + */ + public Builder originalContractStartDate(String originalContractStartDate) { + this.originalContractStartDate = originalContractStartDate; + return this; + } + + + /** + * 新合同开始日期 + *

示例值:2021-07-01 + * + * @param targetContractStartDate + * @return + */ + public Builder targetContractStartDate(String targetContractStartDate) { + this.targetContractStartDate = targetContractStartDate; + return this; + } + + + /** + * 原合同结束日期 + *

示例值:2024-07-01 + * + * @param originalContractEndDate + * @return + */ + public Builder originalContractEndDate(String originalContractEndDate) { + this.originalContractEndDate = originalContractEndDate; + return this; + } + + + /** + * 新合同结束日期 + *

示例值:2024-07-01 + * + * @param targetContractEndDate + * @return + */ + public Builder targetContractEndDate(String targetContractEndDate) { + this.targetContractEndDate = targetContractEndDate; + return this; + } + + + /** + * 原工时制度 + *

示例值:6969087376740206087 + * + * @param originalWorkingHoursType + * @return + */ + public Builder originalWorkingHoursType(String originalWorkingHoursType) { + this.originalWorkingHoursType = originalWorkingHoursType; + return this; + } + + + /** + * 新工时制度 + *

示例值:6969087376740206087 + * + * @param targetWorkingHoursType + * @return + */ + public Builder targetWorkingHoursType(String targetWorkingHoursType) { + this.targetWorkingHoursType = targetWorkingHoursType; + return this; + } + + + /** + * 原工作日历 + *

示例值:6969087376740236087 + * + * @param originalWorkingCalendar + * @return + */ + public Builder originalWorkingCalendar(String originalWorkingCalendar) { + this.originalWorkingCalendar = originalWorkingCalendar; + return this; + } + + + /** + * 新工作日历 + *

示例值:6969087376740236087 + * + * @param targetWorkingCalendar + * @return + */ + public Builder targetWorkingCalendar(String targetWorkingCalendar) { + this.targetWorkingCalendar = targetWorkingCalendar; + return this; + } + + + /** + * 原试用期预计结束日期 + *

示例值:2021-11-17 + * + * @param originalProbationEndDate + * @return + */ + public Builder originalProbationEndDate(String originalProbationEndDate) { + this.originalProbationEndDate = originalProbationEndDate; + return this; + } + + + /** + * 新试用期预计结束日期 + *

示例值:2021-11-17 + * + * @param targetProbationEndDate + * @return + */ + public Builder targetProbationEndDate(String targetProbationEndDate) { + this.targetProbationEndDate = targetProbationEndDate; + return this; + } + + + /** + * 原周工作时长 + *

示例值:162 + * + * @param originalWeeklyWorkingHours + * @return + */ + public Builder originalWeeklyWorkingHours(String originalWeeklyWorkingHours) { + this.originalWeeklyWorkingHours = originalWeeklyWorkingHours; + return this; + } + + + /** + * 新周工作时长 + *

示例值:160 + * + * @param targetWeeklyWorkingHours + * @return + */ + public Builder targetWeeklyWorkingHours(String targetWeeklyWorkingHours) { + this.targetWeeklyWorkingHours = targetWeeklyWorkingHours; + return this; + } + + + /** + * 原排班 + *

示例值:work_shift + * + * @param originalWorkShift + * @return + */ + public Builder originalWorkShift(String originalWorkShift) { + this.originalWorkShift = originalWorkShift; + return this; + } + + + /** + * 新排班 + *

示例值:non_work_shift + * + * @param targetWorkShift + * @return + */ + public Builder targetWorkShift(String targetWorkShift) { + this.targetWorkShift = targetWorkShift; + return this; + } + + + /** + * 原成本中心分摊方式 + *

示例值: + * + * @param originalCostCenterRate + * @return + */ + public Builder originalCostCenterRate(JobDataCostCenter[] originalCostCenterRate) { + this.originalCostCenterRate = originalCostCenterRate; + return this; + } + + + /** + * 新成本中心分摊方式 + *

示例值: + * + * @param targetCostCenterRate + * @return + */ + public Builder targetCostCenterRate(JobDataCostCenter[] targetCostCenterRate) { + this.targetCostCenterRate = targetCostCenterRate; + return this; + } + + + /** + * 原工作信息 + *

示例值: + * + * @param originalEmploymentChange + * @return + */ + public Builder originalEmploymentChange(TranferEmploymentInfo originalEmploymentChange) { + this.originalEmploymentChange = originalEmploymentChange; + return this; + } + + + /** + * 新工作信息 + *

示例值: + * + * @param targetEmploymentChange + * @return + */ + public Builder targetEmploymentChange(TranferEmploymentInfo targetEmploymentChange) { + this.targetEmploymentChange = targetEmploymentChange; + return this; + } + + + /** + * 原职等 + *

示例值:7289005963599693366 + * + * @param originalJobGrade + * @return + */ + public Builder originalJobGrade(String originalJobGrade) { + this.originalJobGrade = originalJobGrade; + return this; + } + + + /** + * 新职等 + *

示例值:7289005963599693366 + * + * @param targetJobGrade + * @return + */ + public Builder targetJobGrade(String targetJobGrade) { + this.targetJobGrade = targetJobGrade; + return this; + } + + + public TransferInfo build() { + return new TransferInfo(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/UserContact.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/UserContact.java new file mode 100644 index 000000000..4155b329d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/UserContact.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class UserContact { + /** + * 手机号对应的在离职员工id列表 + *

示例值: + */ + @SerializedName("user_ids") + private String[] userIds; + /** + * 手机号 + *

示例值:13011111111 + */ + @SerializedName("mobile") + private String mobile; + + // builder 开始 + public UserContact() { + } + + public UserContact(Builder builder) { + /** + * 手机号对应的在离职员工id列表 + *

示例值: + */ + this.userIds = builder.userIds; + /** + * 手机号 + *

示例值:13011111111 + */ + this.mobile = builder.mobile; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String[] getUserIds() { + return this.userIds; + } + + public void setUserIds(String[] userIds) { + this.userIds = userIds; + } + + public String getMobile() { + return this.mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public static class Builder { + /** + * 手机号对应的在离职员工id列表 + *

示例值: + */ + private String[] userIds; + /** + * 手机号 + *

示例值:13011111111 + */ + private String mobile; + + /** + * 手机号对应的在离职员工id列表 + *

示例值: + * + * @param userIds + * @return + */ + public Builder userIds(String[] userIds) { + this.userIds = userIds; + return this; + } + + + /** + * 手机号 + *

示例值:13011111111 + * + * @param mobile + * @return + */ + public Builder mobile(String mobile) { + this.mobile = mobile; + return this; + } + + + public UserContact build() { + return new UserContact(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/UserInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/UserInfo.java new file mode 100644 index 000000000..b697b28f0 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/UserInfo.java @@ -0,0 +1,407 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class UserInfo { + /** + * 员工id + *

示例值:3e3cf96b + */ + @SerializedName("user_id") + private String userId; + /** + * 用户默认名 + *

示例值:张三 + */ + @SerializedName("name") + private String name; + /** + * 中文名 + *

示例值:张三 + */ + @SerializedName("zh_name") + private String zhName; + /** + * 英文名 + *

示例值:zhang san + */ + @SerializedName("en_name") + private String enName; + /** + * 手机号 + *

示例值:13011111111 + */ + @SerializedName("mobile") + private String mobile; + /** + * 员工工号 + *

示例值:1 + */ + @SerializedName("employee_no") + private String employeeNo; + /** + * 邮箱 + *

示例值:zhangsan@gmail.com + */ + @SerializedName("email") + private String email; + /** + * 用户是否离职 + *

示例值:true + */ + @SerializedName("is_resigned") + private Boolean isResigned; + /** + * 离职时间,时间戳格式,表示从1970年1月1日开始所经过的秒数 + *

示例值:1672502400 + */ + @SerializedName("resign_time") + private String resignTime; + /** + * 离职日期 + *

示例值:2023-01-01 + */ + @SerializedName("resign_date") + private String resignDate; + + // builder 开始 + public UserInfo() { + } + + public UserInfo(Builder builder) { + /** + * 员工id + *

示例值:3e3cf96b + */ + this.userId = builder.userId; + /** + * 用户默认名 + *

示例值:张三 + */ + this.name = builder.name; + /** + * 中文名 + *

示例值:张三 + */ + this.zhName = builder.zhName; + /** + * 英文名 + *

示例值:zhang san + */ + this.enName = builder.enName; + /** + * 手机号 + *

示例值:13011111111 + */ + this.mobile = builder.mobile; + /** + * 员工工号 + *

示例值:1 + */ + this.employeeNo = builder.employeeNo; + /** + * 邮箱 + *

示例值:zhangsan@gmail.com + */ + this.email = builder.email; + /** + * 用户是否离职 + *

示例值:true + */ + this.isResigned = builder.isResigned; + /** + * 离职时间,时间戳格式,表示从1970年1月1日开始所经过的秒数 + *

示例值:1672502400 + */ + this.resignTime = builder.resignTime; + /** + * 离职日期 + *

示例值:2023-01-01 + */ + this.resignDate = builder.resignDate; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserId() { + return this.userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getZhName() { + return this.zhName; + } + + public void setZhName(String zhName) { + this.zhName = zhName; + } + + public String getEnName() { + return this.enName; + } + + public void setEnName(String enName) { + this.enName = enName; + } + + public String getMobile() { + return this.mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getEmployeeNo() { + return this.employeeNo; + } + + public void setEmployeeNo(String employeeNo) { + this.employeeNo = employeeNo; + } + + public String getEmail() { + return this.email; + } + + public void setEmail(String email) { + this.email = email; + } + + public Boolean getIsResigned() { + return this.isResigned; + } + + public void setIsResigned(Boolean isResigned) { + this.isResigned = isResigned; + } + + public String getResignTime() { + return this.resignTime; + } + + public void setResignTime(String resignTime) { + this.resignTime = resignTime; + } + + public String getResignDate() { + return this.resignDate; + } + + public void setResignDate(String resignDate) { + this.resignDate = resignDate; + } + + public static class Builder { + /** + * 员工id + *

示例值:3e3cf96b + */ + private String userId; + /** + * 用户默认名 + *

示例值:张三 + */ + private String name; + /** + * 中文名 + *

示例值:张三 + */ + private String zhName; + /** + * 英文名 + *

示例值:zhang san + */ + private String enName; + /** + * 手机号 + *

示例值:13011111111 + */ + private String mobile; + /** + * 员工工号 + *

示例值:1 + */ + private String employeeNo; + /** + * 邮箱 + *

示例值:zhangsan@gmail.com + */ + private String email; + /** + * 用户是否离职 + *

示例值:true + */ + private Boolean isResigned; + /** + * 离职时间,时间戳格式,表示从1970年1月1日开始所经过的秒数 + *

示例值:1672502400 + */ + private String resignTime; + /** + * 离职日期 + *

示例值:2023-01-01 + */ + private String resignDate; + + /** + * 员工id + *

示例值:3e3cf96b + * + * @param userId + * @return + */ + public Builder userId(String userId) { + this.userId = userId; + return this; + } + + + /** + * 用户默认名 + *

示例值:张三 + * + * @param name + * @return + */ + public Builder name(String name) { + this.name = name; + return this; + } + + + /** + * 中文名 + *

示例值:张三 + * + * @param zhName + * @return + */ + public Builder zhName(String zhName) { + this.zhName = zhName; + return this; + } + + + /** + * 英文名 + *

示例值:zhang san + * + * @param enName + * @return + */ + public Builder enName(String enName) { + this.enName = enName; + return this; + } + + + /** + * 手机号 + *

示例值:13011111111 + * + * @param mobile + * @return + */ + public Builder mobile(String mobile) { + this.mobile = mobile; + return this; + } + + + /** + * 员工工号 + *

示例值:1 + * + * @param employeeNo + * @return + */ + public Builder employeeNo(String employeeNo) { + this.employeeNo = employeeNo; + return this; + } + + + /** + * 邮箱 + *

示例值:zhangsan@gmail.com + * + * @param email + * @return + */ + public Builder email(String email) { + this.email = email; + return this; + } + + + /** + * 用户是否离职 + *

示例值:true + * + * @param isResigned + * @return + */ + public Builder isResigned(Boolean isResigned) { + this.isResigned = isResigned; + return this; + } + + + /** + * 离职时间,时间戳格式,表示从1970年1月1日开始所经过的秒数 + *

示例值:1672502400 + * + * @param resignTime + * @return + */ + public Builder resignTime(String resignTime) { + this.resignTime = resignTime; + return this; + } + + + /** + * 离职日期 + *

示例值:2023-01-01 + * + * @param resignDate + * @return + */ + public Builder resignDate(String resignDate) { + this.resignDate = resignDate; + return this; + } + + + public UserInfo build() { + return new UserInfo(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/WorkEmail.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/WorkEmail.java new file mode 100644 index 000000000..11d5df2c7 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/WorkEmail.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class WorkEmail { + /** + * 邮箱地址 + *

示例值:1234567@bytedance.com + */ + @SerializedName("email") + private String email; + /** + * 邮箱用途,枚举值可通过文档【飞书人事枚举常量】邮箱用途(email_usage)枚举定义获得 + *

示例值: + */ + @SerializedName("email_usage") + private Enum emailUsage; + + // builder 开始 + public WorkEmail() { + } + + public WorkEmail(Builder builder) { + /** + * 邮箱地址 + *

示例值:1234567@bytedance.com + */ + this.email = builder.email; + /** + * 邮箱用途,枚举值可通过文档【飞书人事枚举常量】邮箱用途(email_usage)枚举定义获得 + *

示例值: + */ + this.emailUsage = builder.emailUsage; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getEmail() { + return this.email; + } + + public void setEmail(String email) { + this.email = email; + } + + public Enum getEmailUsage() { + return this.emailUsage; + } + + public void setEmailUsage(Enum emailUsage) { + this.emailUsage = emailUsage; + } + + public static class Builder { + /** + * 邮箱地址 + *

示例值:1234567@bytedance.com + */ + private String email; + /** + * 邮箱用途,枚举值可通过文档【飞书人事枚举常量】邮箱用途(email_usage)枚举定义获得 + *

示例值: + */ + private Enum emailUsage; + + /** + * 邮箱地址 + *

示例值:1234567@bytedance.com + * + * @param email + * @return + */ + public Builder email(String email) { + this.email = email; + return this; + } + + + /** + * 邮箱用途,枚举值可通过文档【飞书人事枚举常量】邮箱用途(email_usage)枚举定义获得 + *

示例值: + * + * @param emailUsage + * @return + */ + public Builder emailUsage(Enum emailUsage) { + this.emailUsage = emailUsage; + return this; + } + + + public WorkEmail build() { + return new WorkEmail(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/WorkExperience.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/WorkExperience.java new file mode 100644 index 000000000..c3c84c162 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/WorkExperience.java @@ -0,0 +1,222 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class WorkExperience { + /** + * 公司名称 + *

示例值:猎豹 + */ + @SerializedName("company_name") + private String companyName; + /** + * 开始时间 + *

示例值:2015-02-01 + */ + @SerializedName("start_time") + private String startTime; + /** + * 结束时间 + *

示例值:2017-02-01 + */ + @SerializedName("end_time") + private String endTime; + /** + * 岗位 + *

示例值:产品经理 + */ + @SerializedName("job_title") + private String jobTitle; + /** + * 工作描述 + *

示例值:app + */ + @SerializedName("description") + private String description; + + // builder 开始 + public WorkExperience() { + } + + public WorkExperience(Builder builder) { + /** + * 公司名称 + *

示例值:猎豹 + */ + this.companyName = builder.companyName; + /** + * 开始时间 + *

示例值:2015-02-01 + */ + this.startTime = builder.startTime; + /** + * 结束时间 + *

示例值:2017-02-01 + */ + this.endTime = builder.endTime; + /** + * 岗位 + *

示例值:产品经理 + */ + this.jobTitle = builder.jobTitle; + /** + * 工作描述 + *

示例值:app + */ + this.description = builder.description; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getCompanyName() { + return this.companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + public String getStartTime() { + return this.startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return this.endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public String getJobTitle() { + return this.jobTitle; + } + + public void setJobTitle(String jobTitle) { + this.jobTitle = jobTitle; + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public static class Builder { + /** + * 公司名称 + *

示例值:猎豹 + */ + private String companyName; + /** + * 开始时间 + *

示例值:2015-02-01 + */ + private String startTime; + /** + * 结束时间 + *

示例值:2017-02-01 + */ + private String endTime; + /** + * 岗位 + *

示例值:产品经理 + */ + private String jobTitle; + /** + * 工作描述 + *

示例值:app + */ + private String description; + + /** + * 公司名称 + *

示例值:猎豹 + * + * @param companyName + * @return + */ + public Builder companyName(String companyName) { + this.companyName = companyName; + return this; + } + + + /** + * 开始时间 + *

示例值:2015-02-01 + * + * @param startTime + * @return + */ + public Builder startTime(String startTime) { + this.startTime = startTime; + return this; + } + + + /** + * 结束时间 + *

示例值:2017-02-01 + * + * @param endTime + * @return + */ + public Builder endTime(String endTime) { + this.endTime = endTime; + return this; + } + + + /** + * 岗位 + *

示例值:产品经理 + * + * @param jobTitle + * @return + */ + public Builder jobTitle(String jobTitle) { + this.jobTitle = jobTitle; + return this; + } + + + /** + * 工作描述 + *

示例值:app + * + * @param description + * @return + */ + public Builder description(String description) { + this.description = description; + return this; + } + + + public WorkExperience build() { + return new WorkExperience(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/WorkExperienceInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/WorkExperienceInfo.java new file mode 100644 index 000000000..74d767f70 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/WorkExperienceInfo.java @@ -0,0 +1,296 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class WorkExperienceInfo { + /** + * 公司 / 组织 + *

示例值: + */ + @SerializedName("company_organization") + private I18n[] companyOrganization; + /** + * 部门 + *

示例值: + */ + @SerializedName("department") + private I18n[] department; + /** + * 岗位 + *

示例值: + */ + @SerializedName("job") + private I18n[] job; + /** + * 工作描述 + *

示例值: + */ + @SerializedName("description") + private I18n[] description; + /** + * 开始日期 + *

示例值:2020-01-01 + */ + @SerializedName("start_date") + private String startDate; + /** + * 结束日期 + *

示例值:2020-01-01 + */ + @SerializedName("end_date") + private String endDate; + /** + * 自定义字段 + *

示例值: + */ + @SerializedName("custom_fields") + private CustomFieldData[] customFields; + + // builder 开始 + public WorkExperienceInfo() { + } + + public WorkExperienceInfo(Builder builder) { + /** + * 公司 / 组织 + *

示例值: + */ + this.companyOrganization = builder.companyOrganization; + /** + * 部门 + *

示例值: + */ + this.department = builder.department; + /** + * 岗位 + *

示例值: + */ + this.job = builder.job; + /** + * 工作描述 + *

示例值: + */ + this.description = builder.description; + /** + * 开始日期 + *

示例值:2020-01-01 + */ + this.startDate = builder.startDate; + /** + * 结束日期 + *

示例值:2020-01-01 + */ + this.endDate = builder.endDate; + /** + * 自定义字段 + *

示例值: + */ + this.customFields = builder.customFields; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public I18n[] getCompanyOrganization() { + return this.companyOrganization; + } + + public void setCompanyOrganization(I18n[] companyOrganization) { + this.companyOrganization = companyOrganization; + } + + public I18n[] getDepartment() { + return this.department; + } + + public void setDepartment(I18n[] department) { + this.department = department; + } + + public I18n[] getJob() { + return this.job; + } + + public void setJob(I18n[] job) { + this.job = job; + } + + public I18n[] getDescription() { + return this.description; + } + + public void setDescription(I18n[] description) { + this.description = description; + } + + public String getStartDate() { + return this.startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return this.endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public CustomFieldData[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(CustomFieldData[] customFields) { + this.customFields = customFields; + } + + public static class Builder { + /** + * 公司 / 组织 + *

示例值: + */ + private I18n[] companyOrganization; + /** + * 部门 + *

示例值: + */ + private I18n[] department; + /** + * 岗位 + *

示例值: + */ + private I18n[] job; + /** + * 工作描述 + *

示例值: + */ + private I18n[] description; + /** + * 开始日期 + *

示例值:2020-01-01 + */ + private String startDate; + /** + * 结束日期 + *

示例值:2020-01-01 + */ + private String endDate; + /** + * 自定义字段 + *

示例值: + */ + private CustomFieldData[] customFields; + + /** + * 公司 / 组织 + *

示例值: + * + * @param companyOrganization + * @return + */ + public Builder companyOrganization(I18n[] companyOrganization) { + this.companyOrganization = companyOrganization; + return this; + } + + + /** + * 部门 + *

示例值: + * + * @param department + * @return + */ + public Builder department(I18n[] department) { + this.department = department; + return this; + } + + + /** + * 岗位 + *

示例值: + * + * @param job + * @return + */ + public Builder job(I18n[] job) { + this.job = job; + return this; + } + + + /** + * 工作描述 + *

示例值: + * + * @param description + * @return + */ + public Builder description(I18n[] description) { + this.description = description; + return this; + } + + + /** + * 开始日期 + *

示例值:2020-01-01 + * + * @param startDate + * @return + */ + public Builder startDate(String startDate) { + this.startDate = startDate; + return this; + } + + + /** + * 结束日期 + *

示例值:2020-01-01 + * + * @param endDate + * @return + */ + public Builder endDate(String endDate) { + this.endDate = endDate; + return this; + } + + + /** + * 自定义字段 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(CustomFieldData[] customFields) { + this.customFields = customFields; + return this; + } + + + public WorkExperienceInfo build() { + return new WorkExperienceInfo(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/WorkforcePlan.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/WorkforcePlan.java new file mode 100644 index 000000000..1ca5c55c6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/WorkforcePlan.java @@ -0,0 +1,222 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class WorkforcePlan { + /** + * 编制规划方案 ID + *

示例值:"123456" + */ + @SerializedName("workforce_plan_id") + private String workforcePlanId; + /** + * 编制规划方案名称 + *

示例值: + */ + @SerializedName("workforce_plan_name") + private I18n[] workforcePlanName; + /** + * 开始日期 + *

示例值:"2020-10-01" + */ + @SerializedName("start_date") + private String startDate; + /** + * 结束日期 + *

示例值:"2020-10-31" + */ + @SerializedName("end_date") + private String endDate; + /** + * 是否启用 + *

示例值:true + */ + @SerializedName("active") + private Boolean active; + + // builder 开始 + public WorkforcePlan() { + } + + public WorkforcePlan(Builder builder) { + /** + * 编制规划方案 ID + *

示例值:"123456" + */ + this.workforcePlanId = builder.workforcePlanId; + /** + * 编制规划方案名称 + *

示例值: + */ + this.workforcePlanName = builder.workforcePlanName; + /** + * 开始日期 + *

示例值:"2020-10-01" + */ + this.startDate = builder.startDate; + /** + * 结束日期 + *

示例值:"2020-10-31" + */ + this.endDate = builder.endDate; + /** + * 是否启用 + *

示例值:true + */ + this.active = builder.active; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getWorkforcePlanId() { + return this.workforcePlanId; + } + + public void setWorkforcePlanId(String workforcePlanId) { + this.workforcePlanId = workforcePlanId; + } + + public I18n[] getWorkforcePlanName() { + return this.workforcePlanName; + } + + public void setWorkforcePlanName(I18n[] workforcePlanName) { + this.workforcePlanName = workforcePlanName; + } + + public String getStartDate() { + return this.startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return this.endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public Boolean getActive() { + return this.active; + } + + public void setActive(Boolean active) { + this.active = active; + } + + public static class Builder { + /** + * 编制规划方案 ID + *

示例值:"123456" + */ + private String workforcePlanId; + /** + * 编制规划方案名称 + *

示例值: + */ + private I18n[] workforcePlanName; + /** + * 开始日期 + *

示例值:"2020-10-01" + */ + private String startDate; + /** + * 结束日期 + *

示例值:"2020-10-31" + */ + private String endDate; + /** + * 是否启用 + *

示例值:true + */ + private Boolean active; + + /** + * 编制规划方案 ID + *

示例值:"123456" + * + * @param workforcePlanId + * @return + */ + public Builder workforcePlanId(String workforcePlanId) { + this.workforcePlanId = workforcePlanId; + return this; + } + + + /** + * 编制规划方案名称 + *

示例值: + * + * @param workforcePlanName + * @return + */ + public Builder workforcePlanName(I18n[] workforcePlanName) { + this.workforcePlanName = workforcePlanName; + return this; + } + + + /** + * 开始日期 + *

示例值:"2020-10-01" + * + * @param startDate + * @return + */ + public Builder startDate(String startDate) { + this.startDate = startDate; + return this; + } + + + /** + * 结束日期 + *

示例值:"2020-10-31" + * + * @param endDate + * @return + */ + public Builder endDate(String endDate) { + this.endDate = endDate; + return this; + } + + + /** + * 是否启用 + *

示例值:true + * + * @param active + * @return + */ + public Builder active(Boolean active) { + this.active = active; + return this; + } + + + public WorkforcePlan build() { + return new WorkforcePlan(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/WorkforcePlanDetail.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/WorkforcePlanDetail.java new file mode 100644 index 000000000..d4c96d959 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/WorkforcePlanDetail.java @@ -0,0 +1,407 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class WorkforcePlanDetail { + /** + * 编制规划明细 ID + *

示例值:"123456" + */ + @SerializedName("workforce_plan_detail_id") + private String workforcePlanDetailId; + /** + * 部门信息 + *

示例值: + */ + @SerializedName("department") + private DimensionInfo department; + /** + * 人员类型信息 + *

示例值: + */ + @SerializedName("employee_type") + private DimensionInfo employeeType; + /** + * 工作地点信息 + *

示例值: + */ + @SerializedName("work_location") + private DimensionInfo workLocation; + /** + * 序列信息 + *

示例值: + */ + @SerializedName("job_family") + private DimensionInfo jobFamily; + /** + * 职级信息 + *

示例值: + */ + @SerializedName("job_level") + private DimensionInfo jobLevel; + /** + * 职务信息 + *

示例值: + */ + @SerializedName("job") + private DimensionInfo job; + /** + * 成本中心信息 + *

示例值: + */ + @SerializedName("cost_center") + private DimensionInfo costCenter; + /** + * 编制规划值 + *

示例值:10.00 + */ + @SerializedName("workforce_plan") + private String workforcePlan; + /** + * 预估在职人数明细 + *

示例值: + */ + @SerializedName("estimated_active_individuals_detail") + private WorkforcePlanEaiDetail[] estimatedActiveIndividualsDetail; + + // builder 开始 + public WorkforcePlanDetail() { + } + + public WorkforcePlanDetail(Builder builder) { + /** + * 编制规划明细 ID + *

示例值:"123456" + */ + this.workforcePlanDetailId = builder.workforcePlanDetailId; + /** + * 部门信息 + *

示例值: + */ + this.department = builder.department; + /** + * 人员类型信息 + *

示例值: + */ + this.employeeType = builder.employeeType; + /** + * 工作地点信息 + *

示例值: + */ + this.workLocation = builder.workLocation; + /** + * 序列信息 + *

示例值: + */ + this.jobFamily = builder.jobFamily; + /** + * 职级信息 + *

示例值: + */ + this.jobLevel = builder.jobLevel; + /** + * 职务信息 + *

示例值: + */ + this.job = builder.job; + /** + * 成本中心信息 + *

示例值: + */ + this.costCenter = builder.costCenter; + /** + * 编制规划值 + *

示例值:10.00 + */ + this.workforcePlan = builder.workforcePlan; + /** + * 预估在职人数明细 + *

示例值: + */ + this.estimatedActiveIndividualsDetail = builder.estimatedActiveIndividualsDetail; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getWorkforcePlanDetailId() { + return this.workforcePlanDetailId; + } + + public void setWorkforcePlanDetailId(String workforcePlanDetailId) { + this.workforcePlanDetailId = workforcePlanDetailId; + } + + public DimensionInfo getDepartment() { + return this.department; + } + + public void setDepartment(DimensionInfo department) { + this.department = department; + } + + public DimensionInfo getEmployeeType() { + return this.employeeType; + } + + public void setEmployeeType(DimensionInfo employeeType) { + this.employeeType = employeeType; + } + + public DimensionInfo getWorkLocation() { + return this.workLocation; + } + + public void setWorkLocation(DimensionInfo workLocation) { + this.workLocation = workLocation; + } + + public DimensionInfo getJobFamily() { + return this.jobFamily; + } + + public void setJobFamily(DimensionInfo jobFamily) { + this.jobFamily = jobFamily; + } + + public DimensionInfo getJobLevel() { + return this.jobLevel; + } + + public void setJobLevel(DimensionInfo jobLevel) { + this.jobLevel = jobLevel; + } + + public DimensionInfo getJob() { + return this.job; + } + + public void setJob(DimensionInfo job) { + this.job = job; + } + + public DimensionInfo getCostCenter() { + return this.costCenter; + } + + public void setCostCenter(DimensionInfo costCenter) { + this.costCenter = costCenter; + } + + public String getWorkforcePlan() { + return this.workforcePlan; + } + + public void setWorkforcePlan(String workforcePlan) { + this.workforcePlan = workforcePlan; + } + + public WorkforcePlanEaiDetail[] getEstimatedActiveIndividualsDetail() { + return this.estimatedActiveIndividualsDetail; + } + + public void setEstimatedActiveIndividualsDetail(WorkforcePlanEaiDetail[] estimatedActiveIndividualsDetail) { + this.estimatedActiveIndividualsDetail = estimatedActiveIndividualsDetail; + } + + public static class Builder { + /** + * 编制规划明细 ID + *

示例值:"123456" + */ + private String workforcePlanDetailId; + /** + * 部门信息 + *

示例值: + */ + private DimensionInfo department; + /** + * 人员类型信息 + *

示例值: + */ + private DimensionInfo employeeType; + /** + * 工作地点信息 + *

示例值: + */ + private DimensionInfo workLocation; + /** + * 序列信息 + *

示例值: + */ + private DimensionInfo jobFamily; + /** + * 职级信息 + *

示例值: + */ + private DimensionInfo jobLevel; + /** + * 职务信息 + *

示例值: + */ + private DimensionInfo job; + /** + * 成本中心信息 + *

示例值: + */ + private DimensionInfo costCenter; + /** + * 编制规划值 + *

示例值:10.00 + */ + private String workforcePlan; + /** + * 预估在职人数明细 + *

示例值: + */ + private WorkforcePlanEaiDetail[] estimatedActiveIndividualsDetail; + + /** + * 编制规划明细 ID + *

示例值:"123456" + * + * @param workforcePlanDetailId + * @return + */ + public Builder workforcePlanDetailId(String workforcePlanDetailId) { + this.workforcePlanDetailId = workforcePlanDetailId; + return this; + } + + + /** + * 部门信息 + *

示例值: + * + * @param department + * @return + */ + public Builder department(DimensionInfo department) { + this.department = department; + return this; + } + + + /** + * 人员类型信息 + *

示例值: + * + * @param employeeType + * @return + */ + public Builder employeeType(DimensionInfo employeeType) { + this.employeeType = employeeType; + return this; + } + + + /** + * 工作地点信息 + *

示例值: + * + * @param workLocation + * @return + */ + public Builder workLocation(DimensionInfo workLocation) { + this.workLocation = workLocation; + return this; + } + + + /** + * 序列信息 + *

示例值: + * + * @param jobFamily + * @return + */ + public Builder jobFamily(DimensionInfo jobFamily) { + this.jobFamily = jobFamily; + return this; + } + + + /** + * 职级信息 + *

示例值: + * + * @param jobLevel + * @return + */ + public Builder jobLevel(DimensionInfo jobLevel) { + this.jobLevel = jobLevel; + return this; + } + + + /** + * 职务信息 + *

示例值: + * + * @param job + * @return + */ + public Builder job(DimensionInfo job) { + this.job = job; + return this; + } + + + /** + * 成本中心信息 + *

示例值: + * + * @param costCenter + * @return + */ + public Builder costCenter(DimensionInfo costCenter) { + this.costCenter = costCenter; + return this; + } + + + /** + * 编制规划值 + *

示例值:10.00 + * + * @param workforcePlan + * @return + */ + public Builder workforcePlan(String workforcePlan) { + this.workforcePlan = workforcePlan; + return this; + } + + + /** + * 预估在职人数明细 + *

示例值: + * + * @param estimatedActiveIndividualsDetail + * @return + */ + public Builder estimatedActiveIndividualsDetail(WorkforcePlanEaiDetail[] estimatedActiveIndividualsDetail) { + this.estimatedActiveIndividualsDetail = estimatedActiveIndividualsDetail; + return this; + } + + + public WorkforcePlanDetail build() { + return new WorkforcePlanDetail(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/WorkforcePlanEaiDetail.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/WorkforcePlanEaiDetail.java new file mode 100644 index 000000000..2bc09cac2 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/model/WorkforcePlanEaiDetail.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class WorkforcePlanEaiDetail { + /** + * 预估月份 + *

示例值:“2020-10-31” + */ + @SerializedName("date") + private String date; + /** + * 预估在职人数 + *

示例值:“10.00” + */ + @SerializedName("estimated_active_individuals") + private String estimatedActiveIndividuals; + + // builder 开始 + public WorkforcePlanEaiDetail() { + } + + public WorkforcePlanEaiDetail(Builder builder) { + /** + * 预估月份 + *

示例值:“2020-10-31” + */ + this.date = builder.date; + /** + * 预估在职人数 + *

示例值:“10.00” + */ + this.estimatedActiveIndividuals = builder.estimatedActiveIndividuals; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getDate() { + return this.date; + } + + public void setDate(String date) { + this.date = date; + } + + public String getEstimatedActiveIndividuals() { + return this.estimatedActiveIndividuals; + } + + public void setEstimatedActiveIndividuals(String estimatedActiveIndividuals) { + this.estimatedActiveIndividuals = estimatedActiveIndividuals; + } + + public static class Builder { + /** + * 预估月份 + *

示例值:“2020-10-31” + */ + private String date; + /** + * 预估在职人数 + *

示例值:“10.00” + */ + private String estimatedActiveIndividuals; + + /** + * 预估月份 + *

示例值:“2020-10-31” + * + * @param date + * @return + */ + public Builder date(String date) { + this.date = date; + return this; + } + + + /** + * 预估在职人数 + *

示例值:“10.00” + * + * @param estimatedActiveIndividuals + * @return + */ + public Builder estimatedActiveIndividuals(String estimatedActiveIndividuals) { + this.estimatedActiveIndividuals = estimatedActiveIndividuals; + return this; + } + + + public WorkforcePlanEaiDetail build() { + return new WorkforcePlanEaiDetail(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Bp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Bp.java new file mode 100644 index 000000000..c788b02be --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Bp.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v2.model.GetByDepartmentBpReq; +import com.lark.oapi.service.corehr.v2.model.GetByDepartmentBpResp; +import com.lark.oapi.service.corehr.v2.model.ListBpReq; +import com.lark.oapi.service.corehr.v2.model.ListBpResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Bp { + private static final Logger log = LoggerFactory.getLogger(Bp.class); + private final Config config; + + public Bp(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get_by_department&project=corehr&resource=bp&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/GetByDepartmentBpSample.java ; + */ + public GetByDepartmentBpResp getByDepartment(GetByDepartmentBpReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/bps/get_by_department" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetByDepartmentBpResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetByDepartmentBpResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/bps/get_by_department" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get_by_department&project=corehr&resource=bp&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/GetByDepartmentBpSample.java ; + */ + public GetByDepartmentBpResp getByDepartment(GetByDepartmentBpReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/bps/get_by_department" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetByDepartmentBpResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetByDepartmentBpResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/bps/get_by_department" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,待补充 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=corehr&resource=bp&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/ListBpSample.java ; + */ + public ListBpResp list(ListBpReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v2/bps" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListBpResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListBpResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/bps" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,待补充 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=corehr&resource=bp&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/ListBpSample.java ; + */ + public ListBpResp list(ListBpReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v2/bps" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListBpResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListBpResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/bps" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Company.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Company.java new file mode 100644 index 000000000..dcdd38b3a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Company.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v2.model.BatchGetCompanyReq; +import com.lark.oapi.service.corehr.v2.model.BatchGetCompanyResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Company { + private static final Logger log = LoggerFactory.getLogger(Company.class); + private final Config config; + + public Company(Config config) { + this.config = config; + } + + + /** + * ,通过公司 ID 批量获取公司信息 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=company&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetCompanySample.java ; + */ + public BatchGetCompanyResp batchGet(BatchGetCompanyReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/companies/batch_get" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchGetCompanyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetCompanyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/companies/batch_get" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,通过公司 ID 批量获取公司信息 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=company&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetCompanySample.java ; + */ + public BatchGetCompanyResp batchGet(BatchGetCompanyReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/companies/batch_get" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchGetCompanyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetCompanyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/companies/batch_get" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Contract.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Contract.java new file mode 100644 index 000000000..3ea63ce04 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Contract.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v2.model.SearchContractReq; +import com.lark.oapi.service.corehr.v2.model.SearchContractResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Contract { + private static final Logger log = LoggerFactory.getLogger(Contract.class); + private final Config config; + + public Contract(Config config) { + this.config = config; + } + + + /** + * ,根据合同 ID 、雇佣 ID 查询合同信息 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=contract&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchContractSample.java ; + */ + public SearchContractResp search(SearchContractReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/contracts/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchContractResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchContractResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/contracts/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,根据合同 ID 、雇佣 ID 查询合同信息 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=contract&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchContractSample.java ; + */ + public SearchContractResp search(SearchContractReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/contracts/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchContractResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchContractResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/contracts/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Department.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Department.java new file mode 100644 index 000000000..bf41dd88d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Department.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v2.model.ParentsDepartmentReq; +import com.lark.oapi.service.corehr.v2.model.ParentsDepartmentResp; +import com.lark.oapi.service.corehr.v2.model.SearchDepartmentReq; +import com.lark.oapi.service.corehr.v2.model.SearchDepartmentResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Department { + private static final Logger log = LoggerFactory.getLogger(Department.class); + private final Config config; + + public Department(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=parents&project=corehr&resource=department&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/ParentsDepartmentSample.java ; + */ + public ParentsDepartmentResp parents(ParentsDepartmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/departments/parents" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ParentsDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ParentsDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/departments/parents" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=parents&project=corehr&resource=department&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/ParentsDepartmentSample.java ; + */ + public ParentsDepartmentResp parents(ParentsDepartmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/departments/parents" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ParentsDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ParentsDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/departments/parents" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,根据部门 ID,上级部门查询部门列表 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=department&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchDepartmentSample.java ; + */ + public SearchDepartmentResp search(SearchDepartmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/departments/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/departments/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,根据部门 ID,上级部门查询部门列表 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=department&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchDepartmentSample.java ; + */ + public SearchDepartmentResp search(SearchDepartmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/departments/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchDepartmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchDepartmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/departments/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Employee.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Employee.java new file mode 100644 index 000000000..82151e213 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Employee.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v2.model.BatchGetEmployeeReq; +import com.lark.oapi.service.corehr.v2.model.BatchGetEmployeeResp; +import com.lark.oapi.service.corehr.v2.model.SearchEmployeeReq; +import com.lark.oapi.service.corehr.v2.model.SearchEmployeeResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Employee { + private static final Logger log = LoggerFactory.getLogger(Employee.class); + private final Config config; + + public Employee(Config config) { + this.config = config; + } + + + /** + * ,通过员工 ID 批量获取员工信息 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=employee&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetEmployeeSample.java ; + */ + public BatchGetEmployeeResp batchGet(BatchGetEmployeeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/employees/batch_get" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchGetEmployeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetEmployeeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/employees/batch_get" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,通过员工 ID 批量获取员工信息 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=employee&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetEmployeeSample.java ; + */ + public BatchGetEmployeeResp batchGet(BatchGetEmployeeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/employees/batch_get" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchGetEmployeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetEmployeeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/employees/batch_get" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,根据 email、工号、个人电话等条件查询员工雇佣信息以及个人基础信息 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=employee&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchEmployeeSample.java ; + */ + public SearchEmployeeResp search(SearchEmployeeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/employees/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchEmployeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchEmployeeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/employees/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,根据 email、工号、个人电话等条件查询员工雇佣信息以及个人基础信息 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=employee&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchEmployeeSample.java ; + */ + public SearchEmployeeResp search(SearchEmployeeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/employees/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchEmployeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchEmployeeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/employees/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/EmployeesBp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/EmployeesBp.java new file mode 100644 index 000000000..b33bf1da5 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/EmployeesBp.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v2.model.BatchGetEmployeesBpReq; +import com.lark.oapi.service.corehr.v2.model.BatchGetEmployeesBpResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class EmployeesBp { + private static final Logger log = LoggerFactory.getLogger(EmployeesBp.class); + private final Config config; + + public EmployeesBp(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=employees.bp&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetEmployeesBpSample.java ; + */ + public BatchGetEmployeesBpResp batchGet(BatchGetEmployeesBpReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/employees/bps/batch_get" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchGetEmployeesBpResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetEmployeesBpResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/employees/bps/batch_get" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=employees.bp&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetEmployeesBpSample.java ; + */ + public BatchGetEmployeesBpResp batchGet(BatchGetEmployeesBpReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/employees/bps/batch_get" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchGetEmployeesBpResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetEmployeesBpResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/employees/bps/batch_get" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/EmployeesJobData.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/EmployeesJobData.java new file mode 100644 index 000000000..a68848296 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/EmployeesJobData.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v2.model.BatchGetEmployeesJobDataReq; +import com.lark.oapi.service.corehr.v2.model.BatchGetEmployeesJobDataResp; +import com.lark.oapi.service.corehr.v2.model.QueryEmployeesJobDataReq; +import com.lark.oapi.service.corehr.v2.model.QueryEmployeesJobDataResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class EmployeesJobData { + private static final Logger log = LoggerFactory.getLogger(EmployeesJobData.class); + private final Config config; + + public EmployeesJobData(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=employees.job_data&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetEmployeesJobDataSample.java ; + */ + public BatchGetEmployeesJobDataResp batchGet(BatchGetEmployeesJobDataReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/employees/job_datas/batch_get" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchGetEmployeesJobDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetEmployeesJobDataResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/employees/job_datas/batch_get" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=employees.job_data&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetEmployeesJobDataSample.java ; + */ + public BatchGetEmployeesJobDataResp batchGet(BatchGetEmployeesJobDataReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/employees/job_datas/batch_get" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchGetEmployeesJobDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetEmployeesJobDataResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/employees/job_datas/batch_get" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=corehr&resource=employees.job_data&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/QueryEmployeesJobDataSample.java ; + */ + public QueryEmployeesJobDataResp query(QueryEmployeesJobDataReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/employees/job_datas/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryEmployeesJobDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryEmployeesJobDataResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/employees/job_datas/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=corehr&resource=employees.job_data&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/QueryEmployeesJobDataSample.java ; + */ + public QueryEmployeesJobDataResp query(QueryEmployeesJobDataReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/employees/job_datas/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryEmployeesJobDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryEmployeesJobDataResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/employees/job_datas/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Job.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Job.java new file mode 100644 index 000000000..3021a3fba --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Job.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v2.model.GetJobReq; +import com.lark.oapi.service.corehr.v2.model.GetJobResp; +import com.lark.oapi.service.corehr.v2.model.ListJobReq; +import com.lark.oapi.service.corehr.v2.model.ListJobResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Job { + private static final Logger log = LoggerFactory.getLogger(Job.class); + private final Config config; + + public Job(Config config) { + this.config = config; + } + + + /** + * ,根据 ID 查询单个职务。 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=corehr&resource=job&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/GetJobSample.java ; + */ + public GetJobResp get(GetJobReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v2/jobs/:job_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/jobs/:job_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,根据 ID 查询单个职务。 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=corehr&resource=job&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/GetJobSample.java ; + */ + public GetJobResp get(GetJobReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v2/jobs/:job_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/jobs/:job_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,分页查询职务数据 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=corehr&resource=job&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/ListJobSample.java ; + */ + public ListJobResp list(ListJobReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v2/jobs" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/jobs" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,分页查询职务数据 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=corehr&resource=job&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/ListJobSample.java ; + */ + public ListJobResp list(ListJobReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v2/jobs" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/jobs" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/JobChange.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/JobChange.java new file mode 100644 index 000000000..f95e662fd --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/JobChange.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v2.model.SearchJobChangeReq; +import com.lark.oapi.service.corehr.v2.model.SearchJobChangeResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class JobChange { + private static final Logger log = LoggerFactory.getLogger(JobChange.class); + private final Config config; + + public JobChange(Config config) { + this.config = config; + } + + + /** + * ,获取员工异动列表 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=job_change&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchJobChangeSample.java ; + */ + public SearchJobChangeResp search(SearchJobChangeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/job_changes/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchJobChangeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchJobChangeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/job_changes/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,获取员工异动列表 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=job_change&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchJobChangeSample.java ; + */ + public SearchJobChangeResp search(SearchJobChangeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/job_changes/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchJobChangeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchJobChangeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/job_changes/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/JobFamily.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/JobFamily.java new file mode 100644 index 000000000..aa84c7b11 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/JobFamily.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v2.model.BatchGetJobFamilyReq; +import com.lark.oapi.service.corehr.v2.model.BatchGetJobFamilyResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class JobFamily { + private static final Logger log = LoggerFactory.getLogger(JobFamily.class); + private final Config config; + + public JobFamily(Config config) { + this.config = config; + } + + + /** + * ,通过序列 ID 批量获取序列信息 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=job_family&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetJobFamilySample.java ; + */ + public BatchGetJobFamilyResp batchGet(BatchGetJobFamilyReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/job_families/batch_get" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchGetJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetJobFamilyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/job_families/batch_get" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,通过序列 ID 批量获取序列信息 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=job_family&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetJobFamilySample.java ; + */ + public BatchGetJobFamilyResp batchGet(BatchGetJobFamilyReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/job_families/batch_get" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchGetJobFamilyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetJobFamilyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/job_families/batch_get" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/JobLevel.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/JobLevel.java new file mode 100644 index 000000000..0a73228d1 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/JobLevel.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v2.model.BatchGetJobLevelReq; +import com.lark.oapi.service.corehr.v2.model.BatchGetJobLevelResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class JobLevel { + private static final Logger log = LoggerFactory.getLogger(JobLevel.class); + private final Config config; + + public JobLevel(Config config) { + this.config = config; + } + + + /** + * ,通过职级 ID 批量获取职级信息 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=job_level&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetJobLevelSample.java ; + */ + public BatchGetJobLevelResp batchGet(BatchGetJobLevelReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/job_levels/batch_get" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchGetJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetJobLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/job_levels/batch_get" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,通过职级 ID 批量获取职级信息 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=job_level&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetJobLevelSample.java ; + */ + public BatchGetJobLevelResp batchGet(BatchGetJobLevelReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/job_levels/batch_get" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchGetJobLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetJobLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/job_levels/batch_get" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Location.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Location.java new file mode 100644 index 000000000..f364c1300 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Location.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v2.model.BatchGetLocationReq; +import com.lark.oapi.service.corehr.v2.model.BatchGetLocationResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Location { + private static final Logger log = LoggerFactory.getLogger(Location.class); + private final Config config; + + public Location(Config config) { + this.config = config; + } + + + /** + * ,通过地点 ID 批量获取地点信息 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=location&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetLocationSample.java ; + */ + public BatchGetLocationResp batchGet(BatchGetLocationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/locations/batch_get" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchGetLocationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetLocationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/locations/batch_get" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,通过地点 ID 批量获取地点信息 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=location&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetLocationSample.java ; + */ + public BatchGetLocationResp batchGet(BatchGetLocationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/locations/batch_get" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchGetLocationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetLocationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/locations/batch_get" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Person.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Person.java new file mode 100644 index 000000000..d03e0c0b7 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Person.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v2.model.CreatePersonReq; +import com.lark.oapi.service.corehr.v2.model.CreatePersonResp; +import com.lark.oapi.service.corehr.v2.model.PatchPersonReq; +import com.lark.oapi.service.corehr.v2.model.PatchPersonResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Person { + private static final Logger log = LoggerFactory.getLogger(Person.class); + private final Config config; + + public Person(Config config) { + this.config = config; + } + + + /** + * ,创建个人信息数据 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=corehr&resource=person&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/CreatePersonSample.java ; + */ + public CreatePersonResp create(CreatePersonReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/persons" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreatePersonResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePersonResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/persons" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,创建个人信息数据 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=corehr&resource=person&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/CreatePersonSample.java ; + */ + public CreatePersonResp create(CreatePersonReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/persons" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreatePersonResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePersonResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/persons" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=person&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/PatchPersonSample.java ; + */ + public PatchPersonResp patch(PatchPersonReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v2/persons/:person_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchPersonResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchPersonResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/persons/:person_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=person&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/PatchPersonSample.java ; + */ + public PatchPersonResp patch(PatchPersonReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v2/persons/:person_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchPersonResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchPersonResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/persons/:person_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/PreHire.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/PreHire.java new file mode 100644 index 000000000..86fdb23dd --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/PreHire.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v2.model.CreatePreHireReq; +import com.lark.oapi.service.corehr.v2.model.CreatePreHireResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class PreHire { + private static final Logger log = LoggerFactory.getLogger(PreHire.class); + private final Config config; + + public PreHire(Config config) { + this.config = config; + } + + + /** + * 创建待入职人员,创建待入职人员 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/corehr-v2/pre_hire/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/CreatePreHireSample.java ; + */ + public CreatePreHireResp create(CreatePreHireReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/pre_hires" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreatePreHireResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePreHireResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/pre_hires" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建待入职人员,创建待入职人员 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/corehr-v2/pre_hire/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/CreatePreHireSample.java ; + */ + public CreatePreHireResp create(CreatePreHireReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/pre_hires" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreatePreHireResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePreHireResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/pre_hires" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Probation.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Probation.java new file mode 100644 index 000000000..897f805e3 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Probation.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v2.model.EnableDisableAssessmentProbationReq; +import com.lark.oapi.service.corehr.v2.model.EnableDisableAssessmentProbationResp; +import com.lark.oapi.service.corehr.v2.model.SearchProbationReq; +import com.lark.oapi.service.corehr.v2.model.SearchProbationResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Probation { + private static final Logger log = LoggerFactory.getLogger(Probation.class); + private final Config config; + + public Probation(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=enable_disable_assessment&project=corehr&resource=probation&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/EnableDisableAssessmentProbationSample.java ; + */ + public EnableDisableAssessmentProbationResp enableDisableAssessment(EnableDisableAssessmentProbationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/probation/enable_disable_assessment" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + EnableDisableAssessmentProbationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, EnableDisableAssessmentProbationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/probation/enable_disable_assessment" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=enable_disable_assessment&project=corehr&resource=probation&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/EnableDisableAssessmentProbationSample.java ; + */ + public EnableDisableAssessmentProbationResp enableDisableAssessment(EnableDisableAssessmentProbationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/probation/enable_disable_assessment" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + EnableDisableAssessmentProbationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, EnableDisableAssessmentProbationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/probation/enable_disable_assessment" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=probation&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchProbationSample.java ; + */ + public SearchProbationResp search(SearchProbationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/probation/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchProbationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchProbationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/probation/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=probation&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchProbationSample.java ; + */ + public SearchProbationResp search(SearchProbationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/probation/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchProbationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchProbationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/probation/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/ProbationAssessment.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/ProbationAssessment.java new file mode 100644 index 000000000..364f4db75 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/ProbationAssessment.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v2.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ProbationAssessment { + private static final Logger log = LoggerFactory.getLogger(ProbationAssessment.class); + private final Config config; + + public ProbationAssessment(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=corehr&resource=probation.assessment&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/CreateProbationAssessmentSample.java ; + */ + public CreateProbationAssessmentResp create(CreateProbationAssessmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/probation/assessments" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateProbationAssessmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateProbationAssessmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/probation/assessments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=corehr&resource=probation.assessment&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/CreateProbationAssessmentSample.java ; + */ + public CreateProbationAssessmentResp create(CreateProbationAssessmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/corehr/v2/probation/assessments" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateProbationAssessmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateProbationAssessmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/probation/assessments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=corehr&resource=probation.assessment&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/DeleteProbationAssessmentSample.java ; + */ + public DeleteProbationAssessmentResp delete(DeleteProbationAssessmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v2/probation/assessments/:assessment_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteProbationAssessmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteProbationAssessmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/probation/assessments/:assessment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=corehr&resource=probation.assessment&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/DeleteProbationAssessmentSample.java ; + */ + public DeleteProbationAssessmentResp delete(DeleteProbationAssessmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/corehr/v2/probation/assessments/:assessment_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteProbationAssessmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteProbationAssessmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/probation/assessments/:assessment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=probation.assessment&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/PatchProbationAssessmentSample.java ; + */ + public PatchProbationAssessmentResp patch(PatchProbationAssessmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v2/probation/assessments/:assessment_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchProbationAssessmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchProbationAssessmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/probation/assessments/:assessment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=probation.assessment&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/PatchProbationAssessmentSample.java ; + */ + public PatchProbationAssessmentResp patch(PatchProbationAssessmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/corehr/v2/probation/assessments/:assessment_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchProbationAssessmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchProbationAssessmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/probation/assessments/:assessment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Process.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Process.java new file mode 100644 index 000000000..8e8b5720d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/Process.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.corehr.v2.model.GetProcessReq; +import com.lark.oapi.service.corehr.v2.model.GetProcessResp; +import com.lark.oapi.service.corehr.v2.model.ListProcessReq; +import com.lark.oapi.service.corehr.v2.model.ListProcessResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Process { + private static final Logger log = LoggerFactory.getLogger(Process.class); + private final Config config; + + public Process(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=corehr&resource=process&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/GetProcessSample.java ; + */ + public GetProcessResp get(GetProcessReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v2/processes/:process_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetProcessResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetProcessResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/processes/:process_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=corehr&resource=process&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/GetProcessSample.java ; + */ + public GetProcessResp get(GetProcessReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v2/processes/:process_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetProcessResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetProcessResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/processes/:process_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=corehr&resource=process&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/ListProcessSample.java ; + */ + public ListProcessResp list(ListProcessReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v2/processes" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListProcessResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListProcessResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/processes" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=corehr&resource=process&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/ListProcessSample.java ; + */ + public ListProcessResp list(ListProcessReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/corehr/v2/processes" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListProcessResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListProcessResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/corehr/v2/processes" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/ProcessApprover.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/ProcessApprover.java new file mode 100644 index 000000000..de7e685d9 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/ProcessApprover.java @@ -0,0 +1,29 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.resource; + +import com.lark.oapi.core.Config; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ProcessApprover { + private static final Logger log = LoggerFactory.getLogger(ProcessApprover.class); + private final Config config; + + public ProcessApprover(Config config) { + this.config = config; + } + + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/ProcessCc.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/ProcessCc.java new file mode 100644 index 000000000..81a043e33 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/corehr/v2/resource/ProcessCc.java @@ -0,0 +1,29 @@ +// Code generated by lark suite 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 com.lark.oapi.service.corehr.v2.resource; + +import com.lark.oapi.core.Config; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ProcessCc { + private static final Logger log = LoggerFactory.getLogger(ProcessCc.class); + private final Config config; + + public ProcessCc(Config config) { + this.config = config; + } + + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/DocumentAiService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/DocumentAiService.java new file mode 100644 index 000000000..e3e06fccf --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/DocumentAiService.java @@ -0,0 +1,119 @@ +// Code generated by lark suite 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 com.lark.oapi.service.document_ai; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.document_ai.v1.V1; +import com.lark.oapi.service.document_ai.v1.resource.*; + +public class DocumentAiService { + private final V1 v1; + private final BankCard bankCard; // bank_card + private final BusinessCard businessCard; // business_card + private final BusinessLicense businessLicense; // business_license + private final ChinesePassport chinesePassport; // chinese_passport + private final Contract contract; // contract + private final DrivingLicense drivingLicense; // driving_license + private final FoodManageLicense foodManageLicense; // food_manage_license + private final FoodProduceLicense foodProduceLicense; // food_produce_license + private final HkmMainlandTravelPermit hkmMainlandTravelPermit; // hkm_mainland_travel_permit + private final IdCard idCard; // id_card + private final TaxiInvoice taxiInvoice; // taxi_invoice + private final TrainInvoice trainInvoice; // train_invoice + private final TwMainlandTravelPermit twMainlandTravelPermit; // tw_mainland_travel_permit + private final VatInvoice vatInvoice; // vat_invoice + private final VehicleLicense vehicleLicense; // vehicle_license + + public DocumentAiService(Config config) { + this.v1 = new V1(config); + this.bankCard = new BankCard(config); + this.businessCard = new BusinessCard(config); + this.businessLicense = new BusinessLicense(config); + this.chinesePassport = new ChinesePassport(config); + this.contract = new Contract(config); + this.drivingLicense = new DrivingLicense(config); + this.foodManageLicense = new FoodManageLicense(config); + this.foodProduceLicense = new FoodProduceLicense(config); + this.hkmMainlandTravelPermit = new HkmMainlandTravelPermit(config); + this.idCard = new IdCard(config); + this.taxiInvoice = new TaxiInvoice(config); + this.trainInvoice = new TrainInvoice(config); + this.twMainlandTravelPermit = new TwMainlandTravelPermit(config); + this.vatInvoice = new VatInvoice(config); + this.vehicleLicense = new VehicleLicense(config); + } + + public V1 v1() { + return v1; + } + + public BankCard bankCard() { + return bankCard; + } + + public BusinessCard businessCard() { + return businessCard; + } + + public BusinessLicense businessLicense() { + return businessLicense; + } + + public ChinesePassport chinesePassport() { + return chinesePassport; + } + + public Contract contract() { + return contract; + } + + public DrivingLicense drivingLicense() { + return drivingLicense; + } + + public FoodManageLicense foodManageLicense() { + return foodManageLicense; + } + + public FoodProduceLicense foodProduceLicense() { + return foodProduceLicense; + } + + public HkmMainlandTravelPermit hkmMainlandTravelPermit() { + return hkmMainlandTravelPermit; + } + + public IdCard idCard() { + return idCard; + } + + public TaxiInvoice taxiInvoice() { + return taxiInvoice; + } + + public TrainInvoice trainInvoice() { + return trainInvoice; + } + + public TwMainlandTravelPermit twMainlandTravelPermit() { + return twMainlandTravelPermit; + } + + public VatInvoice vatInvoice() { + return vatInvoice; + } + + public VehicleLicense vehicleLicense() { + return vehicleLicense; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/DocumentAiService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/DocumentAiService.java deleted file mode 100644 index b0a65ea57..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/DocumentAiService.java +++ /dev/null @@ -1,1341 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.document_ai.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.document_ai.v1.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class DocumentAiService { - private static final Logger log = LoggerFactory.getLogger(DocumentAiService.class); - private final BankCard bankCard; // bank_card - private final BusinessCard businessCard; // business_card - private final BusinessLicense businessLicense; // business_license - private final ChinesePassport chinesePassport; // chinese_passport - private final Contract contract; // contract - private final DrivingLicense drivingLicense; // driving_license - private final FoodManageLicense foodManageLicense; // food_manage_license - private final FoodProduceLicense foodProduceLicense; // food_produce_license - private final HkmMainlandTravelPermit hkmMainlandTravelPermit; // hkm_mainland_travel_permit - private final IdCard idCard; // id_card - private final TaxiInvoice taxiInvoice; // taxi_invoice - private final TrainInvoice trainInvoice; // train_invoice - private final TwMainlandTravelPermit twMainlandTravelPermit; // tw_mainland_travel_permit - private final VatInvoice vatInvoice; // vat_invoice - private final VehicleLicense vehicleLicense; // vehicle_license - - public DocumentAiService(Config config) { - this.bankCard = new BankCard(config); - this.businessCard = new BusinessCard(config); - this.businessLicense = new BusinessLicense(config); - this.chinesePassport = new ChinesePassport(config); - this.contract = new Contract(config); - this.drivingLicense = new DrivingLicense(config); - this.foodManageLicense = new FoodManageLicense(config); - this.foodProduceLicense = new FoodProduceLicense(config); - this.hkmMainlandTravelPermit = new HkmMainlandTravelPermit(config); - this.idCard = new IdCard(config); - this.taxiInvoice = new TaxiInvoice(config); - this.trainInvoice = new TrainInvoice(config); - this.twMainlandTravelPermit = new TwMainlandTravelPermit(config); - this.vatInvoice = new VatInvoice(config); - this.vehicleLicense = new VehicleLicense(config); - } - - /** - * bank_card - * - * @return - */ - public BankCard bankCard() { - return bankCard; - } - - /** - * business_card - * - * @return - */ - public BusinessCard businessCard() { - return businessCard; - } - - /** - * business_license - * - * @return - */ - public BusinessLicense businessLicense() { - return businessLicense; - } - - /** - * chinese_passport - * - * @return - */ - public ChinesePassport chinesePassport() { - return chinesePassport; - } - - /** - * contract - * - * @return - */ - public Contract contract() { - return contract; - } - - /** - * driving_license - * - * @return - */ - public DrivingLicense drivingLicense() { - return drivingLicense; - } - - /** - * food_manage_license - * - * @return - */ - public FoodManageLicense foodManageLicense() { - return foodManageLicense; - } - - /** - * food_produce_license - * - * @return - */ - public FoodProduceLicense foodProduceLicense() { - return foodProduceLicense; - } - - /** - * hkm_mainland_travel_permit - * - * @return - */ - public HkmMainlandTravelPermit hkmMainlandTravelPermit() { - return hkmMainlandTravelPermit; - } - - /** - * id_card - * - * @return - */ - public IdCard idCard() { - return idCard; - } - - /** - * taxi_invoice - * - * @return - */ - public TaxiInvoice taxiInvoice() { - return taxiInvoice; - } - - /** - * train_invoice - * - * @return - */ - public TrainInvoice trainInvoice() { - return trainInvoice; - } - - /** - * tw_mainland_travel_permit - * - * @return - */ - public TwMainlandTravelPermit twMainlandTravelPermit() { - return twMainlandTravelPermit; - } - - /** - * vat_invoice - * - * @return - */ - public VatInvoice vatInvoice() { - return vatInvoice; - } - - /** - * vehicle_license - * - * @return - */ - public VehicleLicense vehicleLicense() { - return vehicleLicense; - } - - public static class BankCard { - private final Config config; - - public BankCard(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=bank_card&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeBankCardSample.java ; - */ - public RecognizeBankCardResp recognize(RecognizeBankCardReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/bank_card/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeBankCardResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeBankCardResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/bank_card/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=bank_card&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeBankCardSample.java ; - */ - public RecognizeBankCardResp recognize(RecognizeBankCardReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/bank_card/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeBankCardResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeBankCardResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/bank_card/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class BusinessCard { - private final Config config; - - public BusinessCard(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=business_card&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeBusinessCardSample.java ; - */ - public RecognizeBusinessCardResp recognize(RecognizeBusinessCardReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/business_card/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeBusinessCardResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeBusinessCardResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/business_card/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=business_card&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeBusinessCardSample.java ; - */ - public RecognizeBusinessCardResp recognize(RecognizeBusinessCardReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/business_card/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeBusinessCardResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeBusinessCardResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/business_card/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class BusinessLicense { - private final Config config; - - public BusinessLicense(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=business_license&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeBusinessLicenseSample.java ; - */ - public RecognizeBusinessLicenseResp recognize(RecognizeBusinessLicenseReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/business_license/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeBusinessLicenseResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeBusinessLicenseResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/business_license/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=business_license&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeBusinessLicenseSample.java ; - */ - public RecognizeBusinessLicenseResp recognize(RecognizeBusinessLicenseReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/business_license/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeBusinessLicenseResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeBusinessLicenseResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/business_license/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ChinesePassport { - private final Config config; - - public ChinesePassport(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=chinese_passport&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeChinesePassportSample.java ; - */ - public RecognizeChinesePassportResp recognize(RecognizeChinesePassportReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/chinese_passport/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeChinesePassportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeChinesePassportResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/chinese_passport/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=chinese_passport&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeChinesePassportSample.java ; - */ - public RecognizeChinesePassportResp recognize(RecognizeChinesePassportReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/chinese_passport/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeChinesePassportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeChinesePassportResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/chinese_passport/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Contract { - private final Config config; - - public Contract(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=field_extraction&project=document_ai&resource=contract&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/FieldExtractionContractSample.java ; - */ - public FieldExtractionContractResp fieldExtraction(FieldExtractionContractReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/contract/field_extraction" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - FieldExtractionContractResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, FieldExtractionContractResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/contract/field_extraction" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=field_extraction&project=document_ai&resource=contract&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/FieldExtractionContractSample.java ; - */ - public FieldExtractionContractResp fieldExtraction(FieldExtractionContractReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/contract/field_extraction" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - FieldExtractionContractResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, FieldExtractionContractResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/contract/field_extraction" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class DrivingLicense { - private final Config config; - - public DrivingLicense(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=driving_license&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeDrivingLicenseSample.java ; - */ - public RecognizeDrivingLicenseResp recognize(RecognizeDrivingLicenseReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/driving_license/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeDrivingLicenseResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeDrivingLicenseResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/driving_license/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=driving_license&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeDrivingLicenseSample.java ; - */ - public RecognizeDrivingLicenseResp recognize(RecognizeDrivingLicenseReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/driving_license/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeDrivingLicenseResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeDrivingLicenseResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/driving_license/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class FoodManageLicense { - private final Config config; - - public FoodManageLicense(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=food_manage_license&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeFoodManageLicenseSample.java ; - */ - public RecognizeFoodManageLicenseResp recognize(RecognizeFoodManageLicenseReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/food_manage_license/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeFoodManageLicenseResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeFoodManageLicenseResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/food_manage_license/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=food_manage_license&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeFoodManageLicenseSample.java ; - */ - public RecognizeFoodManageLicenseResp recognize(RecognizeFoodManageLicenseReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/food_manage_license/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeFoodManageLicenseResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeFoodManageLicenseResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/food_manage_license/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class FoodProduceLicense { - private final Config config; - - public FoodProduceLicense(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=food_produce_license&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeFoodProduceLicenseSample.java ; - */ - public RecognizeFoodProduceLicenseResp recognize(RecognizeFoodProduceLicenseReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/food_produce_license/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeFoodProduceLicenseResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeFoodProduceLicenseResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/food_produce_license/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=food_produce_license&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeFoodProduceLicenseSample.java ; - */ - public RecognizeFoodProduceLicenseResp recognize(RecognizeFoodProduceLicenseReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/food_produce_license/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeFoodProduceLicenseResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeFoodProduceLicenseResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/food_produce_license/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class HkmMainlandTravelPermit { - private final Config config; - - public HkmMainlandTravelPermit(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=hkm_mainland_travel_permit&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeHkmMainlandTravelPermitSample.java ; - */ - public RecognizeHkmMainlandTravelPermitResp recognize(RecognizeHkmMainlandTravelPermitReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/hkm_mainland_travel_permit/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeHkmMainlandTravelPermitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeHkmMainlandTravelPermitResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/hkm_mainland_travel_permit/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=hkm_mainland_travel_permit&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeHkmMainlandTravelPermitSample.java ; - */ - public RecognizeHkmMainlandTravelPermitResp recognize(RecognizeHkmMainlandTravelPermitReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/hkm_mainland_travel_permit/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeHkmMainlandTravelPermitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeHkmMainlandTravelPermitResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/hkm_mainland_travel_permit/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class IdCard { - private final Config config; - - public IdCard(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=id_card&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeIdCardSample.java ; - */ - public RecognizeIdCardResp recognize(RecognizeIdCardReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/id_card/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeIdCardResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeIdCardResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/id_card/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=id_card&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeIdCardSample.java ; - */ - public RecognizeIdCardResp recognize(RecognizeIdCardReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/id_card/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeIdCardResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeIdCardResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/id_card/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class TaxiInvoice { - private final Config config; - - public TaxiInvoice(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=taxi_invoice&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeTaxiInvoiceSample.java ; - */ - public RecognizeTaxiInvoiceResp recognize(RecognizeTaxiInvoiceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/taxi_invoice/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeTaxiInvoiceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeTaxiInvoiceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/taxi_invoice/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=taxi_invoice&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeTaxiInvoiceSample.java ; - */ - public RecognizeTaxiInvoiceResp recognize(RecognizeTaxiInvoiceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/taxi_invoice/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeTaxiInvoiceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeTaxiInvoiceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/taxi_invoice/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class TrainInvoice { - private final Config config; - - public TrainInvoice(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=train_invoice&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeTrainInvoiceSample.java ; - */ - public RecognizeTrainInvoiceResp recognize(RecognizeTrainInvoiceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/train_invoice/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeTrainInvoiceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeTrainInvoiceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/train_invoice/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=train_invoice&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeTrainInvoiceSample.java ; - */ - public RecognizeTrainInvoiceResp recognize(RecognizeTrainInvoiceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/train_invoice/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeTrainInvoiceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeTrainInvoiceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/train_invoice/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class TwMainlandTravelPermit { - private final Config config; - - public TwMainlandTravelPermit(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=tw_mainland_travel_permit&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeTwMainlandTravelPermitSample.java ; - */ - public RecognizeTwMainlandTravelPermitResp recognize(RecognizeTwMainlandTravelPermitReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/tw_mainland_travel_permit/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeTwMainlandTravelPermitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeTwMainlandTravelPermitResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/tw_mainland_travel_permit/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=tw_mainland_travel_permit&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeTwMainlandTravelPermitSample.java ; - */ - public RecognizeTwMainlandTravelPermitResp recognize(RecognizeTwMainlandTravelPermitReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/tw_mainland_travel_permit/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeTwMainlandTravelPermitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeTwMainlandTravelPermitResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/tw_mainland_travel_permit/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class VatInvoice { - private final Config config; - - public VatInvoice(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=vat_invoice&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeVatInvoiceSample.java ; - */ - public RecognizeVatInvoiceResp recognize(RecognizeVatInvoiceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/vat_invoice/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeVatInvoiceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeVatInvoiceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/vat_invoice/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=vat_invoice&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeVatInvoiceSample.java ; - */ - public RecognizeVatInvoiceResp recognize(RecognizeVatInvoiceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/vat_invoice/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeVatInvoiceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeVatInvoiceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/vat_invoice/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class VehicleLicense { - private final Config config; - - public VehicleLicense(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=vehicle_license&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeVehicleLicenseSample.java ; - */ - public RecognizeVehicleLicenseResp recognize(RecognizeVehicleLicenseReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/vehicle_license/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeVehicleLicenseResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeVehicleLicenseResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/vehicle_license/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=vehicle_license&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeVehicleLicenseSample.java ; - */ - public RecognizeVehicleLicenseResp recognize(RecognizeVehicleLicenseReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/document_ai/v1/vehicle_license/recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - RecognizeVehicleLicenseResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeVehicleLicenseResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/vehicle_license/recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/V1.java new file mode 100644 index 000000000..e164d2394 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/V1.java @@ -0,0 +1,113 @@ +// Code generated by lark suite 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 com.lark.oapi.service.document_ai.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.document_ai.v1.resource.*; + +public class V1 { + private final BankCard bankCard; // bank_card + private final BusinessCard businessCard; // business_card + private final BusinessLicense businessLicense; // business_license + private final ChinesePassport chinesePassport; // chinese_passport + private final Contract contract; // contract + private final DrivingLicense drivingLicense; // driving_license + private final FoodManageLicense foodManageLicense; // food_manage_license + private final FoodProduceLicense foodProduceLicense; // food_produce_license + private final HkmMainlandTravelPermit hkmMainlandTravelPermit; // hkm_mainland_travel_permit + private final IdCard idCard; // id_card + private final TaxiInvoice taxiInvoice; // taxi_invoice + private final TrainInvoice trainInvoice; // train_invoice + private final TwMainlandTravelPermit twMainlandTravelPermit; // tw_mainland_travel_permit + private final VatInvoice vatInvoice; // vat_invoice + private final VehicleLicense vehicleLicense; // vehicle_license + + public V1(Config config) { + this.bankCard = new BankCard(config); + this.businessCard = new BusinessCard(config); + this.businessLicense = new BusinessLicense(config); + this.chinesePassport = new ChinesePassport(config); + this.contract = new Contract(config); + this.drivingLicense = new DrivingLicense(config); + this.foodManageLicense = new FoodManageLicense(config); + this.foodProduceLicense = new FoodProduceLicense(config); + this.hkmMainlandTravelPermit = new HkmMainlandTravelPermit(config); + this.idCard = new IdCard(config); + this.taxiInvoice = new TaxiInvoice(config); + this.trainInvoice = new TrainInvoice(config); + this.twMainlandTravelPermit = new TwMainlandTravelPermit(config); + this.vatInvoice = new VatInvoice(config); + this.vehicleLicense = new VehicleLicense(config); + } + + public BankCard bankCard() { + return bankCard; + } + + public BusinessCard businessCard() { + return businessCard; + } + + public BusinessLicense businessLicense() { + return businessLicense; + } + + public ChinesePassport chinesePassport() { + return chinesePassport; + } + + public Contract contract() { + return contract; + } + + public DrivingLicense drivingLicense() { + return drivingLicense; + } + + public FoodManageLicense foodManageLicense() { + return foodManageLicense; + } + + public FoodProduceLicense foodProduceLicense() { + return foodProduceLicense; + } + + public HkmMainlandTravelPermit hkmMainlandTravelPermit() { + return hkmMainlandTravelPermit; + } + + public IdCard idCard() { + return idCard; + } + + public TaxiInvoice taxiInvoice() { + return taxiInvoice; + } + + public TrainInvoice trainInvoice() { + return trainInvoice; + } + + public TwMainlandTravelPermit twMainlandTravelPermit() { + return twMainlandTravelPermit; + } + + public VatInvoice vatInvoice() { + return vatInvoice; + } + + public VehicleLicense vehicleLicense() { + return vehicleLicense; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/BankCard.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/BankCard.java new file mode 100644 index 000000000..39a5894aa --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/BankCard.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.document_ai.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.document_ai.v1.model.RecognizeBankCardReq; +import com.lark.oapi.service.document_ai.v1.model.RecognizeBankCardResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class BankCard { + private static final Logger log = LoggerFactory.getLogger(BankCard.class); + private final Config config; + + public BankCard(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=bank_card&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeBankCardSample.java ; + */ + public RecognizeBankCardResp recognize(RecognizeBankCardReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/bank_card/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeBankCardResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeBankCardResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/bank_card/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=bank_card&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeBankCardSample.java ; + */ + public RecognizeBankCardResp recognize(RecognizeBankCardReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/bank_card/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeBankCardResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeBankCardResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/bank_card/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/BusinessCard.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/BusinessCard.java new file mode 100644 index 000000000..32b0e2cad --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/BusinessCard.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.document_ai.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.document_ai.v1.model.RecognizeBusinessCardReq; +import com.lark.oapi.service.document_ai.v1.model.RecognizeBusinessCardResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class BusinessCard { + private static final Logger log = LoggerFactory.getLogger(BusinessCard.class); + private final Config config; + + public BusinessCard(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=business_card&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeBusinessCardSample.java ; + */ + public RecognizeBusinessCardResp recognize(RecognizeBusinessCardReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/business_card/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeBusinessCardResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeBusinessCardResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/business_card/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=business_card&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeBusinessCardSample.java ; + */ + public RecognizeBusinessCardResp recognize(RecognizeBusinessCardReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/business_card/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeBusinessCardResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeBusinessCardResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/business_card/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/BusinessLicense.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/BusinessLicense.java new file mode 100644 index 000000000..3f34a38df --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/BusinessLicense.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.document_ai.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.document_ai.v1.model.RecognizeBusinessLicenseReq; +import com.lark.oapi.service.document_ai.v1.model.RecognizeBusinessLicenseResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class BusinessLicense { + private static final Logger log = LoggerFactory.getLogger(BusinessLicense.class); + private final Config config; + + public BusinessLicense(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=business_license&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeBusinessLicenseSample.java ; + */ + public RecognizeBusinessLicenseResp recognize(RecognizeBusinessLicenseReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/business_license/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeBusinessLicenseResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeBusinessLicenseResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/business_license/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=business_license&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeBusinessLicenseSample.java ; + */ + public RecognizeBusinessLicenseResp recognize(RecognizeBusinessLicenseReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/business_license/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeBusinessLicenseResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeBusinessLicenseResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/business_license/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/ChinesePassport.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/ChinesePassport.java new file mode 100644 index 000000000..dfd78fb39 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/ChinesePassport.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.document_ai.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.document_ai.v1.model.RecognizeChinesePassportReq; +import com.lark.oapi.service.document_ai.v1.model.RecognizeChinesePassportResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ChinesePassport { + private static final Logger log = LoggerFactory.getLogger(ChinesePassport.class); + private final Config config; + + public ChinesePassport(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=chinese_passport&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeChinesePassportSample.java ; + */ + public RecognizeChinesePassportResp recognize(RecognizeChinesePassportReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/chinese_passport/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeChinesePassportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeChinesePassportResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/chinese_passport/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=chinese_passport&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeChinesePassportSample.java ; + */ + public RecognizeChinesePassportResp recognize(RecognizeChinesePassportReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/chinese_passport/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeChinesePassportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeChinesePassportResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/chinese_passport/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/Contract.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/Contract.java new file mode 100644 index 000000000..53b9c0ced --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/Contract.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.document_ai.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.document_ai.v1.model.FieldExtractionContractReq; +import com.lark.oapi.service.document_ai.v1.model.FieldExtractionContractResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Contract { + private static final Logger log = LoggerFactory.getLogger(Contract.class); + private final Config config; + + public Contract(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=field_extraction&project=document_ai&resource=contract&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/FieldExtractionContractSample.java ; + */ + public FieldExtractionContractResp fieldExtraction(FieldExtractionContractReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/contract/field_extraction" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + FieldExtractionContractResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, FieldExtractionContractResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/contract/field_extraction" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=field_extraction&project=document_ai&resource=contract&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/FieldExtractionContractSample.java ; + */ + public FieldExtractionContractResp fieldExtraction(FieldExtractionContractReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/contract/field_extraction" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + FieldExtractionContractResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, FieldExtractionContractResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/contract/field_extraction" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/DrivingLicense.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/DrivingLicense.java new file mode 100644 index 000000000..b46dcb3d1 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/DrivingLicense.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.document_ai.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.document_ai.v1.model.RecognizeDrivingLicenseReq; +import com.lark.oapi.service.document_ai.v1.model.RecognizeDrivingLicenseResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class DrivingLicense { + private static final Logger log = LoggerFactory.getLogger(DrivingLicense.class); + private final Config config; + + public DrivingLicense(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=driving_license&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeDrivingLicenseSample.java ; + */ + public RecognizeDrivingLicenseResp recognize(RecognizeDrivingLicenseReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/driving_license/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeDrivingLicenseResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeDrivingLicenseResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/driving_license/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=driving_license&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeDrivingLicenseSample.java ; + */ + public RecognizeDrivingLicenseResp recognize(RecognizeDrivingLicenseReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/driving_license/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeDrivingLicenseResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeDrivingLicenseResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/driving_license/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/FoodManageLicense.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/FoodManageLicense.java new file mode 100644 index 000000000..addd320ed --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/FoodManageLicense.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.document_ai.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.document_ai.v1.model.RecognizeFoodManageLicenseReq; +import com.lark.oapi.service.document_ai.v1.model.RecognizeFoodManageLicenseResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class FoodManageLicense { + private static final Logger log = LoggerFactory.getLogger(FoodManageLicense.class); + private final Config config; + + public FoodManageLicense(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=food_manage_license&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeFoodManageLicenseSample.java ; + */ + public RecognizeFoodManageLicenseResp recognize(RecognizeFoodManageLicenseReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/food_manage_license/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeFoodManageLicenseResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeFoodManageLicenseResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/food_manage_license/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=food_manage_license&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeFoodManageLicenseSample.java ; + */ + public RecognizeFoodManageLicenseResp recognize(RecognizeFoodManageLicenseReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/food_manage_license/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeFoodManageLicenseResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeFoodManageLicenseResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/food_manage_license/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/FoodProduceLicense.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/FoodProduceLicense.java new file mode 100644 index 000000000..c4e592023 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/FoodProduceLicense.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.document_ai.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.document_ai.v1.model.RecognizeFoodProduceLicenseReq; +import com.lark.oapi.service.document_ai.v1.model.RecognizeFoodProduceLicenseResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class FoodProduceLicense { + private static final Logger log = LoggerFactory.getLogger(FoodProduceLicense.class); + private final Config config; + + public FoodProduceLicense(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=food_produce_license&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeFoodProduceLicenseSample.java ; + */ + public RecognizeFoodProduceLicenseResp recognize(RecognizeFoodProduceLicenseReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/food_produce_license/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeFoodProduceLicenseResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeFoodProduceLicenseResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/food_produce_license/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=food_produce_license&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeFoodProduceLicenseSample.java ; + */ + public RecognizeFoodProduceLicenseResp recognize(RecognizeFoodProduceLicenseReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/food_produce_license/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeFoodProduceLicenseResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeFoodProduceLicenseResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/food_produce_license/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/HkmMainlandTravelPermit.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/HkmMainlandTravelPermit.java new file mode 100644 index 000000000..0d0c4852a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/HkmMainlandTravelPermit.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.document_ai.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.document_ai.v1.model.RecognizeHkmMainlandTravelPermitReq; +import com.lark.oapi.service.document_ai.v1.model.RecognizeHkmMainlandTravelPermitResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class HkmMainlandTravelPermit { + private static final Logger log = LoggerFactory.getLogger(HkmMainlandTravelPermit.class); + private final Config config; + + public HkmMainlandTravelPermit(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=hkm_mainland_travel_permit&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeHkmMainlandTravelPermitSample.java ; + */ + public RecognizeHkmMainlandTravelPermitResp recognize(RecognizeHkmMainlandTravelPermitReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/hkm_mainland_travel_permit/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeHkmMainlandTravelPermitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeHkmMainlandTravelPermitResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/hkm_mainland_travel_permit/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=hkm_mainland_travel_permit&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeHkmMainlandTravelPermitSample.java ; + */ + public RecognizeHkmMainlandTravelPermitResp recognize(RecognizeHkmMainlandTravelPermitReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/hkm_mainland_travel_permit/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeHkmMainlandTravelPermitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeHkmMainlandTravelPermitResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/hkm_mainland_travel_permit/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/IdCard.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/IdCard.java new file mode 100644 index 000000000..27be0903e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/IdCard.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.document_ai.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.document_ai.v1.model.RecognizeIdCardReq; +import com.lark.oapi.service.document_ai.v1.model.RecognizeIdCardResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class IdCard { + private static final Logger log = LoggerFactory.getLogger(IdCard.class); + private final Config config; + + public IdCard(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=id_card&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeIdCardSample.java ; + */ + public RecognizeIdCardResp recognize(RecognizeIdCardReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/id_card/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeIdCardResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeIdCardResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/id_card/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=id_card&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeIdCardSample.java ; + */ + public RecognizeIdCardResp recognize(RecognizeIdCardReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/id_card/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeIdCardResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeIdCardResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/id_card/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/TaxiInvoice.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/TaxiInvoice.java new file mode 100644 index 000000000..d7ec57f0a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/TaxiInvoice.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.document_ai.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.document_ai.v1.model.RecognizeTaxiInvoiceReq; +import com.lark.oapi.service.document_ai.v1.model.RecognizeTaxiInvoiceResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class TaxiInvoice { + private static final Logger log = LoggerFactory.getLogger(TaxiInvoice.class); + private final Config config; + + public TaxiInvoice(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=taxi_invoice&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeTaxiInvoiceSample.java ; + */ + public RecognizeTaxiInvoiceResp recognize(RecognizeTaxiInvoiceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/taxi_invoice/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeTaxiInvoiceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeTaxiInvoiceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/taxi_invoice/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=taxi_invoice&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeTaxiInvoiceSample.java ; + */ + public RecognizeTaxiInvoiceResp recognize(RecognizeTaxiInvoiceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/taxi_invoice/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeTaxiInvoiceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeTaxiInvoiceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/taxi_invoice/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/TrainInvoice.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/TrainInvoice.java new file mode 100644 index 000000000..89a525132 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/TrainInvoice.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.document_ai.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.document_ai.v1.model.RecognizeTrainInvoiceReq; +import com.lark.oapi.service.document_ai.v1.model.RecognizeTrainInvoiceResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class TrainInvoice { + private static final Logger log = LoggerFactory.getLogger(TrainInvoice.class); + private final Config config; + + public TrainInvoice(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=train_invoice&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeTrainInvoiceSample.java ; + */ + public RecognizeTrainInvoiceResp recognize(RecognizeTrainInvoiceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/train_invoice/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeTrainInvoiceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeTrainInvoiceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/train_invoice/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=train_invoice&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeTrainInvoiceSample.java ; + */ + public RecognizeTrainInvoiceResp recognize(RecognizeTrainInvoiceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/train_invoice/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeTrainInvoiceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeTrainInvoiceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/train_invoice/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/TwMainlandTravelPermit.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/TwMainlandTravelPermit.java new file mode 100644 index 000000000..6f8b51396 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/TwMainlandTravelPermit.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.document_ai.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.document_ai.v1.model.RecognizeTwMainlandTravelPermitReq; +import com.lark.oapi.service.document_ai.v1.model.RecognizeTwMainlandTravelPermitResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class TwMainlandTravelPermit { + private static final Logger log = LoggerFactory.getLogger(TwMainlandTravelPermit.class); + private final Config config; + + public TwMainlandTravelPermit(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=tw_mainland_travel_permit&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeTwMainlandTravelPermitSample.java ; + */ + public RecognizeTwMainlandTravelPermitResp recognize(RecognizeTwMainlandTravelPermitReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/tw_mainland_travel_permit/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeTwMainlandTravelPermitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeTwMainlandTravelPermitResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/tw_mainland_travel_permit/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=tw_mainland_travel_permit&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeTwMainlandTravelPermitSample.java ; + */ + public RecognizeTwMainlandTravelPermitResp recognize(RecognizeTwMainlandTravelPermitReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/tw_mainland_travel_permit/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeTwMainlandTravelPermitResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeTwMainlandTravelPermitResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/tw_mainland_travel_permit/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/VatInvoice.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/VatInvoice.java new file mode 100644 index 000000000..915f6a205 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/VatInvoice.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.document_ai.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.document_ai.v1.model.RecognizeVatInvoiceReq; +import com.lark.oapi.service.document_ai.v1.model.RecognizeVatInvoiceResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class VatInvoice { + private static final Logger log = LoggerFactory.getLogger(VatInvoice.class); + private final Config config; + + public VatInvoice(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=vat_invoice&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeVatInvoiceSample.java ; + */ + public RecognizeVatInvoiceResp recognize(RecognizeVatInvoiceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/vat_invoice/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeVatInvoiceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeVatInvoiceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/vat_invoice/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=vat_invoice&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeVatInvoiceSample.java ; + */ + public RecognizeVatInvoiceResp recognize(RecognizeVatInvoiceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/vat_invoice/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeVatInvoiceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeVatInvoiceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/vat_invoice/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/VehicleLicense.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/VehicleLicense.java new file mode 100644 index 000000000..b7050fd82 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/document_ai/v1/resource/VehicleLicense.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.document_ai.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.document_ai.v1.model.RecognizeVehicleLicenseReq; +import com.lark.oapi.service.document_ai.v1.model.RecognizeVehicleLicenseResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class VehicleLicense { + private static final Logger log = LoggerFactory.getLogger(VehicleLicense.class); + private final Config config; + + public VehicleLicense(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=vehicle_license&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeVehicleLicenseSample.java ; + */ + public RecognizeVehicleLicenseResp recognize(RecognizeVehicleLicenseReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/vehicle_license/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeVehicleLicenseResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeVehicleLicenseResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/vehicle_license/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=vehicle_license&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeVehicleLicenseSample.java ; + */ + public RecognizeVehicleLicenseResp recognize(RecognizeVehicleLicenseReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/document_ai/v1/vehicle_license/recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + RecognizeVehicleLicenseResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RecognizeVehicleLicenseResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/document_ai/v1/vehicle_license/recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/DocxService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/DocxService.java new file mode 100644 index 000000000..7634f5abe --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/DocxService.java @@ -0,0 +1,49 @@ +// Code generated by lark suite 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 com.lark.oapi.service.docx; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.docx.v1.V1; +import com.lark.oapi.service.docx.v1.resource.Document; +import com.lark.oapi.service.docx.v1.resource.DocumentBlock; +import com.lark.oapi.service.docx.v1.resource.DocumentBlockChildren; + +public class DocxService { + private final V1 v1; + private final Document document; // 文档 + private final DocumentBlock documentBlock; // 块 + private final DocumentBlockChildren documentBlockChildren; // document.block.children + + public DocxService(Config config) { + this.v1 = new V1(config); + this.document = new Document(config); + this.documentBlock = new DocumentBlock(config); + this.documentBlockChildren = new DocumentBlockChildren(config); + } + + public V1 v1() { + return v1; + } + + public Document document() { + return document; + } + + public DocumentBlock documentBlock() { + return documentBlock; + } + + public DocumentBlockChildren documentBlockChildren() { + return documentBlockChildren; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/DocxService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/DocxService.java deleted file mode 100644 index 810070d31..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/DocxService.java +++ /dev/null @@ -1,793 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.docx.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.docx.v1.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class DocxService { - private static final Logger log = LoggerFactory.getLogger(DocxService.class); - private final Document document; // 文档 - private final DocumentBlock documentBlock; // 块 - private final DocumentBlockChildren documentBlockChildren; // document.block.children - - public DocxService(Config config) { - this.document = new Document(config); - this.documentBlock = new DocumentBlock(config); - this.documentBlockChildren = new DocumentBlockChildren(config); - } - - /** - * 文档 - * - * @return - */ - public Document document() { - return document; - } - - /** - * 块 - * - * @return - */ - public DocumentBlock documentBlock() { - return documentBlock; - } - - /** - * document.block.children - * - * @return - */ - public DocumentBlockChildren documentBlockChildren() { - return documentBlockChildren; - } - - public static class Document { - private final Config config; - - public Document(Config config) { - this.config = config; - } - - /** - * 创建文档,创建新版文档,文档标题和目录可选。 - *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnyoyCgwS8ywWwMtQr9yjZ2f),了解相关规则及约束。 ; - *

频率限制:单个应用调用频率上限为每秒 3 次。 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/CreateDocumentSample.java ; - */ - public CreateDocumentResp create(CreateDocumentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/docx/v1/documents" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateDocumentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDocumentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建文档,创建新版文档,文档标题和目录可选。 - *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnyoyCgwS8ywWwMtQr9yjZ2f),了解相关规则及约束。 ; - *

频率限制:单个应用调用频率上限为每秒 3 次。 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/CreateDocumentSample.java ; - */ - public CreateDocumentResp create(CreateDocumentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/docx/v1/documents" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateDocumentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDocumentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取文档基本信息,获取文档最新版本号、标题等 - *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnWKAE4aSaIU4GcdLInSaVde),了解相关规则及约束。 ; - *

频率限制:单个应用调用频率上限为每秒 5 次。 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/GetDocumentSample.java ; - */ - public GetDocumentResp get(GetDocumentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/docx/v1/documents/:document_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetDocumentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDocumentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取文档基本信息,获取文档最新版本号、标题等 - *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnWKAE4aSaIU4GcdLInSaVde),了解相关规则及约束。 ; - *

频率限制:单个应用调用频率上限为每秒 5 次。 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/GetDocumentSample.java ; - */ - public GetDocumentResp get(GetDocumentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/docx/v1/documents/:document_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetDocumentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDocumentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取文档纯文本内容,获取文档的纯文本内容。 - *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnQeqI4wiKIMis6GNvCOBuqg),了解相关规则及约束。 ; - *

频率限制:单个应用调用频率上限为每秒 5 次。 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document/raw_content ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/RawContentDocumentSample.java ; - */ - public RawContentDocumentResp rawContent(RawContentDocumentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/docx/v1/documents/:document_id/raw_content" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - RawContentDocumentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RawContentDocumentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/raw_content" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取文档纯文本内容,获取文档的纯文本内容。 - *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnQeqI4wiKIMis6GNvCOBuqg),了解相关规则及约束。 ; - *

频率限制:单个应用调用频率上限为每秒 5 次。 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document/raw_content ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/RawContentDocumentSample.java ; - */ - public RawContentDocumentResp rawContent(RawContentDocumentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/docx/v1/documents/:document_id/raw_content" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - RawContentDocumentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RawContentDocumentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/raw_content" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class DocumentBlock { - private final Config config; - - public DocumentBlock(Config config) { - this.config = config; - } - - /** - * 批量更新块,批量更新块的富文本内容。 - *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnMiwAKCiE6oQEkPyhvmmQEe),了解相关规则及约束。 ; - *

频率限制:单个应用调用频率上限为每秒 3 次。 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block/batch_update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/BatchUpdateDocumentBlockSample.java ; - */ - public BatchUpdateDocumentBlockResp batchUpdate(BatchUpdateDocumentBlockReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/docx/v1/documents/:document_id/blocks/batch_update" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - BatchUpdateDocumentBlockResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUpdateDocumentBlockResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks/batch_update" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量更新块,批量更新块的富文本内容。 - *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnMiwAKCiE6oQEkPyhvmmQEe),了解相关规则及约束。 ; - *

频率限制:单个应用调用频率上限为每秒 3 次。 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block/batch_update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/BatchUpdateDocumentBlockSample.java ; - */ - public BatchUpdateDocumentBlockResp batchUpdate(BatchUpdateDocumentBlockReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/docx/v1/documents/:document_id/blocks/batch_update" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - BatchUpdateDocumentBlockResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUpdateDocumentBlockResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks/batch_update" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取块,获取指定块的富文本内容。 - *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnamKaccZKqIMopnREJCZUMe#doxcnWEMWYAg2YMkEq0SZXHzaih),了解相关规则及约束。 ; - *

频率限制:单个应用调用频率上限为每秒 5 次。 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/GetDocumentBlockSample.java ; - */ - public GetDocumentBlockResp get(GetDocumentBlockReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/docx/v1/documents/:document_id/blocks/:block_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetDocumentBlockResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDocumentBlockResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks/:block_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取块,获取指定块的富文本内容。 - *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnamKaccZKqIMopnREJCZUMe#doxcnWEMWYAg2YMkEq0SZXHzaih),了解相关规则及约束。 ; - *

频率限制:单个应用调用频率上限为每秒 5 次。 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/GetDocumentBlockSample.java ; - */ - public GetDocumentBlockResp get(GetDocumentBlockReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/docx/v1/documents/:document_id/blocks/:block_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetDocumentBlockResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDocumentBlockResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks/:block_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取文档所有块,获取文档所有块的富文本内容并分页返回。 - *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnamKaccZKqIMopnREJCZUMe#doxcn6AkCE2AUUm2WwxID7lS7Xc),了解相关规则及约束。 ; - *

频率限制:单个应用调用频率上限为每秒 5 次。 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/ListDocumentBlockSample.java ; - */ - public ListDocumentBlockResp list(ListDocumentBlockReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/docx/v1/documents/:document_id/blocks" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListDocumentBlockResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDocumentBlockResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取文档所有块,获取文档所有块的富文本内容并分页返回。 - *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnamKaccZKqIMopnREJCZUMe#doxcn6AkCE2AUUm2WwxID7lS7Xc),了解相关规则及约束。 ; - *

频率限制:单个应用调用频率上限为每秒 5 次。 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/ListDocumentBlockSample.java ; - */ - public ListDocumentBlockResp list(ListDocumentBlockReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/docx/v1/documents/:document_id/blocks" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListDocumentBlockResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDocumentBlockResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新块,更新指定的块。 - *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnEeyS0I8MMqoieIMpK7jm8g),了解相关规则及约束。 ; - *

频率限制:单个应用调用频率上限为每秒 3 次。 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/PatchDocumentBlockSample.java ; - */ - public PatchDocumentBlockResp patch(PatchDocumentBlockReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/docx/v1/documents/:document_id/blocks/:block_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchDocumentBlockResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchDocumentBlockResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks/:block_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新块,更新指定的块。 - *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnEeyS0I8MMqoieIMpK7jm8g),了解相关规则及约束。 ; - *

频率限制:单个应用调用频率上限为每秒 3 次。 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/PatchDocumentBlockSample.java ; - */ - public PatchDocumentBlockResp patch(PatchDocumentBlockReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/docx/v1/documents/:document_id/blocks/:block_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchDocumentBlockResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchDocumentBlockResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks/:block_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class DocumentBlockChildren { - private final Config config; - - public DocumentBlockChildren(Config config) { - this.config = config; - } - - /** - * 删除块,指定需要操作的块,删除其指定范围的子块。如果操作成功,接口将返回应用删除操作后的文档版本号。 - *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcngCsscGk0WacO258mYDgM6b),了解相关规则及约束。 ; - *

频率限制:单个应用调用频率上限为每秒 3 次。 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block-children/batch_delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/BatchDeleteDocumentBlockChildrenSample.java ; - */ - public BatchDeleteDocumentBlockChildrenResp batchDelete(BatchDeleteDocumentBlockChildrenReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children/batch_delete" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - BatchDeleteDocumentBlockChildrenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteDocumentBlockChildrenResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除块,指定需要操作的块,删除其指定范围的子块。如果操作成功,接口将返回应用删除操作后的文档版本号。 - *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcngCsscGk0WacO258mYDgM6b),了解相关规则及约束。 ; - *

频率限制:单个应用调用频率上限为每秒 3 次。 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block-children/batch_delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/BatchDeleteDocumentBlockChildrenSample.java ; - */ - public BatchDeleteDocumentBlockChildrenResp batchDelete(BatchDeleteDocumentBlockChildrenReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children/batch_delete" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - BatchDeleteDocumentBlockChildrenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteDocumentBlockChildrenResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建块,指定需要操作的块,为其创建一批子块,并插入到指定位置。如果操作成功,接口将返回新创建子块的富文本内容。 - *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnm0ooUe0s20GwwVB3a05rtb),了解相关规则及约束。 ; - *

频率限制:单个应用调用频率上限为每秒 3 次。 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block-children/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/CreateDocumentBlockChildrenSample.java ; - */ - public CreateDocumentBlockChildrenResp create(CreateDocumentBlockChildrenReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateDocumentBlockChildrenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDocumentBlockChildrenResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建块,指定需要操作的块,为其创建一批子块,并插入到指定位置。如果操作成功,接口将返回新创建子块的富文本内容。 - *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnm0ooUe0s20GwwVB3a05rtb),了解相关规则及约束。 ; - *

频率限制:单个应用调用频率上限为每秒 3 次。 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block-children/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/CreateDocumentBlockChildrenSample.java ; - */ - public CreateDocumentBlockChildrenResp create(CreateDocumentBlockChildrenReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateDocumentBlockChildrenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDocumentBlockChildrenResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取所有子块,给定一个指定版本的文档,并指定需要操作的块,分页遍历其所有子块富文本内容 。如果不指定版本,则会默认查询最新版本。 - *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnE2UK2yY0gEGK8nBMPtB0vd),了解相关规则及约束。 ; - *

频率限制:单个应用调用频率上限为每秒 5 次。 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block-children/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/GetDocumentBlockChildrenSample.java ; - */ - public GetDocumentBlockChildrenResp get(GetDocumentBlockChildrenReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetDocumentBlockChildrenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDocumentBlockChildrenResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取所有子块,给定一个指定版本的文档,并指定需要操作的块,分页遍历其所有子块富文本内容 。如果不指定版本,则会默认查询最新版本。 - *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnE2UK2yY0gEGK8nBMPtB0vd),了解相关规则及约束。 ; - *

频率限制:单个应用调用频率上限为每秒 5 次。 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block-children/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/GetDocumentBlockChildrenSample.java ; - */ - public GetDocumentBlockChildrenResp get(GetDocumentBlockChildrenReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetDocumentBlockChildrenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDocumentBlockChildrenResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/V1.java new file mode 100644 index 000000000..67d1fa2bd --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/V1.java @@ -0,0 +1,43 @@ +// Code generated by lark suite 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 com.lark.oapi.service.docx.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.docx.v1.resource.Document; +import com.lark.oapi.service.docx.v1.resource.DocumentBlock; +import com.lark.oapi.service.docx.v1.resource.DocumentBlockChildren; + +public class V1 { + private final Document document; // 文档 + private final DocumentBlock documentBlock; // 块 + private final DocumentBlockChildren documentBlockChildren; // document.block.children + + public V1(Config config) { + this.document = new Document(config); + this.documentBlock = new DocumentBlock(config); + this.documentBlockChildren = new DocumentBlockChildren(config); + } + + public Document document() { + return document; + } + + public DocumentBlock documentBlock() { + return documentBlock; + } + + public DocumentBlockChildren documentBlockChildren() { + return documentBlockChildren; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/enums/BlockBlockTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/enums/BlockBlockTypeEnum.java index 49d86e2e2..6031c4f84 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/enums/BlockBlockTypeEnum.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/enums/BlockBlockTypeEnum.java @@ -58,6 +58,7 @@ public enum BlockBlockTypeEnum { ADDONS(40), // 文档小组件 JIRAISSUE(41), // Jira Issue WIKICATALOG(42), // Wiki 子目录 Block + BOARD(43), // 画板 Block UNDEFINED(999), // 未支持 Block ; private Integer value; diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/enums/BoardAlignEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/enums/BoardAlignEnum.java new file mode 100644 index 000000000..b934d77d5 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/enums/BoardAlignEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.docx.v1.enums; + +/** + * 对齐方式 + */ +public enum BoardAlignEnum { + LEFT(1), // 居左排版 + CENTER(2), // 居中排版 + RIGHT(3), // 居右排版 + ; + private Integer value; + + BoardAlignEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/Block.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/Block.java index 5fef32a21..ab85740e2 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/Block.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/Block.java @@ -304,6 +304,12 @@ public class Block { */ @SerializedName("wiki_catalog") private WikiCatalog wikiCatalog; + /** + * 画板 Block + *

示例值: + */ + @SerializedName("board") + private Board board; // builder 开始 public Block() { @@ -550,6 +556,11 @@ public Block(Builder builder) { *

示例值: */ this.wikiCatalog = builder.wikiCatalog; + /** + * 画板 Block + *

示例值: + */ + this.board = builder.board; } public static Builder newBuilder() { @@ -940,6 +951,14 @@ public void setWikiCatalog(WikiCatalog wikiCatalog) { this.wikiCatalog = wikiCatalog; } + public Board getBoard() { + return this.board; + } + + public void setBoard(Board board) { + this.board = board; + } + public static class Builder { /** * Block 唯一标识 @@ -1181,6 +1200,11 @@ public static class Builder { *

示例值: */ private WikiCatalog wikiCatalog; + /** + * 画板 Block + *

示例值: + */ + private Board board; /** * Block 唯一标识 @@ -1818,6 +1842,19 @@ public Builder wikiCatalog(WikiCatalog wikiCatalog) { } + /** + * 画板 Block + *

示例值: + * + * @param board + * @return + */ + public Builder board(Board board) { + this.board = board; + return this; + } + + public Block build() { return new Block(this); } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/Board.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/Board.java new file mode 100644 index 000000000..ba0e0c013 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/Board.java @@ -0,0 +1,197 @@ +// Code generated by lark suite 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 com.lark.oapi.service.docx.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class Board { + /** + * 画板 token + *

示例值:EfSPwsv03hVDKJbh1FWczJbWn90 + */ + @SerializedName("token") + private String token; + /** + * 对齐方式 + *

示例值:2 + */ + @SerializedName("align") + private Integer align; + /** + * 宽度,单位 px;不填时自动适应文档宽度;值超出文档最大宽度时,页面渲染为文档最大宽度 + *

示例值:300 + */ + @SerializedName("width") + private Integer width; + /** + * 高度,单位 px;不填时自动根据画板内容计算;值超出屏幕两倍高度时,页面渲染为屏幕两倍高度 + *

示例值:300 + */ + @SerializedName("height") + private Integer height; + + // builder 开始 + public Board() { + } + + public Board(Builder builder) { + /** + * 画板 token + *

示例值:EfSPwsv03hVDKJbh1FWczJbWn90 + */ + this.token = builder.token; + /** + * 对齐方式 + *

示例值:2 + */ + this.align = builder.align; + /** + * 宽度,单位 px;不填时自动适应文档宽度;值超出文档最大宽度时,页面渲染为文档最大宽度 + *

示例值:300 + */ + this.width = builder.width; + /** + * 高度,单位 px;不填时自动根据画板内容计算;值超出屏幕两倍高度时,页面渲染为屏幕两倍高度 + *

示例值:300 + */ + this.height = builder.height; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getToken() { + return this.token; + } + + public void setToken(String token) { + this.token = token; + } + + public Integer getAlign() { + return this.align; + } + + public void setAlign(Integer align) { + this.align = align; + } + + public Integer getWidth() { + return this.width; + } + + public void setWidth(Integer width) { + this.width = width; + } + + public Integer getHeight() { + return this.height; + } + + public void setHeight(Integer height) { + this.height = height; + } + + public static class Builder { + /** + * 画板 token + *

示例值:EfSPwsv03hVDKJbh1FWczJbWn90 + */ + private String token; + /** + * 对齐方式 + *

示例值:2 + */ + private Integer align; + /** + * 宽度,单位 px;不填时自动适应文档宽度;值超出文档最大宽度时,页面渲染为文档最大宽度 + *

示例值:300 + */ + private Integer width; + /** + * 高度,单位 px;不填时自动根据画板内容计算;值超出屏幕两倍高度时,页面渲染为屏幕两倍高度 + *

示例值:300 + */ + private Integer height; + + /** + * 画板 token + *

示例值:EfSPwsv03hVDKJbh1FWczJbWn90 + * + * @param token + * @return + */ + public Builder token(String token) { + this.token = token; + return this; + } + + + /** + * 对齐方式 + *

示例值:2 + * + * @param align + * @return + */ + public Builder align(Integer align) { + this.align = align; + return this; + } + + /** + * 对齐方式 + *

示例值:2 + * + * @param align {@link com.lark.oapi.service.docx.v1.enums.BoardAlignEnum} + * @return + */ + public Builder align(com.lark.oapi.service.docx.v1.enums.BoardAlignEnum align) { + this.align = align.getValue(); + return this; + } + + + /** + * 宽度,单位 px;不填时自动适应文档宽度;值超出文档最大宽度时,页面渲染为文档最大宽度 + *

示例值:300 + * + * @param width + * @return + */ + public Builder width(Integer width) { + this.width = width; + return this; + } + + + /** + * 高度,单位 px;不填时自动根据画板内容计算;值超出屏幕两倍高度时,页面渲染为屏幕两倍高度 + *

示例值:300 + * + * @param height + * @return + */ + public Builder height(Integer height) { + this.height = height; + return this; + } + + + public Board build() { + return new Board(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/Document.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/Document.java index b094c5180..2294f94c3 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/Document.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/Document.java @@ -34,6 +34,12 @@ public class Document { */ @SerializedName("title") private String title; + /** + * 文档展示设置 + *

示例值: + */ + @SerializedName("display_setting") + private DocumentDisplaySetting displaySetting; // builder 开始 public Document() { @@ -55,6 +61,11 @@ public Document(Builder builder) { *

示例值:undefined */ this.title = builder.title; + /** + * 文档展示设置 + *

示例值: + */ + this.displaySetting = builder.displaySetting; } public static Builder newBuilder() { @@ -85,6 +96,14 @@ public void setTitle(String title) { this.title = title; } + public DocumentDisplaySetting getDisplaySetting() { + return this.displaySetting; + } + + public void setDisplaySetting(DocumentDisplaySetting displaySetting) { + this.displaySetting = displaySetting; + } + public static class Builder { /** * 文档唯一标识 @@ -101,6 +120,11 @@ public static class Builder { *

示例值:undefined */ private String title; + /** + * 文档展示设置 + *

示例值: + */ + private DocumentDisplaySetting displaySetting; /** * 文档唯一标识 @@ -141,6 +165,19 @@ public Builder title(String title) { } + /** + * 文档展示设置 + *

示例值: + * + * @param displaySetting + * @return + */ + public Builder displaySetting(DocumentDisplaySetting displaySetting) { + this.displaySetting = displaySetting; + return this; + } + + public Document build() { return new Document(this); } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/DocumentDisplaySetting.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/DocumentDisplaySetting.java new file mode 100644 index 000000000..7441fa648 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/DocumentDisplaySetting.java @@ -0,0 +1,296 @@ +// Code generated by lark suite 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 com.lark.oapi.service.docx.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class DocumentDisplaySetting { + /** + * 文档信息中是否展示文档作者 + *

示例值:true + */ + @SerializedName("show_authors") + private Boolean showAuthors; + /** + * 文档信息中是否展示文档创建时间 + *

示例值:true + */ + @SerializedName("show_create_time") + private Boolean showCreateTime; + /** + * 文档信息中是否展示文档访问次数 + *

示例值:true + */ + @SerializedName("show_pv") + private Boolean showPv; + /** + * 文档信息中是否展示文档访问人数 + *

示例值:true + */ + @SerializedName("show_uv") + private Boolean showUv; + /** + * 文档信息中是否展示点赞总数 + *

示例值:true + */ + @SerializedName("show_like_count") + private Boolean showLikeCount; + /** + * 文档信息中是否展示评论总数 + *

示例值:true + */ + @SerializedName("show_comment_count") + private Boolean showCommentCount; + /** + * 文档信息中是否展示关联事项 + *

示例值:true + */ + @SerializedName("show_related_matters") + private Boolean showRelatedMatters; + + // builder 开始 + public DocumentDisplaySetting() { + } + + public DocumentDisplaySetting(Builder builder) { + /** + * 文档信息中是否展示文档作者 + *

示例值:true + */ + this.showAuthors = builder.showAuthors; + /** + * 文档信息中是否展示文档创建时间 + *

示例值:true + */ + this.showCreateTime = builder.showCreateTime; + /** + * 文档信息中是否展示文档访问次数 + *

示例值:true + */ + this.showPv = builder.showPv; + /** + * 文档信息中是否展示文档访问人数 + *

示例值:true + */ + this.showUv = builder.showUv; + /** + * 文档信息中是否展示点赞总数 + *

示例值:true + */ + this.showLikeCount = builder.showLikeCount; + /** + * 文档信息中是否展示评论总数 + *

示例值:true + */ + this.showCommentCount = builder.showCommentCount; + /** + * 文档信息中是否展示关联事项 + *

示例值:true + */ + this.showRelatedMatters = builder.showRelatedMatters; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Boolean getShowAuthors() { + return this.showAuthors; + } + + public void setShowAuthors(Boolean showAuthors) { + this.showAuthors = showAuthors; + } + + public Boolean getShowCreateTime() { + return this.showCreateTime; + } + + public void setShowCreateTime(Boolean showCreateTime) { + this.showCreateTime = showCreateTime; + } + + public Boolean getShowPv() { + return this.showPv; + } + + public void setShowPv(Boolean showPv) { + this.showPv = showPv; + } + + public Boolean getShowUv() { + return this.showUv; + } + + public void setShowUv(Boolean showUv) { + this.showUv = showUv; + } + + public Boolean getShowLikeCount() { + return this.showLikeCount; + } + + public void setShowLikeCount(Boolean showLikeCount) { + this.showLikeCount = showLikeCount; + } + + public Boolean getShowCommentCount() { + return this.showCommentCount; + } + + public void setShowCommentCount(Boolean showCommentCount) { + this.showCommentCount = showCommentCount; + } + + public Boolean getShowRelatedMatters() { + return this.showRelatedMatters; + } + + public void setShowRelatedMatters(Boolean showRelatedMatters) { + this.showRelatedMatters = showRelatedMatters; + } + + public static class Builder { + /** + * 文档信息中是否展示文档作者 + *

示例值:true + */ + private Boolean showAuthors; + /** + * 文档信息中是否展示文档创建时间 + *

示例值:true + */ + private Boolean showCreateTime; + /** + * 文档信息中是否展示文档访问次数 + *

示例值:true + */ + private Boolean showPv; + /** + * 文档信息中是否展示文档访问人数 + *

示例值:true + */ + private Boolean showUv; + /** + * 文档信息中是否展示点赞总数 + *

示例值:true + */ + private Boolean showLikeCount; + /** + * 文档信息中是否展示评论总数 + *

示例值:true + */ + private Boolean showCommentCount; + /** + * 文档信息中是否展示关联事项 + *

示例值:true + */ + private Boolean showRelatedMatters; + + /** + * 文档信息中是否展示文档作者 + *

示例值:true + * + * @param showAuthors + * @return + */ + public Builder showAuthors(Boolean showAuthors) { + this.showAuthors = showAuthors; + return this; + } + + + /** + * 文档信息中是否展示文档创建时间 + *

示例值:true + * + * @param showCreateTime + * @return + */ + public Builder showCreateTime(Boolean showCreateTime) { + this.showCreateTime = showCreateTime; + return this; + } + + + /** + * 文档信息中是否展示文档访问次数 + *

示例值:true + * + * @param showPv + * @return + */ + public Builder showPv(Boolean showPv) { + this.showPv = showPv; + return this; + } + + + /** + * 文档信息中是否展示文档访问人数 + *

示例值:true + * + * @param showUv + * @return + */ + public Builder showUv(Boolean showUv) { + this.showUv = showUv; + return this; + } + + + /** + * 文档信息中是否展示点赞总数 + *

示例值:true + * + * @param showLikeCount + * @return + */ + public Builder showLikeCount(Boolean showLikeCount) { + this.showLikeCount = showLikeCount; + return this; + } + + + /** + * 文档信息中是否展示评论总数 + *

示例值:true + * + * @param showCommentCount + * @return + */ + public Builder showCommentCount(Boolean showCommentCount) { + this.showCommentCount = showCommentCount; + return this; + } + + + /** + * 文档信息中是否展示关联事项 + *

示例值:true + * + * @param showRelatedMatters + * @return + */ + public Builder showRelatedMatters(Boolean showRelatedMatters) { + this.showRelatedMatters = showRelatedMatters; + return this; + } + + + public DocumentDisplaySetting build() { + return new DocumentDisplaySetting(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/Task.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/Task.java index f0e67f1b2..857370727 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/Task.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/Task.java @@ -18,10 +18,16 @@ public class Task { /** * 任务 ID,查询具体任务详情见[获取任务详情;](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/get) - *

示例值: + *

示例值:ba5040f4-8116-4042-ab3c-254e5cfe3ce7 */ @SerializedName("task_id") private String taskId; + /** + * 折叠状态 + *

示例值:false + */ + @SerializedName("folded") + private Boolean folded; // builder 开始 public Task() { @@ -30,9 +36,14 @@ public Task() { public Task(Builder builder) { /** * 任务 ID,查询具体任务详情见[获取任务详情;](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/get) - *

示例值: + *

示例值:ba5040f4-8116-4042-ab3c-254e5cfe3ce7 */ this.taskId = builder.taskId; + /** + * 折叠状态 + *

示例值:false + */ + this.folded = builder.folded; } public static Builder newBuilder() { @@ -47,16 +58,29 @@ public void setTaskId(String taskId) { this.taskId = taskId; } + public Boolean getFolded() { + return this.folded; + } + + public void setFolded(Boolean folded) { + this.folded = folded; + } + public static class Builder { /** * 任务 ID,查询具体任务详情见[获取任务详情;](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/get) - *

示例值: + *

示例值:ba5040f4-8116-4042-ab3c-254e5cfe3ce7 */ private String taskId; + /** + * 折叠状态 + *

示例值:false + */ + private Boolean folded; /** * 任务 ID,查询具体任务详情见[获取任务详情;](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/get) - *

示例值: + *

示例值:ba5040f4-8116-4042-ab3c-254e5cfe3ce7 * * @param taskId * @return @@ -67,6 +91,19 @@ public Builder taskId(String taskId) { } + /** + * 折叠状态 + *

示例值:false + * + * @param folded + * @return + */ + public Builder folded(Boolean folded) { + this.folded = folded; + return this; + } + + public Task build() { return new Task(this); } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/UpdateBlockRequest.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/UpdateBlockRequest.java index 57788632c..0ec283da3 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/UpdateBlockRequest.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/UpdateBlockRequest.java @@ -112,6 +112,12 @@ public class UpdateBlockRequest { */ @SerializedName("update_text") private UpdateTextRequest updateText; + /** + * 更新任务 Block 请求 + *

示例值: + */ + @SerializedName("update_task") + private UpdateTaskRequest updateTask; // builder 开始 public UpdateBlockRequest() { @@ -198,6 +204,11 @@ public UpdateBlockRequest(Builder builder) { *

示例值: */ this.updateText = builder.updateText; + /** + * 更新任务 Block 请求 + *

示例值: + */ + this.updateTask = builder.updateTask; } public static Builder newBuilder() { @@ -332,6 +343,14 @@ public void setUpdateText(UpdateTextRequest updateText) { this.updateText = updateText; } + public UpdateTaskRequest getUpdateTask() { + return this.updateTask; + } + + public void setUpdateTask(UpdateTaskRequest updateTask) { + this.updateTask = updateTask; + } + public static class Builder { /** * 更新文本元素请求 @@ -413,6 +432,11 @@ public static class Builder { *

示例值: */ private UpdateTextRequest updateText; + /** + * 更新任务 Block 请求 + *

示例值: + */ + private UpdateTaskRequest updateTask; /** * 更新文本元素请求 @@ -622,6 +646,19 @@ public Builder updateText(UpdateTextRequest updateText) { } + /** + * 更新任务 Block 请求 + *

示例值: + * + * @param updateTask + * @return + */ + public Builder updateTask(UpdateTaskRequest updateTask) { + this.updateTask = updateTask; + return this; + } + + public UpdateBlockRequest build() { return new UpdateBlockRequest(this); } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/UpdateDocumentRequest.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/UpdateDocumentRequest.java new file mode 100644 index 000000000..fb7dcfccf --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/UpdateDocumentRequest.java @@ -0,0 +1,74 @@ +// Code generated by lark suite 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 com.lark.oapi.service.docx.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class UpdateDocumentRequest { + /** + * 更新文档的展示设置 + *

示例值: + */ + @SerializedName("update_display_setting") + private DocumentDisplaySetting updateDisplaySetting; + + // builder 开始 + public UpdateDocumentRequest() { + } + + public UpdateDocumentRequest(Builder builder) { + /** + * 更新文档的展示设置 + *

示例值: + */ + this.updateDisplaySetting = builder.updateDisplaySetting; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public DocumentDisplaySetting getUpdateDisplaySetting() { + return this.updateDisplaySetting; + } + + public void setUpdateDisplaySetting(DocumentDisplaySetting updateDisplaySetting) { + this.updateDisplaySetting = updateDisplaySetting; + } + + public static class Builder { + /** + * 更新文档的展示设置 + *

示例值: + */ + private DocumentDisplaySetting updateDisplaySetting; + + /** + * 更新文档的展示设置 + *

示例值: + * + * @param updateDisplaySetting + * @return + */ + public Builder updateDisplaySetting(DocumentDisplaySetting updateDisplaySetting) { + this.updateDisplaySetting = updateDisplaySetting; + return this; + } + + + public UpdateDocumentRequest build() { + return new UpdateDocumentRequest(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/UpdateTaskRequest.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/UpdateTaskRequest.java new file mode 100644 index 000000000..5ab2b1163 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/model/UpdateTaskRequest.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.docx.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class UpdateTaskRequest { + /** + * 任务 ID。该字段仅在首次更新 Task Block 时生效,更新成功后,后续请求中将忽略该字段。 + *

示例值:ba5040f4-8116-4042-ab3c-254e5cfe3ce7 + */ + @SerializedName("task_id") + private String taskId; + /** + * 折叠状态,字段为空时不更新折叠状态 + *

示例值:false + */ + @SerializedName("folded") + private Boolean folded; + + // builder 开始 + public UpdateTaskRequest() { + } + + public UpdateTaskRequest(Builder builder) { + /** + * 任务 ID。该字段仅在首次更新 Task Block 时生效,更新成功后,后续请求中将忽略该字段。 + *

示例值:ba5040f4-8116-4042-ab3c-254e5cfe3ce7 + */ + this.taskId = builder.taskId; + /** + * 折叠状态,字段为空时不更新折叠状态 + *

示例值:false + */ + this.folded = builder.folded; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getTaskId() { + return this.taskId; + } + + public void setTaskId(String taskId) { + this.taskId = taskId; + } + + public Boolean getFolded() { + return this.folded; + } + + public void setFolded(Boolean folded) { + this.folded = folded; + } + + public static class Builder { + /** + * 任务 ID。该字段仅在首次更新 Task Block 时生效,更新成功后,后续请求中将忽略该字段。 + *

示例值:ba5040f4-8116-4042-ab3c-254e5cfe3ce7 + */ + private String taskId; + /** + * 折叠状态,字段为空时不更新折叠状态 + *

示例值:false + */ + private Boolean folded; + + /** + * 任务 ID。该字段仅在首次更新 Task Block 时生效,更新成功后,后续请求中将忽略该字段。 + *

示例值:ba5040f4-8116-4042-ab3c-254e5cfe3ce7 + * + * @param taskId + * @return + */ + public Builder taskId(String taskId) { + this.taskId = taskId; + return this; + } + + + /** + * 折叠状态,字段为空时不更新折叠状态 + *

示例值:false + * + * @param folded + * @return + */ + public Builder folded(Boolean folded) { + this.folded = folded; + return this; + } + + + public UpdateTaskRequest build() { + return new UpdateTaskRequest(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/resource/Document.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/resource/Document.java new file mode 100644 index 000000000..88eedeefd --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/resource/Document.java @@ -0,0 +1,248 @@ +// Code generated by lark suite 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 com.lark.oapi.service.docx.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.docx.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Document { + private static final Logger log = LoggerFactory.getLogger(Document.class); + private final Config config; + + public Document(Config config) { + this.config = config; + } + + + /** + * 创建文档,创建新版文档,文档标题和目录可选。 + *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnyoyCgwS8ywWwMtQr9yjZ2f),了解相关规则及约束。 ; + *

频率限制:单个应用调用频率上限为每秒 3 次。 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/CreateDocumentSample.java ; + */ + public CreateDocumentResp create(CreateDocumentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/docx/v1/documents" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateDocumentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDocumentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建文档,创建新版文档,文档标题和目录可选。 + *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnyoyCgwS8ywWwMtQr9yjZ2f),了解相关规则及约束。 ; + *

频率限制:单个应用调用频率上限为每秒 3 次。 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/CreateDocumentSample.java ; + */ + public CreateDocumentResp create(CreateDocumentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/docx/v1/documents" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateDocumentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDocumentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取文档基本信息,获取文档最新版本号、标题等 + *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnWKAE4aSaIU4GcdLInSaVde),了解相关规则及约束。 ; + *

频率限制:单个应用调用频率上限为每秒 5 次。 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/GetDocumentSample.java ; + */ + public GetDocumentResp get(GetDocumentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/docx/v1/documents/:document_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetDocumentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDocumentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取文档基本信息,获取文档最新版本号、标题等 + *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnWKAE4aSaIU4GcdLInSaVde),了解相关规则及约束。 ; + *

频率限制:单个应用调用频率上限为每秒 5 次。 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/GetDocumentSample.java ; + */ + public GetDocumentResp get(GetDocumentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/docx/v1/documents/:document_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetDocumentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDocumentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取文档纯文本内容,获取文档的纯文本内容。 + *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnQeqI4wiKIMis6GNvCOBuqg),了解相关规则及约束。 ; + *

频率限制:单个应用调用频率上限为每秒 5 次。 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document/raw_content ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/RawContentDocumentSample.java ; + */ + public RawContentDocumentResp rawContent(RawContentDocumentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/docx/v1/documents/:document_id/raw_content" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + RawContentDocumentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RawContentDocumentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/raw_content" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取文档纯文本内容,获取文档的纯文本内容。 + *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnQeqI4wiKIMis6GNvCOBuqg),了解相关规则及约束。 ; + *

频率限制:单个应用调用频率上限为每秒 5 次。 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document/raw_content ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/RawContentDocumentSample.java ; + */ + public RawContentDocumentResp rawContent(RawContentDocumentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/docx/v1/documents/:document_id/raw_content" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + RawContentDocumentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RawContentDocumentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/raw_content" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/resource/DocumentBlock.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/resource/DocumentBlock.java new file mode 100644 index 000000000..4458ac5e5 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/resource/DocumentBlock.java @@ -0,0 +1,318 @@ +// Code generated by lark suite 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 com.lark.oapi.service.docx.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.docx.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class DocumentBlock { + private static final Logger log = LoggerFactory.getLogger(DocumentBlock.class); + private final Config config; + + public DocumentBlock(Config config) { + this.config = config; + } + + + /** + * 批量更新块,批量更新块的富文本内容。 + *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnMiwAKCiE6oQEkPyhvmmQEe),了解相关规则及约束。 ; + *

频率限制:单个应用调用频率上限为每秒 3 次。 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block/batch_update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/BatchUpdateDocumentBlockSample.java ; + */ + public BatchUpdateDocumentBlockResp batchUpdate(BatchUpdateDocumentBlockReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/docx/v1/documents/:document_id/blocks/batch_update" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + BatchUpdateDocumentBlockResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUpdateDocumentBlockResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks/batch_update" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量更新块,批量更新块的富文本内容。 + *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnMiwAKCiE6oQEkPyhvmmQEe),了解相关规则及约束。 ; + *

频率限制:单个应用调用频率上限为每秒 3 次。 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block/batch_update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/BatchUpdateDocumentBlockSample.java ; + */ + public BatchUpdateDocumentBlockResp batchUpdate(BatchUpdateDocumentBlockReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/docx/v1/documents/:document_id/blocks/batch_update" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + BatchUpdateDocumentBlockResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUpdateDocumentBlockResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks/batch_update" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取块,获取指定块的富文本内容。 + *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnamKaccZKqIMopnREJCZUMe#doxcnWEMWYAg2YMkEq0SZXHzaih),了解相关规则及约束。 ; + *

频率限制:单个应用调用频率上限为每秒 5 次。 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/GetDocumentBlockSample.java ; + */ + public GetDocumentBlockResp get(GetDocumentBlockReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/docx/v1/documents/:document_id/blocks/:block_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetDocumentBlockResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDocumentBlockResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks/:block_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取块,获取指定块的富文本内容。 + *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnamKaccZKqIMopnREJCZUMe#doxcnWEMWYAg2YMkEq0SZXHzaih),了解相关规则及约束。 ; + *

频率限制:单个应用调用频率上限为每秒 5 次。 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/GetDocumentBlockSample.java ; + */ + public GetDocumentBlockResp get(GetDocumentBlockReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/docx/v1/documents/:document_id/blocks/:block_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetDocumentBlockResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDocumentBlockResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks/:block_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取文档所有块,获取文档所有块的富文本内容并分页返回。 + *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnamKaccZKqIMopnREJCZUMe#doxcn6AkCE2AUUm2WwxID7lS7Xc),了解相关规则及约束。 ; + *

频率限制:单个应用调用频率上限为每秒 5 次。 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/ListDocumentBlockSample.java ; + */ + public ListDocumentBlockResp list(ListDocumentBlockReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/docx/v1/documents/:document_id/blocks" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListDocumentBlockResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDocumentBlockResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取文档所有块,获取文档所有块的富文本内容并分页返回。 + *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnamKaccZKqIMopnREJCZUMe#doxcn6AkCE2AUUm2WwxID7lS7Xc),了解相关规则及约束。 ; + *

频率限制:单个应用调用频率上限为每秒 5 次。 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/ListDocumentBlockSample.java ; + */ + public ListDocumentBlockResp list(ListDocumentBlockReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/docx/v1/documents/:document_id/blocks" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListDocumentBlockResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDocumentBlockResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新块,更新指定的块。 + *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnEeyS0I8MMqoieIMpK7jm8g),了解相关规则及约束。 ; + *

频率限制:单个应用调用频率上限为每秒 3 次。 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/PatchDocumentBlockSample.java ; + */ + public PatchDocumentBlockResp patch(PatchDocumentBlockReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/docx/v1/documents/:document_id/blocks/:block_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchDocumentBlockResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchDocumentBlockResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks/:block_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新块,更新指定的块。 + *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnEeyS0I8MMqoieIMpK7jm8g),了解相关规则及约束。 ; + *

频率限制:单个应用调用频率上限为每秒 3 次。 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/PatchDocumentBlockSample.java ; + */ + public PatchDocumentBlockResp patch(PatchDocumentBlockReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/docx/v1/documents/:document_id/blocks/:block_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchDocumentBlockResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchDocumentBlockResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks/:block_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/resource/DocumentBlockChildren.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/resource/DocumentBlockChildren.java new file mode 100644 index 000000000..f3a5586cf --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/docx/v1/resource/DocumentBlockChildren.java @@ -0,0 +1,248 @@ +// Code generated by lark suite 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 com.lark.oapi.service.docx.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.docx.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class DocumentBlockChildren { + private static final Logger log = LoggerFactory.getLogger(DocumentBlockChildren.class); + private final Config config; + + public DocumentBlockChildren(Config config) { + this.config = config; + } + + + /** + * 删除块,指定需要操作的块,删除其指定范围的子块。如果操作成功,接口将返回应用删除操作后的文档版本号。 + *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcngCsscGk0WacO258mYDgM6b),了解相关规则及约束。 ; + *

频率限制:单个应用调用频率上限为每秒 3 次。 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block-children/batch_delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/BatchDeleteDocumentBlockChildrenSample.java ; + */ + public BatchDeleteDocumentBlockChildrenResp batchDelete(BatchDeleteDocumentBlockChildrenReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children/batch_delete" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + BatchDeleteDocumentBlockChildrenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteDocumentBlockChildrenResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除块,指定需要操作的块,删除其指定范围的子块。如果操作成功,接口将返回应用删除操作后的文档版本号。 + *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcngCsscGk0WacO258mYDgM6b),了解相关规则及约束。 ; + *

频率限制:单个应用调用频率上限为每秒 3 次。 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block-children/batch_delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/BatchDeleteDocumentBlockChildrenSample.java ; + */ + public BatchDeleteDocumentBlockChildrenResp batchDelete(BatchDeleteDocumentBlockChildrenReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children/batch_delete" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + BatchDeleteDocumentBlockChildrenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteDocumentBlockChildrenResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建块,指定需要操作的块,为其创建一批子块,并插入到指定位置。如果操作成功,接口将返回新创建子块的富文本内容。 + *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnm0ooUe0s20GwwVB3a05rtb),了解相关规则及约束。 ; + *

频率限制:单个应用调用频率上限为每秒 3 次。 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block-children/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/CreateDocumentBlockChildrenSample.java ; + */ + public CreateDocumentBlockChildrenResp create(CreateDocumentBlockChildrenReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateDocumentBlockChildrenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDocumentBlockChildrenResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建块,指定需要操作的块,为其创建一批子块,并插入到指定位置。如果操作成功,接口将返回新创建子块的富文本内容。 + *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnm0ooUe0s20GwwVB3a05rtb),了解相关规则及约束。 ; + *

频率限制:单个应用调用频率上限为每秒 3 次。 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block-children/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/CreateDocumentBlockChildrenSample.java ; + */ + public CreateDocumentBlockChildrenResp create(CreateDocumentBlockChildrenReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateDocumentBlockChildrenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDocumentBlockChildrenResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取所有子块,给定一个指定版本的文档,并指定需要操作的块,分页遍历其所有子块富文本内容 。如果不指定版本,则会默认查询最新版本。 + *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnE2UK2yY0gEGK8nBMPtB0vd),了解相关规则及约束。 ; + *

频率限制:单个应用调用频率上限为每秒 5 次。 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block-children/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/GetDocumentBlockChildrenSample.java ; + */ + public GetDocumentBlockChildrenResp get(GetDocumentBlockChildrenReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetDocumentBlockChildrenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDocumentBlockChildrenResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取所有子块,给定一个指定版本的文档,并指定需要操作的块,分页遍历其所有子块富文本内容 。如果不指定版本,则会默认查询最新版本。 + *

在调用此接口前,请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnE2UK2yY0gEGK8nBMPtB0vd),了解相关规则及约束。 ; + *

频率限制:单个应用调用频率上限为每秒 5 次。 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block-children/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/GetDocumentBlockChildrenSample.java ; + */ + public GetDocumentBlockChildrenResp get(GetDocumentBlockChildrenReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetDocumentBlockChildrenResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDocumentBlockChildrenResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/DriveService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/DriveService.java new file mode 100644 index 000000000..a82403e21 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/DriveService.java @@ -0,0 +1,190 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive; + +import com.lark.oapi.core.Config; +import com.lark.oapi.event.IEventHandler; +import com.lark.oapi.service.drive.v1.V1; +import com.lark.oapi.service.drive.v1.model.*; +import com.lark.oapi.service.drive.v1.resource.ExportTask; +import com.lark.oapi.service.drive.v1.resource.File; +import com.lark.oapi.service.drive.v1.resource.FileComment; +import com.lark.oapi.service.drive.v1.resource.FileCommentReply; +import com.lark.oapi.service.drive.v1.resource.FileStatistics; +import com.lark.oapi.service.drive.v1.resource.FileSubscription; +import com.lark.oapi.service.drive.v1.resource.FileViewRecord; +import com.lark.oapi.service.drive.v1.resource.ImportTask; +import com.lark.oapi.service.drive.v1.resource.Media; +import com.lark.oapi.service.drive.v1.resource.Meta; +import com.lark.oapi.service.drive.v1.resource.PermissionPublic; +import com.lark.oapi.service.drive.v1.resource.PermissionPublicPassword; +import com.lark.oapi.service.drive.v1.resource.*; +import com.lark.oapi.service.drive.v2.V2; + +public class DriveService { + private final V1 v1; + private final ExportTask exportTask; // 导出 + private final File file; // 文件夹 + private final FileComment fileComment; // 评论 + private final FileCommentReply fileCommentReply; // 评论 + private final FileStatistics fileStatistics; // file.statistics + private final FileSubscription fileSubscription; // 订阅 + private final FileVersion fileVersion; // 文档版本 + private final FileViewRecord fileViewRecord; // file.view_record + private final ImportTask importTask; // 导入 + private final Media media; // 素材 + private final Meta meta; // meta + private final PermissionMember permissionMember; // 成员 + private final PermissionPublic permissionPublic; // 设置 + private final PermissionPublicPassword permissionPublicPassword; // permission.public.password + private final V2 v2; + + public DriveService(Config config) { + this.v1 = new V1(config); + this.exportTask = new ExportTask(config); + this.file = new File(config); + this.fileComment = new FileComment(config); + this.fileCommentReply = new FileCommentReply(config); + this.fileStatistics = new FileStatistics(config); + this.fileSubscription = new FileSubscription(config); + this.fileVersion = new FileVersion(config); + this.fileViewRecord = new FileViewRecord(config); + this.importTask = new ImportTask(config); + this.media = new Media(config); + this.meta = new Meta(config); + this.permissionMember = new PermissionMember(config); + this.permissionPublic = new PermissionPublic(config); + this.permissionPublicPassword = new PermissionPublicPassword(config); + this.v2 = new V2(config); + } + + public V1 v1() { + return v1; + } + + public ExportTask exportTask() { + return exportTask; + } + + public File file() { + return file; + } + + public FileComment fileComment() { + return fileComment; + } + + public FileCommentReply fileCommentReply() { + return fileCommentReply; + } + + public FileStatistics fileStatistics() { + return fileStatistics; + } + + public FileSubscription fileSubscription() { + return fileSubscription; + } + + public FileVersion fileVersion() { + return fileVersion; + } + + public FileViewRecord fileViewRecord() { + return fileViewRecord; + } + + public ImportTask importTask() { + return importTask; + } + + public Media media() { + return media; + } + + public Meta meta() { + return meta; + } + + public PermissionMember permissionMember() { + return permissionMember; + } + + public PermissionPublic permissionPublic() { + return permissionPublic; + } + + public PermissionPublicPassword permissionPublicPassword() { + return permissionPublicPassword; + } + + public V2 v2() { + return v2; + } + + public abstract static class P2FileBitableFieldChangedV1Handler implements IEventHandler { + @Override + public P2FileBitableFieldChangedV1 getEvent() { + return new P2FileBitableFieldChangedV1(); + } + } + + public abstract static class P2FileDeletedV1Handler implements IEventHandler { + @Override + public P2FileDeletedV1 getEvent() { + return new P2FileDeletedV1(); + } + } + + public abstract static class P2FileEditV1Handler implements IEventHandler { + @Override + public P2FileEditV1 getEvent() { + return new P2FileEditV1(); + } + } + + public abstract static class P2FilePermissionMemberAddedV1Handler implements IEventHandler { + @Override + public P2FilePermissionMemberAddedV1 getEvent() { + return new P2FilePermissionMemberAddedV1(); + } + } + + public abstract static class P2FilePermissionMemberRemovedV1Handler implements IEventHandler { + @Override + public P2FilePermissionMemberRemovedV1 getEvent() { + return new P2FilePermissionMemberRemovedV1(); + } + } + + public abstract static class P2FileReadV1Handler implements IEventHandler { + @Override + public P2FileReadV1 getEvent() { + return new P2FileReadV1(); + } + } + + public abstract static class P2FileTitleUpdatedV1Handler implements IEventHandler { + @Override + public P2FileTitleUpdatedV1 getEvent() { + return new P2FileTitleUpdatedV1(); + } + } + + public abstract static class P2FileTrashedV1Handler implements IEventHandler { + @Override + public P2FileTrashedV1 getEvent() { + return new P2FileTrashedV1(); + } + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/DriveService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/DriveService.java deleted file mode 100644 index dda956be5..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/DriveService.java +++ /dev/null @@ -1,4102 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.drive.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.event.IEventHandler; -import com.lark.oapi.service.drive.v1.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.ByteArrayOutputStream; -import java.nio.charset.StandardCharsets; - -public class DriveService { - private static final Logger log = LoggerFactory.getLogger(DriveService.class); - private final ExportTask exportTask; // 导出 - private final File file; // 异步任务状态 - private final FileComment fileComment; // 评论 - private final FileCommentReply fileCommentReply; // 评论 - private final FileStatistics fileStatistics; // file.statistics - private final FileSubscription fileSubscription; // 订阅 - private final FileVersion fileVersion; // 文档版本 - private final FileViewRecord fileViewRecord; // file.view_record - private final ImportTask importTask; // 导入 - private final Media media; // 分片上传 - private final Meta meta; // meta - private final PermissionMember permissionMember; // 成员 - private final PermissionPublic permissionPublic; // 设置 - private final PermissionPublicPassword permissionPublicPassword; // permission.public.password - - public DriveService(Config config) { - this.exportTask = new ExportTask(config); - this.file = new File(config); - this.fileComment = new FileComment(config); - this.fileCommentReply = new FileCommentReply(config); - this.fileStatistics = new FileStatistics(config); - this.fileSubscription = new FileSubscription(config); - this.fileVersion = new FileVersion(config); - this.fileViewRecord = new FileViewRecord(config); - this.importTask = new ImportTask(config); - this.media = new Media(config); - this.meta = new Meta(config); - this.permissionMember = new PermissionMember(config); - this.permissionPublic = new PermissionPublic(config); - this.permissionPublicPassword = new PermissionPublicPassword(config); - } - - /** - * 导出 - * - * @return - */ - public ExportTask exportTask() { - return exportTask; - } - - /** - * 异步任务状态 - * - * @return - */ - public File file() { - return file; - } - - /** - * 评论 - * - * @return - */ - public FileComment fileComment() { - return fileComment; - } - - /** - * 评论 - * - * @return - */ - public FileCommentReply fileCommentReply() { - return fileCommentReply; - } - - /** - * file.statistics - * - * @return - */ - public FileStatistics fileStatistics() { - return fileStatistics; - } - - /** - * 订阅 - * - * @return - */ - public FileSubscription fileSubscription() { - return fileSubscription; - } - - /** - * 文档版本 - * - * @return - */ - public FileVersion fileVersion() { - return fileVersion; - } - - /** - * file.view_record - * - * @return - */ - public FileViewRecord fileViewRecord() { - return fileViewRecord; - } - - /** - * 导入 - * - * @return - */ - public ImportTask importTask() { - return importTask; - } - - /** - * 分片上传 - * - * @return - */ - public Media media() { - return media; - } - - /** - * meta - * - * @return - */ - public Meta meta() { - return meta; - } - - /** - * 成员 - * - * @return - */ - public PermissionMember permissionMember() { - return permissionMember; - } - - /** - * 设置 - * - * @return - */ - public PermissionPublic permissionPublic() { - return permissionPublic; - } - - /** - * permission.public.password - * - * @return - */ - public PermissionPublicPassword permissionPublicPassword() { - return permissionPublicPassword; - } - - public static class ExportTask { - private final Config config; - - public ExportTask(Config config) { - this.config = config; - } - - /** - * 创建导出任务,创建导出任务,将云文件导出为指定格式的本地文件。该接口为异步接口,需要通过轮询 [查询导出任务结果](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/get) 接口获取任务结果。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateExportTaskSample.java ; - */ - public CreateExportTaskResp create(CreateExportTaskReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/export_tasks" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateExportTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExportTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/export_tasks" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建导出任务,创建导出任务,将云文件导出为指定格式的本地文件。该接口为异步接口,需要通过轮询 [查询导出任务结果](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/get) 接口获取任务结果。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateExportTaskSample.java ; - */ - public CreateExportTaskResp create(CreateExportTaskReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/export_tasks" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateExportTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExportTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/export_tasks" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 下载导出文件,根据任务导出结果的token,下载导出文件 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/download ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DownloadExportTaskSample.java ; - */ - public DownloadExportTaskResp download(DownloadExportTaskReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/export_tasks/file/:file_token/download" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - if (httpResponse.getStatusCode() == 200) { - DownloadExportTaskResp resp = new DownloadExportTaskResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - DownloadExportTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadExportTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/export_tasks/file/:file_token/download" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 下载导出文件,根据任务导出结果的token,下载导出文件 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/download ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DownloadExportTaskSample.java ; - */ - public DownloadExportTaskResp download(DownloadExportTaskReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/export_tasks/file/:file_token/download" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 下载请求,返回流 - if (httpResponse.getStatusCode() == 200) { - DownloadExportTaskResp resp = new DownloadExportTaskResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - DownloadExportTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadExportTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/export_tasks/file/:file_token/download" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询导出任务结果,根据[创建导出任务](/ssl::ttdoc//uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/create)的ticket查询导出任务的结果,前提条件需要先调用创建导出任务接口。;;通过该接口获取到下载文件的 token 后调用[下载导出文件接口](/ssl::ttdoc//uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/download)将文件进行下载 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetExportTaskSample.java ; - */ - public GetExportTaskResp get(GetExportTaskReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/export_tasks/:ticket" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetExportTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetExportTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/export_tasks/:ticket" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询导出任务结果,根据[创建导出任务](/ssl::ttdoc//uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/create)的ticket查询导出任务的结果,前提条件需要先调用创建导出任务接口。;;通过该接口获取到下载文件的 token 后调用[下载导出文件接口](/ssl::ttdoc//uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/download)将文件进行下载 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetExportTaskSample.java ; - */ - public GetExportTaskResp get(GetExportTaskReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/export_tasks/:ticket" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetExportTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetExportTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/export_tasks/:ticket" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class File { - private final Config config; - - public File(Config config) { - this.config = config; - } - - /** - * 复制文件,将文件复制到用户云空间的其他文件夹中。不支持复制文件夹。;;如果目标文件夹是我的空间,则复制的文件会在「**我的空间**」的「**归我所有**」列表里。 - *

该接口不支持并发拷贝多个文件,且调用频率上限为 5QPS 且 10000次/天 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/copy ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CopyFileSample.java ; - */ - public CopyFileResp copy(CopyFileReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/files/:file_token/copy" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CopyFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CopyFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/copy" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 复制文件,将文件复制到用户云空间的其他文件夹中。不支持复制文件夹。;;如果目标文件夹是我的空间,则复制的文件会在「**我的空间**」的「**归我所有**」列表里。 - *

该接口不支持并发拷贝多个文件,且调用频率上限为 5QPS 且 10000次/天 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/copy ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CopyFileSample.java ; - */ - public CopyFileResp copy(CopyFileReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/files/:file_token/copy" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CopyFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CopyFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/copy" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 新建文件夹,在用户云空间的指定文件夹中创建一个新的空文件夹。 - *

该接口不支持并发创建,且调用频率上限为 5QPS 以及 10000次/天 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/create_folder ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFolderFileSample.java ; - */ - public CreateFolderFileResp createFolder(CreateFolderFileReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/files/create_folder" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateFolderFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFolderFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/create_folder" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 新建文件夹,在用户云空间的指定文件夹中创建一个新的空文件夹。 - *

该接口不支持并发创建,且调用频率上限为 5QPS 以及 10000次/天 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/create_folder ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFolderFileSample.java ; - */ - public CreateFolderFileResp createFolder(CreateFolderFileReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/files/create_folder" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateFolderFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFolderFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/create_folder" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create_shortcut&project=drive&resource=file&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateShortcutFileSample.java ; - */ - public CreateShortcutFileResp createShortcut(CreateShortcutFileReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/files/create_shortcut" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateShortcutFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateShortcutFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/create_shortcut" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create_shortcut&project=drive&resource=file&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateShortcutFileSample.java ; - */ - public CreateShortcutFileResp createShortcut(CreateShortcutFileReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/files/create_shortcut" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateShortcutFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateShortcutFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/create_shortcut" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除文件,删除用户在云空间内的文件或者文件夹。文件或者文件夹被删除后,会进入用户回收站里。 - *

要删除文件需要确保应用具有下述两种权限之一:;1. 该应用是文件所有者并且具有该文件所在父文件夹的编辑权限。;2. 该应用并非文件所有者,但是是该文件所在父文件夹的所有者或者拥有该父文件夹的所有权限(full access)。 ; - *

该接口不支持并发调用,且调用频率上限为5QPS。删除文件夹会异步执行并返回一个task_id,可以使用[task_check](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/task_check)接口查询任务执行状态。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteFileSample.java ; - */ - public DeleteFileResp delete(DeleteFileReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/drive/v1/files/:file_token" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除文件,删除用户在云空间内的文件或者文件夹。文件或者文件夹被删除后,会进入用户回收站里。 - *

要删除文件需要确保应用具有下述两种权限之一:;1. 该应用是文件所有者并且具有该文件所在父文件夹的编辑权限。;2. 该应用并非文件所有者,但是是该文件所在父文件夹的所有者或者拥有该父文件夹的所有权限(full access)。 ; - *

该接口不支持并发调用,且调用频率上限为5QPS。删除文件夹会异步执行并返回一个task_id,可以使用[task_check](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/task_check)接口查询任务执行状态。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteFileSample.java ; - */ - public DeleteFileResp delete(DeleteFileReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/drive/v1/files/:file_token" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 取消云文档事件订阅情况,该接口**仅支持文档拥有者**取消订阅自己文档的通知事件,可订阅的文档类型为**旧版文档**、**新版文档**、**电子表格**和**多维表格**。在调用该接口之前请确保正确[配置事件回调网址和订阅事件类型](https://open.feishu.cn/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM#2eb3504a),事件类型参考[事件列表](https://open.feishu.cn/document/ukTMukTMukTM/uYDNxYjL2QTM24iN0EjN/event-list)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/delete_subscribe ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteSubscribeFileSample.java ; - */ - public DeleteSubscribeFileResp deleteSubscribe(DeleteSubscribeFileReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/drive/v1/files/:file_token/delete_subscribe" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteSubscribeFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSubscribeFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/delete_subscribe" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 取消云文档事件订阅情况,该接口**仅支持文档拥有者**取消订阅自己文档的通知事件,可订阅的文档类型为**旧版文档**、**新版文档**、**电子表格**和**多维表格**。在调用该接口之前请确保正确[配置事件回调网址和订阅事件类型](https://open.feishu.cn/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM#2eb3504a),事件类型参考[事件列表](https://open.feishu.cn/document/ukTMukTMukTM/uYDNxYjL2QTM24iN0EjN/event-list)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/delete_subscribe ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteSubscribeFileSample.java ; - */ - public DeleteSubscribeFileResp deleteSubscribe(DeleteSubscribeFileReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/drive/v1/files/:file_token/delete_subscribe" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteSubscribeFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSubscribeFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/delete_subscribe" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 下载文件,使用该接口可以下载在云空间目录下的文件(不含飞书文档/表格/思维导图等在线文档)。支持range下载。 - *

该接口支持调用频率上限为5QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/download ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DownloadFileSample.java ; - */ - public DownloadFileResp download(DownloadFileReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/files/:file_token/download" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - if (httpResponse.getStatusCode() == 200) { - DownloadFileResp resp = new DownloadFileResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - DownloadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/download" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 下载文件,使用该接口可以下载在云空间目录下的文件(不含飞书文档/表格/思维导图等在线文档)。支持range下载。 - *

该接口支持调用频率上限为5QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/download ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DownloadFileSample.java ; - */ - public DownloadFileResp download(DownloadFileReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/files/:file_token/download" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 下载请求,返回流 - if (httpResponse.getStatusCode() == 200) { - DownloadFileResp resp = new DownloadFileResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - DownloadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/download" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询云文档事件订阅状态,该接口**仅支持文档拥有者**查询自己文档的订阅状态,可订阅的文档类型为**旧版文档**、**新版文档**、**电子表格**和**多维表格**。在调用该接口之前请确保正确[配置事件回调网址和订阅事件类型](https://open.feishu.cn/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM#2eb3504a),事件类型参考[事件列表](https://open.feishu.cn/document/ukTMukTMukTM/uYDNxYjL2QTM24iN0EjN/event-list)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/get_subscribe ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetSubscribeFileSample.java ; - */ - public GetSubscribeFileResp getSubscribe(GetSubscribeFileReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/files/:file_token/get_subscribe" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetSubscribeFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSubscribeFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/get_subscribe" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询云文档事件订阅状态,该接口**仅支持文档拥有者**查询自己文档的订阅状态,可订阅的文档类型为**旧版文档**、**新版文档**、**电子表格**和**多维表格**。在调用该接口之前请确保正确[配置事件回调网址和订阅事件类型](https://open.feishu.cn/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM#2eb3504a),事件类型参考[事件列表](https://open.feishu.cn/document/ukTMukTMukTM/uYDNxYjL2QTM24iN0EjN/event-list)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/get_subscribe ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetSubscribeFileSample.java ; - */ - public GetSubscribeFileResp getSubscribe(GetSubscribeFileReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/files/:file_token/get_subscribe" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetSubscribeFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSubscribeFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/get_subscribe" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取文件夹下的清单,获取用户云空间中指定文件夹下的文件清单。清单类型包括文件、各种在线文档(文档、电子表格、多维表格、思维笔记)、文件夹和快捷方式。该接口支持分页,但是不会递归的获取子文件夹的清单。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileSample.java ; - */ - public ListFileResp list(ListFileReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/files" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取文件夹下的清单,获取用户云空间中指定文件夹下的文件清单。清单类型包括文件、各种在线文档(文档、电子表格、多维表格、思维笔记)、文件夹和快捷方式。该接口支持分页,但是不会递归的获取子文件夹的清单。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileSample.java ; - */ - public ListFileResp list(ListFileReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/files" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 移动文件,将文件或者文件夹移动到用户云空间的其他位置。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/move ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/MoveFileSample.java ; - */ - public MoveFileResp move(MoveFileReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/files/:file_token/move" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - MoveFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MoveFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/move" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 移动文件,将文件或者文件夹移动到用户云空间的其他位置。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/move ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/MoveFileSample.java ; - */ - public MoveFileResp move(MoveFileReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/files/:file_token/move" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - MoveFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MoveFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/move" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 订阅云文档事件,该接口仅支持**文档拥有者**订阅自己文档的通知事件,可订阅的文档类型为**旧版文档**、**新版文档**、**电子表格**和**多维表格**。在调用该接口之前请确保正确[配置事件回调网址和订阅事件类型](https://open.feishu.cn/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM#2eb3504a)(暂不支持单独订阅文档维度的某类事件),事件类型参考[事件列表](https://open.feishu.cn/document/ukTMukTMukTM/uYDNxYjL2QTM24iN0EjN/event-list)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/subscribe ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/SubscribeFileSample.java ; - */ - public SubscribeFileResp subscribe(SubscribeFileReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/files/:file_token/subscribe" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - SubscribeFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscribeFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/subscribe" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 订阅云文档事件,该接口仅支持**文档拥有者**订阅自己文档的通知事件,可订阅的文档类型为**旧版文档**、**新版文档**、**电子表格**和**多维表格**。在调用该接口之前请确保正确[配置事件回调网址和订阅事件类型](https://open.feishu.cn/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM#2eb3504a)(暂不支持单独订阅文档维度的某类事件),事件类型参考[事件列表](https://open.feishu.cn/document/ukTMukTMukTM/uYDNxYjL2QTM24iN0EjN/event-list)。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/subscribe ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/SubscribeFileSample.java ; - */ - public SubscribeFileResp subscribe(SubscribeFileReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/files/:file_token/subscribe" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - SubscribeFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscribeFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/subscribe" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询异步任务状态,查询删除文件夹等异步任务的状态信息。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/task_check ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/TaskCheckFileSample.java ; - */ - public TaskCheckFileResp taskCheck(TaskCheckFileReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/files/task_check" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - TaskCheckFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TaskCheckFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/task_check" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询异步任务状态,查询删除文件夹等异步任务的状态信息。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/task_check ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/TaskCheckFileSample.java ; - */ - public TaskCheckFileResp taskCheck(TaskCheckFileReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/files/task_check" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - TaskCheckFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TaskCheckFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/task_check" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 上传文件,向云空间指定目录下上传一个小文件。 - *

请不要使用这个接口上传大于20MB的文件,如果有这个需求可以尝试使用[分片上传接口](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/multipart-upload-file-/introduction)。 ; - *

该接口支持调用频率上限为5QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_all ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadAllFileSample.java ; - */ - public UploadAllFileResp uploadAll(UploadAllFileReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/files/upload_all" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UploadAllFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadAllFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/upload_all" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 上传文件,向云空间指定目录下上传一个小文件。 - *

请不要使用这个接口上传大于20MB的文件,如果有这个需求可以尝试使用[分片上传接口](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/multipart-upload-file-/introduction)。 ; - *

该接口支持调用频率上限为5QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_all ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadAllFileSample.java ; - */ - public UploadAllFileResp uploadAll(UploadAllFileReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/files/upload_all" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UploadAllFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadAllFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/upload_all" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 分片上传文件(完成上传),触发完成上传。 - *

该接口不支持太高的并发,且调用频率上限为5QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_finish ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadFinishFileSample.java ; - */ - public UploadFinishFileResp uploadFinish(UploadFinishFileReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/files/upload_finish" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UploadFinishFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadFinishFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/upload_finish" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 分片上传文件(完成上传),触发完成上传。 - *

该接口不支持太高的并发,且调用频率上限为5QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_finish ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadFinishFileSample.java ; - */ - public UploadFinishFileResp uploadFinish(UploadFinishFileReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/files/upload_finish" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UploadFinishFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadFinishFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/upload_finish" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 分片上传文件(上传分片),上传对应的文件块。 - *

该接口不支持太高的并发,且调用频率上限为5QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_part ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPartFileSample.java ; - */ - public UploadPartFileResp uploadPart(UploadPartFileReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/files/upload_part" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UploadPartFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadPartFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/upload_part" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 分片上传文件(上传分片),上传对应的文件块。 - *

该接口不支持太高的并发,且调用频率上限为5QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_part ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPartFileSample.java ; - */ - public UploadPartFileResp uploadPart(UploadPartFileReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/files/upload_part" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UploadPartFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadPartFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/upload_part" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 分片上传文件(预上传),发送初始化请求获取上传事务ID和分块策略,目前是以4MB大小进行定长分片。 - *

你在24小时内可保存上传事务ID和上传进度,以便可以恢复上传 ; - *

该接口不支持太高的并发,且调用频率上限为5QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_prepare ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPrepareFileSample.java ; - */ - public UploadPrepareFileResp uploadPrepare(UploadPrepareFileReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/files/upload_prepare" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UploadPrepareFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadPrepareFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/upload_prepare" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 分片上传文件(预上传),发送初始化请求获取上传事务ID和分块策略,目前是以4MB大小进行定长分片。 - *

你在24小时内可保存上传事务ID和上传进度,以便可以恢复上传 ; - *

该接口不支持太高的并发,且调用频率上限为5QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_prepare ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPrepareFileSample.java ; - */ - public UploadPrepareFileResp uploadPrepare(UploadPrepareFileReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/files/upload_prepare" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UploadPrepareFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadPrepareFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/upload_prepare" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class FileComment { - private final Config config; - - public FileComment(Config config) { - this.config = config; - } - - /** - * 批量获取评论,该接口用于根据评论 ID 列表批量获取评论。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/batch_query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/BatchQueryFileCommentSample.java ; - */ - public BatchQueryFileCommentResp batchQuery(BatchQueryFileCommentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/files/:file_token/comments/batch_query" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - BatchQueryFileCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchQueryFileCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments/batch_query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量获取评论,该接口用于根据评论 ID 列表批量获取评论。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/batch_query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/BatchQueryFileCommentSample.java ; - */ - public BatchQueryFileCommentResp batchQuery(BatchQueryFileCommentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/files/:file_token/comments/batch_query" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - BatchQueryFileCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchQueryFileCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments/batch_query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 添加评论,往云文档添加一条全局评论。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFileCommentSample.java ; - */ - public CreateFileCommentResp create(CreateFileCommentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/files/:file_token/comments" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateFileCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFileCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 添加评论,往云文档添加一条全局评论。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFileCommentSample.java ; - */ - public CreateFileCommentResp create(CreateFileCommentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/files/:file_token/comments" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateFileCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFileCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取评论,获取云文档中的某条评论。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileCommentSample.java ; - */ - public GetFileCommentResp get(GetFileCommentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/files/:file_token/comments/:comment_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetFileCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFileCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments/:comment_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取评论,获取云文档中的某条评论。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileCommentSample.java ; - */ - public GetFileCommentResp get(GetFileCommentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/files/:file_token/comments/:comment_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetFileCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFileCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments/:comment_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 分页获取文档评论,该接口用于根据文档 token 分页获取文档评论。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileCommentSample.java ; - */ - public ListFileCommentResp list(ListFileCommentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/files/:file_token/comments" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListFileCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFileCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 分页获取文档评论,该接口用于根据文档 token 分页获取文档评论。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileCommentSample.java ; - */ - public ListFileCommentResp list(ListFileCommentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/files/:file_token/comments" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListFileCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFileCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 解决/恢复 评论,解决或恢复云文档中的评论。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/PatchFileCommentSample.java ; - */ - public PatchFileCommentResp patch(PatchFileCommentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/drive/v1/files/:file_token/comments/:comment_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchFileCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchFileCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments/:comment_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 解决/恢复 评论,解决或恢复云文档中的评论。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/PatchFileCommentSample.java ; - */ - public PatchFileCommentResp patch(PatchFileCommentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/drive/v1/files/:file_token/comments/:comment_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchFileCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchFileCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments/:comment_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class FileCommentReply { - private final Config config; - - public FileCommentReply(Config config) { - this.config = config; - } - - /** - * 删除回复,删除云文档中的某条回复。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment-reply/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteFileCommentReplySample.java ; - */ - public DeleteFileCommentReplyResp delete(DeleteFileCommentReplyReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteFileCommentReplyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteFileCommentReplyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除回复,删除云文档中的某条回复。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment-reply/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteFileCommentReplySample.java ; - */ - public DeleteFileCommentReplyResp delete(DeleteFileCommentReplyReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteFileCommentReplyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteFileCommentReplyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取回复,该接口用于根据评论 ID 以及分页参数,获取回复。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment-reply/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileCommentReplySample.java ; - */ - public ListFileCommentReplyResp list(ListFileCommentReplyReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListFileCommentReplyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFileCommentReplyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取回复,该接口用于根据评论 ID 以及分页参数,获取回复。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment-reply/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileCommentReplySample.java ; - */ - public ListFileCommentReplyResp list(ListFileCommentReplyReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListFileCommentReplyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFileCommentReplyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新回复,更新云文档中的某条回复。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment-reply/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UpdateFileCommentReplySample.java ; - */ - public UpdateFileCommentReplyResp update(UpdateFileCommentReplyReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateFileCommentReplyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateFileCommentReplyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新回复,更新云文档中的某条回复。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment-reply/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UpdateFileCommentReplySample.java ; - */ - public UpdateFileCommentReplyResp update(UpdateFileCommentReplyReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateFileCommentReplyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateFileCommentReplyResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class FileStatistics { - private final Config config; - - public FileStatistics(Config config) { - this.config = config; - } - - /** - * 获取文件统计信息,此接口用于获取文件统计信息,包括文档阅读人数、次数和点赞数。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-statistics/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileStatisticsSample.java ; - */ - public GetFileStatisticsResp get(GetFileStatisticsReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/files/:file_token/statistics" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetFileStatisticsResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFileStatisticsResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/statistics" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取文件统计信息,此接口用于获取文件统计信息,包括文档阅读人数、次数和点赞数。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-statistics/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileStatisticsSample.java ; - */ - public GetFileStatisticsResp get(GetFileStatisticsReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/files/:file_token/statistics" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetFileStatisticsResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFileStatisticsResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/statistics" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class FileSubscription { - private final Config config; - - public FileSubscription(Config config) { - this.config = config; - } - - /** - * 创建订阅,订阅文档中的变更事件,当前支持文档评论订阅,订阅后文档评论更新会有“云文档助手”推送给订阅的用户 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-subscription/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFileSubscriptionSample.java ; - */ - public CreateFileSubscriptionResp create(CreateFileSubscriptionReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/files/:file_token/subscriptions" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - CreateFileSubscriptionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFileSubscriptionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/subscriptions" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建订阅,订阅文档中的变更事件,当前支持文档评论订阅,订阅后文档评论更新会有“云文档助手”推送给订阅的用户 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-subscription/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFileSubscriptionSample.java ; - */ - public CreateFileSubscriptionResp create(CreateFileSubscriptionReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/files/:file_token/subscriptions" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - CreateFileSubscriptionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFileSubscriptionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/subscriptions" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取订阅状态,根据订阅ID获取该订阅的状态 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-subscription/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileSubscriptionSample.java ; - */ - public GetFileSubscriptionResp get(GetFileSubscriptionReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - GetFileSubscriptionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFileSubscriptionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取订阅状态,根据订阅ID获取该订阅的状态 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-subscription/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileSubscriptionSample.java ; - */ - public GetFileSubscriptionResp get(GetFileSubscriptionReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - GetFileSubscriptionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFileSubscriptionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新订阅状态,根据订阅ID更新订阅状态 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-subscription/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/PatchFileSubscriptionSample.java ; - */ - public PatchFileSubscriptionResp patch(PatchFileSubscriptionReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - PatchFileSubscriptionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchFileSubscriptionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新订阅状态,根据订阅ID更新订阅状态 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-subscription/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/PatchFileSubscriptionSample.java ; - */ - public PatchFileSubscriptionResp patch(PatchFileSubscriptionReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - PatchFileSubscriptionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchFileSubscriptionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class FileVersion { - private final Config config; - - public FileVersion(Config config) { - this.config = config; - } - - /** - * 创建文档版本,创建文档版本。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFileVersionSample.java ; - */ - public CreateFileVersionResp create(CreateFileVersionReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/files/:file_token/versions" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateFileVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFileVersionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/versions" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建文档版本,创建文档版本。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFileVersionSample.java ; - */ - public CreateFileVersionResp create(CreateFileVersionReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/files/:file_token/versions" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateFileVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFileVersionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/versions" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除文档版本,删除文档版本。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteFileVersionSample.java ; - */ - public DeleteFileVersionResp delete(DeleteFileVersionReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/drive/v1/files/:file_token/versions/:version_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteFileVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteFileVersionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/versions/:version_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除文档版本,删除文档版本。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteFileVersionSample.java ; - */ - public DeleteFileVersionResp delete(DeleteFileVersionReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/drive/v1/files/:file_token/versions/:version_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteFileVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteFileVersionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/versions/:version_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取文档版本,获取文档版本。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileVersionSample.java ; - */ - public GetFileVersionResp get(GetFileVersionReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/files/:file_token/versions/:version_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetFileVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFileVersionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/versions/:version_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取文档版本,获取文档版本。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileVersionSample.java ; - */ - public GetFileVersionResp get(GetFileVersionReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/files/:file_token/versions/:version_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetFileVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFileVersionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/versions/:version_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取文档版本列表,获取文档所有版本。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileVersionSample.java ; - */ - public ListFileVersionResp list(ListFileVersionReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/files/:file_token/versions" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListFileVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFileVersionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/versions" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取文档版本列表,获取文档所有版本。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileVersionSample.java ; - */ - public ListFileVersionResp list(ListFileVersionReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/files/:file_token/versions" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListFileVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFileVersionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/versions" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class FileViewRecord { - private final Config config; - - public FileViewRecord(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=drive&resource=file.view_record&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileViewRecordSample.java ; - */ - public ListFileViewRecordResp list(ListFileViewRecordReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/files/:file_token/view_records" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListFileViewRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFileViewRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/view_records" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=drive&resource=file.view_record&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileViewRecordSample.java ; - */ - public ListFileViewRecordResp list(ListFileViewRecordReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/files/:file_token/view_records" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListFileViewRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFileViewRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/view_records" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ImportTask { - private final Config config; - - public ImportTask(Config config) { - this.config = config; - } - - /** - * 创建导入任务,创建导入任务。支持导入为 doc、docx、sheet、bitable,参考[导入用户指南](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/import_task/import-user-guide) - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/import_task/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateImportTaskSample.java ; - */ - public CreateImportTaskResp create(CreateImportTaskReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/import_tasks" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateImportTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateImportTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/import_tasks" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建导入任务,创建导入任务。支持导入为 doc、docx、sheet、bitable,参考[导入用户指南](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/import_task/import-user-guide) - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/import_task/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateImportTaskSample.java ; - */ - public CreateImportTaskResp create(CreateImportTaskReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/import_tasks" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateImportTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateImportTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/import_tasks" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询导入结果,根据创建导入任务返回的 ticket 查询导入结果。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/import_task/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetImportTaskSample.java ; - */ - public GetImportTaskResp get(GetImportTaskReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/import_tasks/:ticket" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetImportTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetImportTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/import_tasks/:ticket" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询导入结果,根据创建导入任务返回的 ticket 查询导入结果。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/import_task/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetImportTaskSample.java ; - */ - public GetImportTaskResp get(GetImportTaskReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/import_tasks/:ticket" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetImportTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetImportTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/import_tasks/:ticket" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Media { - private final Config config; - - public Media(Config config) { - this.config = config; - } - - /** - * 获取素材临时下载链接,通过file_token获取素材临时下载链接,链接时效性是24小时,过期失效。 - *

该接口不支持太高的并发,且调用频率上限为5QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/batch_get_tmp_download_url ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/BatchGetTmpDownloadUrlMediaSample.java ; - */ - public BatchGetTmpDownloadUrlMediaResp batchGetTmpDownloadUrl(BatchGetTmpDownloadUrlMediaReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/medias/batch_get_tmp_download_url" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchGetTmpDownloadUrlMediaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetTmpDownloadUrlMediaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/medias/batch_get_tmp_download_url" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取素材临时下载链接,通过file_token获取素材临时下载链接,链接时效性是24小时,过期失效。 - *

该接口不支持太高的并发,且调用频率上限为5QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/batch_get_tmp_download_url ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/BatchGetTmpDownloadUrlMediaSample.java ; - */ - public BatchGetTmpDownloadUrlMediaResp batchGetTmpDownloadUrl(BatchGetTmpDownloadUrlMediaReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/medias/batch_get_tmp_download_url" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchGetTmpDownloadUrlMediaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetTmpDownloadUrlMediaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/medias/batch_get_tmp_download_url" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 下载素材,使用该接口可以下载素材。素材表示在各种创作容器里的文件,如Doc文档内的图片,文件均属于素材。支持range下载。 - *

该接口不支持太高的并发,且调用频率上限为5QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/download ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DownloadMediaSample.java ; - */ - public DownloadMediaResp download(DownloadMediaReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/medias/:file_token/download" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - if (httpResponse.getStatusCode() == 200) { - DownloadMediaResp resp = new DownloadMediaResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - DownloadMediaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadMediaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/medias/:file_token/download" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 下载素材,使用该接口可以下载素材。素材表示在各种创作容器里的文件,如Doc文档内的图片,文件均属于素材。支持range下载。 - *

该接口不支持太高的并发,且调用频率上限为5QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/download ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DownloadMediaSample.java ; - */ - public DownloadMediaResp download(DownloadMediaReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/medias/:file_token/download" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 下载请求,返回流 - if (httpResponse.getStatusCode() == 200) { - DownloadMediaResp resp = new DownloadMediaResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - DownloadMediaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadMediaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/medias/:file_token/download" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 上传素材,将文件、图片、视频等素材文件上传到指定云文档中。素材文件在云空间中不会显示,只会显示在对应云文档中。 - *

请不要使用这个接口上传大于20MB的文件,如果有这个需求可以尝试使用[分片上传接口](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/multipart-upload-media/introduction)。 ; - *

该接口支持调用频率上限为5QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_all ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadAllMediaSample.java ; - */ - public UploadAllMediaResp uploadAll(UploadAllMediaReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/medias/upload_all" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UploadAllMediaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadAllMediaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/medias/upload_all" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 上传素材,将文件、图片、视频等素材文件上传到指定云文档中。素材文件在云空间中不会显示,只会显示在对应云文档中。 - *

请不要使用这个接口上传大于20MB的文件,如果有这个需求可以尝试使用[分片上传接口](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/multipart-upload-media/introduction)。 ; - *

该接口支持调用频率上限为5QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_all ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadAllMediaSample.java ; - */ - public UploadAllMediaResp uploadAll(UploadAllMediaReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/medias/upload_all" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UploadAllMediaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadAllMediaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/medias/upload_all" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 分片上传素材(完成上传),触发完成上传。 - *

该接口不支持太高的并发,且调用频率上限为5QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_finish ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadFinishMediaSample.java ; - */ - public UploadFinishMediaResp uploadFinish(UploadFinishMediaReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/medias/upload_finish" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UploadFinishMediaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadFinishMediaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/medias/upload_finish" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 分片上传素材(完成上传),触发完成上传。 - *

该接口不支持太高的并发,且调用频率上限为5QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_finish ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadFinishMediaSample.java ; - */ - public UploadFinishMediaResp uploadFinish(UploadFinishMediaReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/medias/upload_finish" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UploadFinishMediaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadFinishMediaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/medias/upload_finish" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 分片上传素材(上传分片),上传对应的文件块。 - *

该接口不支持太高的并发,且调用频率上限为5QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_part ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPartMediaSample.java ; - */ - public UploadPartMediaResp uploadPart(UploadPartMediaReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/medias/upload_part" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UploadPartMediaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadPartMediaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/medias/upload_part" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 分片上传素材(上传分片),上传对应的文件块。 - *

该接口不支持太高的并发,且调用频率上限为5QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_part ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPartMediaSample.java ; - */ - public UploadPartMediaResp uploadPart(UploadPartMediaReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/medias/upload_part" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UploadPartMediaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadPartMediaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/medias/upload_part" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 分片上传素材(预上传),发送初始化请求获取上传事务ID和分块策略,目前是以4MB大小进行定长分片。 - *

您在24小时内可保存上传事务ID和上传进度,以便可以恢复上传 ; - *

该接口不支持太高的并发,且调用频率上限为5QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_prepare ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPrepareMediaSample.java ; - */ - public UploadPrepareMediaResp uploadPrepare(UploadPrepareMediaReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/medias/upload_prepare" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UploadPrepareMediaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadPrepareMediaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/medias/upload_prepare" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 分片上传素材(预上传),发送初始化请求获取上传事务ID和分块策略,目前是以4MB大小进行定长分片。 - *

您在24小时内可保存上传事务ID和上传进度,以便可以恢复上传 ; - *

该接口不支持太高的并发,且调用频率上限为5QPS ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_prepare ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPrepareMediaSample.java ; - */ - public UploadPrepareMediaResp uploadPrepare(UploadPrepareMediaReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/medias/upload_prepare" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UploadPrepareMediaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadPrepareMediaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/medias/upload_prepare" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Meta { - private final Config config; - - public Meta(Config config) { - this.config = config; - } - - /** - * 获取文档元数据,该接口用于根据 token 获取各类文件的元数据 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/meta/batch_query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/BatchQueryMetaSample.java ; - */ - public BatchQueryMetaResp batchQuery(BatchQueryMetaReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/metas/batch_query" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - BatchQueryMetaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchQueryMetaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/metas/batch_query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取文档元数据,该接口用于根据 token 获取各类文件的元数据 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/meta/batch_query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/BatchQueryMetaSample.java ; - */ - public BatchQueryMetaResp batchQuery(BatchQueryMetaReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/metas/batch_query" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - BatchQueryMetaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchQueryMetaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/metas/batch_query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class PermissionMember { - private final Config config; - - public PermissionMember(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=auth&project=drive&resource=permission.member&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/AuthPermissionMemberSample.java ; - */ - public AuthPermissionMemberResp auth(AuthPermissionMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/permissions/:token/members/auth" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - AuthPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AuthPermissionMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/members/auth" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=auth&project=drive&resource=permission.member&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/AuthPermissionMemberSample.java ; - */ - public AuthPermissionMemberResp auth(AuthPermissionMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/permissions/:token/members/auth" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - AuthPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AuthPermissionMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/members/auth" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 增加协作者权限,该接口用于根据 filetoken 给用户增加文档的权限。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreatePermissionMemberSample.java ; - */ - public CreatePermissionMemberResp create(CreatePermissionMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/permissions/:token/members" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreatePermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePermissionMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 增加协作者权限,该接口用于根据 filetoken 给用户增加文档的权限。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreatePermissionMemberSample.java ; - */ - public CreatePermissionMemberResp create(CreatePermissionMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/permissions/:token/members" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreatePermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePermissionMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 移除协作者权限,该接口用于根据 filetoken 移除文档协作者的权限。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeletePermissionMemberSample.java ; - */ - public DeletePermissionMemberResp delete(DeletePermissionMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/drive/v1/permissions/:token/members/:member_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeletePermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePermissionMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/members/:member_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 移除协作者权限,该接口用于根据 filetoken 移除文档协作者的权限。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeletePermissionMemberSample.java ; - */ - public DeletePermissionMemberResp delete(DeletePermissionMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/drive/v1/permissions/:token/members/:member_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeletePermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePermissionMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/members/:member_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取协作者列表,该接口用于根据 filetoken 查询协作者 - *

- 你能获取到协作者列表的前提是你对该文档有分享权限;- 目前仅支持人、群、组织架构三种类型的协作者 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListPermissionMemberSample.java ; - */ - public ListPermissionMemberResp list(ListPermissionMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/permissions/:token/members" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPermissionMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取协作者列表,该接口用于根据 filetoken 查询协作者 - *

- 你能获取到协作者列表的前提是你对该文档有分享权限;- 目前仅支持人、群、组织架构三种类型的协作者 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListPermissionMemberSample.java ; - */ - public ListPermissionMemberResp list(ListPermissionMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/permissions/:token/members" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPermissionMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=transfer_owner&project=drive&resource=permission.member&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/TransferOwnerPermissionMemberSample.java ; - */ - public TransferOwnerPermissionMemberResp transferOwner(TransferOwnerPermissionMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/permissions/:token/members/transfer_owner" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - TransferOwnerPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TransferOwnerPermissionMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/members/transfer_owner" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=transfer_owner&project=drive&resource=permission.member&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/TransferOwnerPermissionMemberSample.java ; - */ - public TransferOwnerPermissionMemberResp transferOwner(TransferOwnerPermissionMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/permissions/:token/members/transfer_owner" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - TransferOwnerPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TransferOwnerPermissionMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/members/transfer_owner" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新协作者权限,该接口用于根据 filetoken 更新文档协作者的权限。 - *

该接口要求文档协作者已存在,如还未对文档协作者授权请先调用[「增加权限」 ](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/create)接口进行授权。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UpdatePermissionMemberSample.java ; - */ - public UpdatePermissionMemberResp update(UpdatePermissionMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/drive/v1/permissions/:token/members/:member_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UpdatePermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdatePermissionMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/members/:member_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新协作者权限,该接口用于根据 filetoken 更新文档协作者的权限。 - *

该接口要求文档协作者已存在,如还未对文档协作者授权请先调用[「增加权限」 ](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/create)接口进行授权。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UpdatePermissionMemberSample.java ; - */ - public UpdatePermissionMemberResp update(UpdatePermissionMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/drive/v1/permissions/:token/members/:member_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UpdatePermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdatePermissionMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/members/:member_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class PermissionPublic { - private final Config config; - - public PermissionPublic(Config config) { - this.config = config; - } - - /** - * 获取云文档权限设置,该接口用于根据 filetoken 获取云文档的权限设置。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-public/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetPermissionPublicSample.java ; - */ - public GetPermissionPublicResp get(GetPermissionPublicReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/permissions/:token/public" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetPermissionPublicResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetPermissionPublicResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/public" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取云文档权限设置,该接口用于根据 filetoken 获取云文档的权限设置。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-public/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetPermissionPublicSample.java ; - */ - public GetPermissionPublicResp get(GetPermissionPublicReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/drive/v1/permissions/:token/public" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetPermissionPublicResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetPermissionPublicResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/public" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新云文档权限设置,该接口用于根据 filetoken 更新云文档的权限设置。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-public/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/PatchPermissionPublicSample.java ; - */ - public PatchPermissionPublicResp patch(PatchPermissionPublicReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/drive/v1/permissions/:token/public" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchPermissionPublicResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchPermissionPublicResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/public" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新云文档权限设置,该接口用于根据 filetoken 更新云文档的权限设置。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-public/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/PatchPermissionPublicSample.java ; - */ - public PatchPermissionPublicResp patch(PatchPermissionPublicReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/drive/v1/permissions/:token/public" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchPermissionPublicResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchPermissionPublicResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/public" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class PermissionPublicPassword { - private final Config config; - - public PermissionPublicPassword(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=drive&resource=permission.public.password&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreatePermissionPublicPasswordSample.java ; - */ - public CreatePermissionPublicPasswordResp create(CreatePermissionPublicPasswordReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/permissions/:token/public/password" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreatePermissionPublicPasswordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePermissionPublicPasswordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/public/password" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=drive&resource=permission.public.password&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreatePermissionPublicPasswordSample.java ; - */ - public CreatePermissionPublicPasswordResp create(CreatePermissionPublicPasswordReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/drive/v1/permissions/:token/public/password" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreatePermissionPublicPasswordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePermissionPublicPasswordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/public/password" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=drive&resource=permission.public.password&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeletePermissionPublicPasswordSample.java ; - */ - public DeletePermissionPublicPasswordResp delete(DeletePermissionPublicPasswordReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/drive/v1/permissions/:token/public/password" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeletePermissionPublicPasswordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePermissionPublicPasswordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/public/password" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=drive&resource=permission.public.password&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeletePermissionPublicPasswordSample.java ; - */ - public DeletePermissionPublicPasswordResp delete(DeletePermissionPublicPasswordReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/drive/v1/permissions/:token/public/password" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeletePermissionPublicPasswordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePermissionPublicPasswordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/public/password" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=drive&resource=permission.public.password&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UpdatePermissionPublicPasswordSample.java ; - */ - public UpdatePermissionPublicPasswordResp update(UpdatePermissionPublicPasswordReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/drive/v1/permissions/:token/public/password" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UpdatePermissionPublicPasswordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdatePermissionPublicPasswordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/public/password" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=drive&resource=permission.public.password&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UpdatePermissionPublicPasswordSample.java ; - */ - public UpdatePermissionPublicPasswordResp update(UpdatePermissionPublicPasswordReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/drive/v1/permissions/:token/public/password" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UpdatePermissionPublicPasswordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdatePermissionPublicPasswordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/public/password" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public abstract static class P2FileBitableFieldChangedV1Handler implements IEventHandler { - @Override - public P2FileBitableFieldChangedV1 getEvent() { - return new P2FileBitableFieldChangedV1(); - } - } - - public abstract static class P2FileDeletedV1Handler implements IEventHandler { - @Override - public P2FileDeletedV1 getEvent() { - return new P2FileDeletedV1(); - } - } - - public abstract static class P2FileEditV1Handler implements IEventHandler { - @Override - public P2FileEditV1 getEvent() { - return new P2FileEditV1(); - } - } - - public abstract static class P2FilePermissionMemberAddedV1Handler implements IEventHandler { - @Override - public P2FilePermissionMemberAddedV1 getEvent() { - return new P2FilePermissionMemberAddedV1(); - } - } - - public abstract static class P2FilePermissionMemberRemovedV1Handler implements IEventHandler { - @Override - public P2FilePermissionMemberRemovedV1 getEvent() { - return new P2FilePermissionMemberRemovedV1(); - } - } - - public abstract static class P2FileReadV1Handler implements IEventHandler { - @Override - public P2FileReadV1 getEvent() { - return new P2FileReadV1(); - } - } - - public abstract static class P2FileTitleUpdatedV1Handler implements IEventHandler { - @Override - public P2FileTitleUpdatedV1 getEvent() { - return new P2FileTitleUpdatedV1(); - } - } - - public abstract static class P2FileTrashedV1Handler implements IEventHandler { - @Override - public P2FileTrashedV1 getEvent() { - return new P2FileTrashedV1(); - } - } -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/V1.java new file mode 100644 index 000000000..8be644919 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/V1.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.drive.v1.resource.*; + +public class V1 { + private final ExportTask exportTask; // 导出 + private final File file; // 文件夹 + private final FileComment fileComment; // 评论 + private final FileCommentReply fileCommentReply; // 评论 + private final FileStatistics fileStatistics; // file.statistics + private final FileSubscription fileSubscription; // 订阅 + private final FileVersion fileVersion; // 文档版本 + private final FileViewRecord fileViewRecord; // file.view_record + private final ImportTask importTask; // 导入 + private final Media media; // 素材 + private final Meta meta; // meta + private final PermissionMember permissionMember; // 成员 + private final PermissionPublic permissionPublic; // 设置 + private final PermissionPublicPassword permissionPublicPassword; // permission.public.password + + public V1(Config config) { + this.exportTask = new ExportTask(config); + this.file = new File(config); + this.fileComment = new FileComment(config); + this.fileCommentReply = new FileCommentReply(config); + this.fileStatistics = new FileStatistics(config); + this.fileSubscription = new FileSubscription(config); + this.fileVersion = new FileVersion(config); + this.fileViewRecord = new FileViewRecord(config); + this.importTask = new ImportTask(config); + this.media = new Media(config); + this.meta = new Meta(config); + this.permissionMember = new PermissionMember(config); + this.permissionPublic = new PermissionPublic(config); + this.permissionPublicPassword = new PermissionPublicPassword(config); + } + + public ExportTask exportTask() { + return exportTask; + } + + public File file() { + return file; + } + + public FileComment fileComment() { + return fileComment; + } + + public FileCommentReply fileCommentReply() { + return fileCommentReply; + } + + public FileStatistics fileStatistics() { + return fileStatistics; + } + + public FileSubscription fileSubscription() { + return fileSubscription; + } + + public FileVersion fileVersion() { + return fileVersion; + } + + public FileViewRecord fileViewRecord() { + return fileViewRecord; + } + + public ImportTask importTask() { + return importTask; + } + + public Media media() { + return media; + } + + public Meta meta() { + return meta; + } + + public PermissionMember permissionMember() { + return permissionMember; + } + + public PermissionPublic permissionPublic() { + return permissionPublic; + } + + public PermissionPublicPassword permissionPublicPassword() { + return permissionPublicPassword; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/AuthPermissionMemberPermEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/AuthPermissionMemberPermEnum.java index cfa5cdba1..55bc8e8d7 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/AuthPermissionMemberPermEnum.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/AuthPermissionMemberPermEnum.java @@ -24,6 +24,7 @@ public enum AuthPermissionMemberPermEnum { EXPORT("export"), // 导出 COPY("copy"), // 拷贝 PRINT("print"), // 打印 + MANAGEPUBLIC("manage_public"), // 管理权限设置 ; private String value; diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/CreateFileVersionObjTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/CreateFileVersionObjTypeEnum.java index 39905e14c..3ca5fa26b 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/CreateFileVersionObjTypeEnum.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/CreateFileVersionObjTypeEnum.java @@ -18,6 +18,7 @@ */ public enum CreateFileVersionObjTypeEnum { DOCX("docx"), // 新版文档 + SHEET("sheet"), // 电子表格 ; private String value; diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/CreateFileVersionParentTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/CreateFileVersionParentTypeEnum.java index 46f2909b4..ed8a7ddc1 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/CreateFileVersionParentTypeEnum.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/CreateFileVersionParentTypeEnum.java @@ -18,6 +18,7 @@ */ public enum CreateFileVersionParentTypeEnum { OBJTYPEDOCX("docx"), // 新版文档 + OBJTYPESHEET("sheet"), // 电子表格 ; private String value; diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/DeleteFileVersionObjTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/DeleteFileVersionObjTypeEnum.java index 83b05c19f..34f38a283 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/DeleteFileVersionObjTypeEnum.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/DeleteFileVersionObjTypeEnum.java @@ -18,6 +18,7 @@ */ public enum DeleteFileVersionObjTypeEnum { DOCX("docx"), // 新版文档 + SHEET("sheet"), // 电子表格 ; private String value; diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/GetFileVersionObjTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/GetFileVersionObjTypeEnum.java index f51cbd63f..56f2b4d52 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/GetFileVersionObjTypeEnum.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/GetFileVersionObjTypeEnum.java @@ -18,6 +18,7 @@ */ public enum GetFileVersionObjTypeEnum { DOCX("docx"), // 新版文档 + SHEET("sheet"), // 电子表格 ; private String value; diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/ListFileVersionObjTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/ListFileVersionObjTypeEnum.java index 49fae79f9..cfef91224 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/ListFileVersionObjTypeEnum.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/ListFileVersionObjTypeEnum.java @@ -18,6 +18,7 @@ */ public enum ListFileVersionObjTypeEnum { DOCX("docx"), // 新版文档 + SHEET("sheet"), // 电子表格 ; private String value; diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/VersionObjTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/VersionObjTypeEnum.java index 8ced46f87..7edc11466 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/VersionObjTypeEnum.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/VersionObjTypeEnum.java @@ -18,6 +18,7 @@ */ public enum VersionObjTypeEnum { DOCX("docx"), // 新版文档 + SHEET("sheet"), // 电子表格 ; private String value; diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/VersionParentTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/VersionParentTypeEnum.java index 4cb43a8d6..932b053e7 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/VersionParentTypeEnum.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/enums/VersionParentTypeEnum.java @@ -18,6 +18,7 @@ */ public enum VersionParentTypeEnum { OBJTYPEDOCX("docx"), // 新版文档 + OBJTYPESHEET("sheet"), // 电子表格 ; private String value; diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/model/DeleteFileCommentReplyReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/model/DeleteFileCommentReplyReq.java index 26435f46c..8b1d25484 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/model/DeleteFileCommentReplyReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/model/DeleteFileCommentReplyReq.java @@ -46,9 +46,11 @@ public class DeleteFileCommentReplyReq { @Path @SerializedName("reply_id") private String replyId; + // builder 开始 public DeleteFileCommentReplyReq() { } + public DeleteFileCommentReplyReq(Builder builder) { /** * 文档类型 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/model/FileBlockChangeInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/model/FileBlockChangeInfo.java new file mode 100644 index 000000000..33ef10e6d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/model/FileBlockChangeInfo.java @@ -0,0 +1,148 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class FileBlockChangeInfo { + /** + * 子block token + *

示例值:doxcnxxxxxxxxxxxxxxxx + */ + @SerializedName("block_token") + private String blockToken; + /** + * 子block文档类型 + *

示例值:docx + */ + @SerializedName("block_token_type") + private String blockTokenType; + /** + * 起点版本和终点版本 + *

示例值: + */ + @SerializedName("rev_ranges") + private Integer[] revRanges; + + // builder 开始 + public FileBlockChangeInfo() { + } + + public FileBlockChangeInfo(Builder builder) { + /** + * 子block token + *

示例值:doxcnxxxxxxxxxxxxxxxx + */ + this.blockToken = builder.blockToken; + /** + * 子block文档类型 + *

示例值:docx + */ + this.blockTokenType = builder.blockTokenType; + /** + * 起点版本和终点版本 + *

示例值: + */ + this.revRanges = builder.revRanges; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getBlockToken() { + return this.blockToken; + } + + public void setBlockToken(String blockToken) { + this.blockToken = blockToken; + } + + public String getBlockTokenType() { + return this.blockTokenType; + } + + public void setBlockTokenType(String blockTokenType) { + this.blockTokenType = blockTokenType; + } + + public Integer[] getRevRanges() { + return this.revRanges; + } + + public void setRevRanges(Integer[] revRanges) { + this.revRanges = revRanges; + } + + public static class Builder { + /** + * 子block token + *

示例值:doxcnxxxxxxxxxxxxxxxx + */ + private String blockToken; + /** + * 子block文档类型 + *

示例值:docx + */ + private String blockTokenType; + /** + * 起点版本和终点版本 + *

示例值: + */ + private Integer[] revRanges; + + /** + * 子block token + *

示例值:doxcnxxxxxxxxxxxxxxxx + * + * @param blockToken + * @return + */ + public Builder blockToken(String blockToken) { + this.blockToken = blockToken; + return this; + } + + + /** + * 子block文档类型 + *

示例值:docx + * + * @param blockTokenType + * @return + */ + public Builder blockTokenType(String blockTokenType) { + this.blockTokenType = blockTokenType; + return this; + } + + + /** + * 起点版本和终点版本 + *

示例值: + * + * @param revRanges + * @return + */ + public Builder revRanges(Integer[] revRanges) { + this.revRanges = revRanges; + return this; + } + + + public FileBlockChangeInfo build() { + return new FileBlockChangeInfo(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/model/FileChangeInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/model/FileChangeInfo.java new file mode 100644 index 000000000..08751eac8 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/model/FileChangeInfo.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class FileChangeInfo { + /** + * 变更开始时间 + *

示例值:1687748146 + */ + @SerializedName("start_time") + private Integer startTime; + /** + * 版本变更明细 + *

示例值: + */ + @SerializedName("changes") + private FileBlockChangeInfo[] changes; + + // builder 开始 + public FileChangeInfo() { + } + + public FileChangeInfo(Builder builder) { + /** + * 变更开始时间 + *

示例值:1687748146 + */ + this.startTime = builder.startTime; + /** + * 版本变更明细 + *

示例值: + */ + this.changes = builder.changes; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Integer getStartTime() { + return this.startTime; + } + + public void setStartTime(Integer startTime) { + this.startTime = startTime; + } + + public FileBlockChangeInfo[] getChanges() { + return this.changes; + } + + public void setChanges(FileBlockChangeInfo[] changes) { + this.changes = changes; + } + + public static class Builder { + /** + * 变更开始时间 + *

示例值:1687748146 + */ + private Integer startTime; + /** + * 版本变更明细 + *

示例值: + */ + private FileBlockChangeInfo[] changes; + + /** + * 变更开始时间 + *

示例值:1687748146 + * + * @param startTime + * @return + */ + public Builder startTime(Integer startTime) { + this.startTime = startTime; + return this; + } + + + /** + * 版本变更明细 + *

示例值: + * + * @param changes + * @return + */ + public Builder changes(FileBlockChangeInfo[] changes) { + this.changes = changes; + return this; + } + + + public FileChangeInfo build() { + return new FileChangeInfo(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/model/FileStatistics.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/model/FileStatistics.java index 525c4887c..841992347 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/model/FileStatistics.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/model/FileStatistics.java @@ -40,6 +40,24 @@ public class FileStatistics { */ @SerializedName("timestamp") private Integer timestamp; + /** + * 今日新增文档访问人数 + *

示例值:1 + */ + @SerializedName("uv_today") + private Integer uvToday; + /** + * 今日新增文档访问次数 + *

示例值:1 + */ + @SerializedName("pv_today") + private Integer pvToday; + /** + * 今日新增文档点赞数 + *

示例值:1 + */ + @SerializedName("like_count_today") + private Integer likeCountToday; // builder 开始 public FileStatistics() { @@ -66,6 +84,21 @@ public FileStatistics(Builder builder) { *

示例值:1627367349 */ this.timestamp = builder.timestamp; + /** + * 今日新增文档访问人数 + *

示例值:1 + */ + this.uvToday = builder.uvToday; + /** + * 今日新增文档访问次数 + *

示例值:1 + */ + this.pvToday = builder.pvToday; + /** + * 今日新增文档点赞数 + *

示例值:1 + */ + this.likeCountToday = builder.likeCountToday; } public static Builder newBuilder() { @@ -104,6 +137,30 @@ public void setTimestamp(Integer timestamp) { this.timestamp = timestamp; } + public Integer getUvToday() { + return this.uvToday; + } + + public void setUvToday(Integer uvToday) { + this.uvToday = uvToday; + } + + public Integer getPvToday() { + return this.pvToday; + } + + public void setPvToday(Integer pvToday) { + this.pvToday = pvToday; + } + + public Integer getLikeCountToday() { + return this.likeCountToday; + } + + public void setLikeCountToday(Integer likeCountToday) { + this.likeCountToday = likeCountToday; + } + public static class Builder { /** * 文件历史访问人数,同一用户(user_id)多次访问按一次计算。 @@ -125,6 +182,21 @@ public static class Builder { *

示例值:1627367349 */ private Integer timestamp; + /** + * 今日新增文档访问人数 + *

示例值:1 + */ + private Integer uvToday; + /** + * 今日新增文档访问次数 + *

示例值:1 + */ + private Integer pvToday; + /** + * 今日新增文档点赞数 + *

示例值:1 + */ + private Integer likeCountToday; /** * 文件历史访问人数,同一用户(user_id)多次访问按一次计算。 @@ -178,6 +250,45 @@ public Builder timestamp(Integer timestamp) { } + /** + * 今日新增文档访问人数 + *

示例值:1 + * + * @param uvToday + * @return + */ + public Builder uvToday(Integer uvToday) { + this.uvToday = uvToday; + return this; + } + + + /** + * 今日新增文档访问次数 + *

示例值:1 + * + * @param pvToday + * @return + */ + public Builder pvToday(Integer pvToday) { + this.pvToday = pvToday; + return this; + } + + + /** + * 今日新增文档点赞数 + *

示例值:1 + * + * @param likeCountToday + * @return + */ + public Builder likeCountToday(Integer likeCountToday) { + this.likeCountToday = likeCountToday; + return this; + } + + public FileStatistics build() { return new FileStatistics(this); } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/model/PatchFileCommentReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/model/PatchFileCommentReq.java index 5867297c0..1b6309c11 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/model/PatchFileCommentReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/model/PatchFileCommentReq.java @@ -42,6 +42,7 @@ public class PatchFileCommentReq { private String commentId; @Body private PatchFileCommentReqBody body; + // builder 开始 public PatchFileCommentReq() { } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/model/UpdateFileCommentReplyReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/model/UpdateFileCommentReplyReq.java index 7bd0428bf..72b07f558 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/model/UpdateFileCommentReplyReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/model/UpdateFileCommentReplyReq.java @@ -60,6 +60,7 @@ public class UpdateFileCommentReplyReq { // builder 开始 public UpdateFileCommentReplyReq() { } + public UpdateFileCommentReplyReq(Builder builder) { /** * 文档类型 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/ExportTask.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/ExportTask.java new file mode 100644 index 000000000..426d0315a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/ExportTask.java @@ -0,0 +1,258 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.drive.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.ByteArrayOutputStream; +import java.nio.charset.StandardCharsets; + +public class ExportTask { + private static final Logger log = LoggerFactory.getLogger(ExportTask.class); + private final Config config; + + public ExportTask(Config config) { + this.config = config; + } + + + /** + * 创建导出任务,创建导出任务,将云文件导出为指定格式的本地文件。该接口为异步接口,需要通过轮询 [查询导出任务结果](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/get) 接口获取任务结果。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateExportTaskSample.java ; + */ + public CreateExportTaskResp create(CreateExportTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/export_tasks" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateExportTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExportTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/export_tasks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建导出任务,创建导出任务,将云文件导出为指定格式的本地文件。该接口为异步接口,需要通过轮询 [查询导出任务结果](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/get) 接口获取任务结果。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateExportTaskSample.java ; + */ + public CreateExportTaskResp create(CreateExportTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/export_tasks" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateExportTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExportTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/export_tasks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 下载导出文件,根据任务导出结果的token,下载导出文件 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/download ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DownloadExportTaskSample.java ; + */ + public DownloadExportTaskResp download(DownloadExportTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/export_tasks/file/:file_token/download" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + if (httpResponse.getStatusCode() == 200) { + DownloadExportTaskResp resp = new DownloadExportTaskResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + DownloadExportTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadExportTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/export_tasks/file/:file_token/download" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 下载导出文件,根据任务导出结果的token,下载导出文件 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/download ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DownloadExportTaskSample.java ; + */ + public DownloadExportTaskResp download(DownloadExportTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/export_tasks/file/:file_token/download" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 下载请求,返回流 + if (httpResponse.getStatusCode() == 200) { + DownloadExportTaskResp resp = new DownloadExportTaskResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + DownloadExportTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadExportTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/export_tasks/file/:file_token/download" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询导出任务结果,根据[创建导出任务](/ssl::ttdoc//uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/create)的ticket查询导出任务的结果,前提条件需要先调用创建导出任务接口。;;通过该接口获取到下载文件的 token 后调用[下载导出文件接口](/ssl::ttdoc//uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/download)将文件进行下载 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetExportTaskSample.java ; + */ + public GetExportTaskResp get(GetExportTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/export_tasks/:ticket" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetExportTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetExportTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/export_tasks/:ticket" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询导出任务结果,根据[创建导出任务](/ssl::ttdoc//uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/create)的ticket查询导出任务的结果,前提条件需要先调用创建导出任务接口。;;通过该接口获取到下载文件的 token 后调用[下载导出文件接口](/ssl::ttdoc//uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/download)将文件进行下载 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetExportTaskSample.java ; + */ + public GetExportTaskResp get(GetExportTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/export_tasks/:ticket" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetExportTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetExportTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/export_tasks/:ticket" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/File.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/File.java new file mode 100644 index 000000000..eb27d8373 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/File.java @@ -0,0 +1,1076 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.drive.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.ByteArrayOutputStream; +import java.nio.charset.StandardCharsets; + +public class File { + private static final Logger log = LoggerFactory.getLogger(File.class); + private final Config config; + + public File(Config config) { + this.config = config; + } + + + /** + * 复制文件,将文件复制到用户云空间的其他文件夹中。不支持复制文件夹。;;如果目标文件夹是我的空间,则复制的文件会在「**我的空间**」的「**归我所有**」列表里。 + *

该接口不支持并发拷贝多个文件,且调用频率上限为 5QPS 且 10000次/天 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/copy ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CopyFileSample.java ; + */ + public CopyFileResp copy(CopyFileReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/files/:file_token/copy" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CopyFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CopyFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/copy" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 复制文件,将文件复制到用户云空间的其他文件夹中。不支持复制文件夹。;;如果目标文件夹是我的空间,则复制的文件会在「**我的空间**」的「**归我所有**」列表里。 + *

该接口不支持并发拷贝多个文件,且调用频率上限为 5QPS 且 10000次/天 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/copy ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CopyFileSample.java ; + */ + public CopyFileResp copy(CopyFileReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/files/:file_token/copy" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CopyFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CopyFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/copy" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 新建文件夹,在用户云空间的指定文件夹中创建一个新的空文件夹。 + *

该接口不支持并发创建,且调用频率上限为 5QPS 以及 10000次/天 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/create_folder ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFolderFileSample.java ; + */ + public CreateFolderFileResp createFolder(CreateFolderFileReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/files/create_folder" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateFolderFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFolderFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/create_folder" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 新建文件夹,在用户云空间的指定文件夹中创建一个新的空文件夹。 + *

该接口不支持并发创建,且调用频率上限为 5QPS 以及 10000次/天 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/create_folder ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFolderFileSample.java ; + */ + public CreateFolderFileResp createFolder(CreateFolderFileReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/files/create_folder" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateFolderFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFolderFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/create_folder" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create_shortcut&project=drive&resource=file&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateShortcutFileSample.java ; + */ + public CreateShortcutFileResp createShortcut(CreateShortcutFileReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/files/create_shortcut" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateShortcutFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateShortcutFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/create_shortcut" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create_shortcut&project=drive&resource=file&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateShortcutFileSample.java ; + */ + public CreateShortcutFileResp createShortcut(CreateShortcutFileReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/files/create_shortcut" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateShortcutFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateShortcutFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/create_shortcut" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除文件,删除用户在云空间内的文件或者文件夹。文件或者文件夹被删除后,会进入用户回收站里。 + *

要删除文件需要确保应用具有下述两种权限之一:;1. 该应用是文件所有者并且具有该文件所在父文件夹的编辑权限。;2. 该应用并非文件所有者,但是是该文件所在父文件夹的所有者或者拥有该父文件夹的所有权限(full access)。 ; + *

该接口不支持并发调用,且调用频率上限为5QPS。删除文件夹会异步执行并返回一个task_id,可以使用[task_check](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/task_check)接口查询任务执行状态。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteFileSample.java ; + */ + public DeleteFileResp delete(DeleteFileReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/drive/v1/files/:file_token" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除文件,删除用户在云空间内的文件或者文件夹。文件或者文件夹被删除后,会进入用户回收站里。 + *

要删除文件需要确保应用具有下述两种权限之一:;1. 该应用是文件所有者并且具有该文件所在父文件夹的编辑权限。;2. 该应用并非文件所有者,但是是该文件所在父文件夹的所有者或者拥有该父文件夹的所有权限(full access)。 ; + *

该接口不支持并发调用,且调用频率上限为5QPS。删除文件夹会异步执行并返回一个task_id,可以使用[task_check](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/task_check)接口查询任务执行状态。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteFileSample.java ; + */ + public DeleteFileResp delete(DeleteFileReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/drive/v1/files/:file_token" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 取消云文档事件订阅情况,该接口**仅支持文档拥有者**取消订阅自己文档的通知事件,可订阅的文档类型为**旧版文档**、**新版文档**、**电子表格**和**多维表格**。在调用该接口之前请确保正确[配置事件回调网址和订阅事件类型](https://open.feishu.cn/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM#2eb3504a),事件类型参考[事件列表](https://open.feishu.cn/document/ukTMukTMukTM/uYDNxYjL2QTM24iN0EjN/event-list)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/delete_subscribe ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteSubscribeFileSample.java ; + */ + public DeleteSubscribeFileResp deleteSubscribe(DeleteSubscribeFileReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/drive/v1/files/:file_token/delete_subscribe" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteSubscribeFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSubscribeFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/delete_subscribe" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 取消云文档事件订阅情况,该接口**仅支持文档拥有者**取消订阅自己文档的通知事件,可订阅的文档类型为**旧版文档**、**新版文档**、**电子表格**和**多维表格**。在调用该接口之前请确保正确[配置事件回调网址和订阅事件类型](https://open.feishu.cn/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM#2eb3504a),事件类型参考[事件列表](https://open.feishu.cn/document/ukTMukTMukTM/uYDNxYjL2QTM24iN0EjN/event-list)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/delete_subscribe ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteSubscribeFileSample.java ; + */ + public DeleteSubscribeFileResp deleteSubscribe(DeleteSubscribeFileReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/drive/v1/files/:file_token/delete_subscribe" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteSubscribeFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSubscribeFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/delete_subscribe" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 下载文件,使用该接口可以下载在云空间目录下的文件(不含飞书文档/表格/思维导图等在线文档)。支持range下载。 + *

该接口支持调用频率上限为5QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/download ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DownloadFileSample.java ; + */ + public DownloadFileResp download(DownloadFileReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/files/:file_token/download" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + if (httpResponse.getStatusCode() == 200) { + DownloadFileResp resp = new DownloadFileResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + DownloadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/download" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 下载文件,使用该接口可以下载在云空间目录下的文件(不含飞书文档/表格/思维导图等在线文档)。支持range下载。 + *

该接口支持调用频率上限为5QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/download ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DownloadFileSample.java ; + */ + public DownloadFileResp download(DownloadFileReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/files/:file_token/download" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 下载请求,返回流 + if (httpResponse.getStatusCode() == 200) { + DownloadFileResp resp = new DownloadFileResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + DownloadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/download" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询云文档事件订阅状态,该接口**仅支持文档拥有者**查询自己文档的订阅状态,可订阅的文档类型为**旧版文档**、**新版文档**、**电子表格**和**多维表格**。在调用该接口之前请确保正确[配置事件回调网址和订阅事件类型](https://open.feishu.cn/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM#2eb3504a),事件类型参考[事件列表](https://open.feishu.cn/document/ukTMukTMukTM/uYDNxYjL2QTM24iN0EjN/event-list)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/get_subscribe ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetSubscribeFileSample.java ; + */ + public GetSubscribeFileResp getSubscribe(GetSubscribeFileReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/files/:file_token/get_subscribe" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetSubscribeFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSubscribeFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/get_subscribe" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询云文档事件订阅状态,该接口**仅支持文档拥有者**查询自己文档的订阅状态,可订阅的文档类型为**旧版文档**、**新版文档**、**电子表格**和**多维表格**。在调用该接口之前请确保正确[配置事件回调网址和订阅事件类型](https://open.feishu.cn/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM#2eb3504a),事件类型参考[事件列表](https://open.feishu.cn/document/ukTMukTMukTM/uYDNxYjL2QTM24iN0EjN/event-list)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/get_subscribe ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetSubscribeFileSample.java ; + */ + public GetSubscribeFileResp getSubscribe(GetSubscribeFileReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/files/:file_token/get_subscribe" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetSubscribeFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSubscribeFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/get_subscribe" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取文件夹下的清单,获取用户云空间中指定文件夹下的文件清单。清单类型包括文件、各种在线文档(文档、电子表格、多维表格、思维笔记)、文件夹和快捷方式。该接口支持分页,但是不会递归的获取子文件夹的清单。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileSample.java ; + */ + public ListFileResp list(ListFileReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/files" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取文件夹下的清单,获取用户云空间中指定文件夹下的文件清单。清单类型包括文件、各种在线文档(文档、电子表格、多维表格、思维笔记)、文件夹和快捷方式。该接口支持分页,但是不会递归的获取子文件夹的清单。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileSample.java ; + */ + public ListFileResp list(ListFileReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/files" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 移动文件,将文件或者文件夹移动到用户云空间的其他位置。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/move ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/MoveFileSample.java ; + */ + public MoveFileResp move(MoveFileReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/files/:file_token/move" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + MoveFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MoveFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/move" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 移动文件,将文件或者文件夹移动到用户云空间的其他位置。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/move ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/MoveFileSample.java ; + */ + public MoveFileResp move(MoveFileReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/files/:file_token/move" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + MoveFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MoveFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/move" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 订阅云文档事件,该接口仅支持**文档拥有者**订阅自己文档的通知事件,可订阅的文档类型为**旧版文档**、**新版文档**、**电子表格**和**多维表格**。在调用该接口之前请确保正确[配置事件回调网址和订阅事件类型](https://open.feishu.cn/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM#2eb3504a)(暂不支持单独订阅文档维度的某类事件),事件类型参考[事件列表](https://open.feishu.cn/document/ukTMukTMukTM/uYDNxYjL2QTM24iN0EjN/event-list)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/subscribe ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/SubscribeFileSample.java ; + */ + public SubscribeFileResp subscribe(SubscribeFileReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/files/:file_token/subscribe" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + SubscribeFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscribeFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/subscribe" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 订阅云文档事件,该接口仅支持**文档拥有者**订阅自己文档的通知事件,可订阅的文档类型为**旧版文档**、**新版文档**、**电子表格**和**多维表格**。在调用该接口之前请确保正确[配置事件回调网址和订阅事件类型](https://open.feishu.cn/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM#2eb3504a)(暂不支持单独订阅文档维度的某类事件),事件类型参考[事件列表](https://open.feishu.cn/document/ukTMukTMukTM/uYDNxYjL2QTM24iN0EjN/event-list)。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/subscribe ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/SubscribeFileSample.java ; + */ + public SubscribeFileResp subscribe(SubscribeFileReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/files/:file_token/subscribe" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + SubscribeFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscribeFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/subscribe" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询异步任务状态,查询删除文件夹等异步任务的状态信息。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/task_check ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/TaskCheckFileSample.java ; + */ + public TaskCheckFileResp taskCheck(TaskCheckFileReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/files/task_check" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + TaskCheckFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TaskCheckFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/task_check" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询异步任务状态,查询删除文件夹等异步任务的状态信息。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/task_check ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/TaskCheckFileSample.java ; + */ + public TaskCheckFileResp taskCheck(TaskCheckFileReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/files/task_check" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + TaskCheckFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TaskCheckFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/task_check" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 上传文件,向云空间指定目录下上传一个小文件。 + *

请不要使用这个接口上传大于20MB的文件,如果有这个需求可以尝试使用[分片上传接口](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/multipart-upload-file-/introduction)。 ; + *

该接口支持调用频率上限为5QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_all ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadAllFileSample.java ; + */ + public UploadAllFileResp uploadAll(UploadAllFileReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/files/upload_all" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UploadAllFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadAllFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/upload_all" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 上传文件,向云空间指定目录下上传一个小文件。 + *

请不要使用这个接口上传大于20MB的文件,如果有这个需求可以尝试使用[分片上传接口](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/multipart-upload-file-/introduction)。 ; + *

该接口支持调用频率上限为5QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_all ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadAllFileSample.java ; + */ + public UploadAllFileResp uploadAll(UploadAllFileReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/files/upload_all" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UploadAllFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadAllFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/upload_all" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 分片上传文件(完成上传),触发完成上传。 + *

该接口不支持太高的并发,且调用频率上限为5QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_finish ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadFinishFileSample.java ; + */ + public UploadFinishFileResp uploadFinish(UploadFinishFileReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/files/upload_finish" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UploadFinishFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadFinishFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/upload_finish" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 分片上传文件(完成上传),触发完成上传。 + *

该接口不支持太高的并发,且调用频率上限为5QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_finish ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadFinishFileSample.java ; + */ + public UploadFinishFileResp uploadFinish(UploadFinishFileReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/files/upload_finish" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UploadFinishFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadFinishFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/upload_finish" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 分片上传文件(上传分片),上传对应的文件块。 + *

该接口不支持太高的并发,且调用频率上限为5QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_part ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPartFileSample.java ; + */ + public UploadPartFileResp uploadPart(UploadPartFileReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/files/upload_part" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UploadPartFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadPartFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/upload_part" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 分片上传文件(上传分片),上传对应的文件块。 + *

该接口不支持太高的并发,且调用频率上限为5QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_part ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPartFileSample.java ; + */ + public UploadPartFileResp uploadPart(UploadPartFileReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/files/upload_part" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UploadPartFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadPartFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/upload_part" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 分片上传文件(预上传),发送初始化请求获取上传事务ID和分块策略,目前是以4MB大小进行定长分片。 + *

你在24小时内可保存上传事务ID和上传进度,以便可以恢复上传 ; + *

该接口不支持太高的并发,且调用频率上限为5QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_prepare ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPrepareFileSample.java ; + */ + public UploadPrepareFileResp uploadPrepare(UploadPrepareFileReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/files/upload_prepare" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UploadPrepareFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadPrepareFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/upload_prepare" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 分片上传文件(预上传),发送初始化请求获取上传事务ID和分块策略,目前是以4MB大小进行定长分片。 + *

你在24小时内可保存上传事务ID和上传进度,以便可以恢复上传 ; + *

该接口不支持太高的并发,且调用频率上限为5QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_prepare ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPrepareFileSample.java ; + */ + public UploadPrepareFileResp uploadPrepare(UploadPrepareFileReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/files/upload_prepare" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UploadPrepareFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadPrepareFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/upload_prepare" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/FileComment.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/FileComment.java new file mode 100644 index 000000000..d62f46636 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/FileComment.java @@ -0,0 +1,368 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.drive.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class FileComment { + private static final Logger log = LoggerFactory.getLogger(FileComment.class); + private final Config config; + + public FileComment(Config config) { + this.config = config; + } + + + /** + * 批量获取评论,该接口用于根据评论 ID 列表批量获取评论。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/batch_query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/BatchQueryFileCommentSample.java ; + */ + public BatchQueryFileCommentResp batchQuery(BatchQueryFileCommentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/files/:file_token/comments/batch_query" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + BatchQueryFileCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchQueryFileCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments/batch_query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量获取评论,该接口用于根据评论 ID 列表批量获取评论。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/batch_query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/BatchQueryFileCommentSample.java ; + */ + public BatchQueryFileCommentResp batchQuery(BatchQueryFileCommentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/files/:file_token/comments/batch_query" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + BatchQueryFileCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchQueryFileCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments/batch_query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 添加评论,往云文档添加一条全局评论。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFileCommentSample.java ; + */ + public CreateFileCommentResp create(CreateFileCommentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/files/:file_token/comments" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateFileCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFileCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 添加评论,往云文档添加一条全局评论。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFileCommentSample.java ; + */ + public CreateFileCommentResp create(CreateFileCommentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/files/:file_token/comments" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateFileCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFileCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取评论,获取云文档中的某条评论。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileCommentSample.java ; + */ + public GetFileCommentResp get(GetFileCommentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/files/:file_token/comments/:comment_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetFileCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFileCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments/:comment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取评论,获取云文档中的某条评论。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileCommentSample.java ; + */ + public GetFileCommentResp get(GetFileCommentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/files/:file_token/comments/:comment_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetFileCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFileCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments/:comment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 分页获取文档评论,该接口用于根据文档 token 分页获取文档评论。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileCommentSample.java ; + */ + public ListFileCommentResp list(ListFileCommentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/files/:file_token/comments" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListFileCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFileCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 分页获取文档评论,该接口用于根据文档 token 分页获取文档评论。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileCommentSample.java ; + */ + public ListFileCommentResp list(ListFileCommentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/files/:file_token/comments" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListFileCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFileCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 解决/恢复 评论,解决或恢复云文档中的评论。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/PatchFileCommentSample.java ; + */ + public PatchFileCommentResp patch(PatchFileCommentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/drive/v1/files/:file_token/comments/:comment_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchFileCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchFileCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments/:comment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 解决/恢复 评论,解决或恢复云文档中的评论。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/PatchFileCommentSample.java ; + */ + public PatchFileCommentResp patch(PatchFileCommentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/drive/v1/files/:file_token/comments/:comment_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchFileCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchFileCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments/:comment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/FileCommentReply.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/FileCommentReply.java new file mode 100644 index 000000000..08e3b55bc --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/FileCommentReply.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.drive.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class FileCommentReply { + private static final Logger log = LoggerFactory.getLogger(FileCommentReply.class); + private final Config config; + + public FileCommentReply(Config config) { + this.config = config; + } + + + /** + * 删除回复,删除云文档中的某条回复。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment-reply/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteFileCommentReplySample.java ; + */ + public DeleteFileCommentReplyResp delete(DeleteFileCommentReplyReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteFileCommentReplyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteFileCommentReplyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除回复,删除云文档中的某条回复。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment-reply/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteFileCommentReplySample.java ; + */ + public DeleteFileCommentReplyResp delete(DeleteFileCommentReplyReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteFileCommentReplyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteFileCommentReplyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取回复,该接口用于根据评论 ID 以及分页参数,获取回复。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment-reply/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileCommentReplySample.java ; + */ + public ListFileCommentReplyResp list(ListFileCommentReplyReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListFileCommentReplyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFileCommentReplyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取回复,该接口用于根据评论 ID 以及分页参数,获取回复。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment-reply/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileCommentReplySample.java ; + */ + public ListFileCommentReplyResp list(ListFileCommentReplyReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListFileCommentReplyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFileCommentReplyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新回复,更新云文档中的某条回复。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment-reply/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UpdateFileCommentReplySample.java ; + */ + public UpdateFileCommentReplyResp update(UpdateFileCommentReplyReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateFileCommentReplyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateFileCommentReplyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新回复,更新云文档中的某条回复。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment-reply/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UpdateFileCommentReplySample.java ; + */ + public UpdateFileCommentReplyResp update(UpdateFileCommentReplyReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateFileCommentReplyResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateFileCommentReplyResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/FileStatistics.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/FileStatistics.java new file mode 100644 index 000000000..a7df68098 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/FileStatistics.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.drive.v1.model.GetFileStatisticsReq; +import com.lark.oapi.service.drive.v1.model.GetFileStatisticsResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class FileStatistics { + private static final Logger log = LoggerFactory.getLogger(FileStatistics.class); + private final Config config; + + public FileStatistics(Config config) { + this.config = config; + } + + + /** + * 获取文件统计信息,此接口用于获取文件统计信息,包括文档阅读人数、次数和点赞数。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-statistics/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileStatisticsSample.java ; + */ + public GetFileStatisticsResp get(GetFileStatisticsReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/files/:file_token/statistics" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetFileStatisticsResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFileStatisticsResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/statistics" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取文件统计信息,此接口用于获取文件统计信息,包括文档阅读人数、次数和点赞数。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-statistics/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileStatisticsSample.java ; + */ + public GetFileStatisticsResp get(GetFileStatisticsReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/files/:file_token/statistics" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetFileStatisticsResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFileStatisticsResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/statistics" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/FileSubscription.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/FileSubscription.java new file mode 100644 index 000000000..70efbf930 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/FileSubscription.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.drive.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class FileSubscription { + private static final Logger log = LoggerFactory.getLogger(FileSubscription.class); + private final Config config; + + public FileSubscription(Config config) { + this.config = config; + } + + + /** + * 创建订阅,订阅文档中的变更事件,当前支持文档评论订阅,订阅后文档评论更新会有“云文档助手”推送给订阅的用户 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-subscription/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFileSubscriptionSample.java ; + */ + public CreateFileSubscriptionResp create(CreateFileSubscriptionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/files/:file_token/subscriptions" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + CreateFileSubscriptionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFileSubscriptionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/subscriptions" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建订阅,订阅文档中的变更事件,当前支持文档评论订阅,订阅后文档评论更新会有“云文档助手”推送给订阅的用户 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-subscription/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFileSubscriptionSample.java ; + */ + public CreateFileSubscriptionResp create(CreateFileSubscriptionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/files/:file_token/subscriptions" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + CreateFileSubscriptionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFileSubscriptionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/subscriptions" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取订阅状态,根据订阅ID获取该订阅的状态 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-subscription/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileSubscriptionSample.java ; + */ + public GetFileSubscriptionResp get(GetFileSubscriptionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + GetFileSubscriptionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFileSubscriptionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取订阅状态,根据订阅ID获取该订阅的状态 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-subscription/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileSubscriptionSample.java ; + */ + public GetFileSubscriptionResp get(GetFileSubscriptionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + GetFileSubscriptionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFileSubscriptionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新订阅状态,根据订阅ID更新订阅状态 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-subscription/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/PatchFileSubscriptionSample.java ; + */ + public PatchFileSubscriptionResp patch(PatchFileSubscriptionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + PatchFileSubscriptionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchFileSubscriptionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新订阅状态,根据订阅ID更新订阅状态 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-subscription/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/PatchFileSubscriptionSample.java ; + */ + public PatchFileSubscriptionResp patch(PatchFileSubscriptionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + PatchFileSubscriptionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchFileSubscriptionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/FileVersion.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/FileVersion.java new file mode 100644 index 000000000..357ff1bd9 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/FileVersion.java @@ -0,0 +1,302 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.drive.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class FileVersion { + private static final Logger log = LoggerFactory.getLogger(FileVersion.class); + private final Config config; + + public FileVersion(Config config) { + this.config = config; + } + + + /** + * 创建文档版本,创建文档版本。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFileVersionSample.java ; + */ + public CreateFileVersionResp create(CreateFileVersionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/files/:file_token/versions" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateFileVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFileVersionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/versions" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建文档版本,创建文档版本。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFileVersionSample.java ; + */ + public CreateFileVersionResp create(CreateFileVersionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/files/:file_token/versions" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateFileVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFileVersionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/versions" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除文档版本,删除文档版本。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteFileVersionSample.java ; + */ + public DeleteFileVersionResp delete(DeleteFileVersionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/drive/v1/files/:file_token/versions/:version_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteFileVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteFileVersionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/versions/:version_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除文档版本,删除文档版本。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteFileVersionSample.java ; + */ + public DeleteFileVersionResp delete(DeleteFileVersionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/drive/v1/files/:file_token/versions/:version_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteFileVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteFileVersionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/versions/:version_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取文档版本,获取文档版本。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileVersionSample.java ; + */ + public GetFileVersionResp get(GetFileVersionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/files/:file_token/versions/:version_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetFileVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFileVersionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/versions/:version_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取文档版本,获取文档版本。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileVersionSample.java ; + */ + public GetFileVersionResp get(GetFileVersionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/files/:file_token/versions/:version_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetFileVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFileVersionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/versions/:version_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取文档版本列表,获取文档所有版本。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileVersionSample.java ; + */ + public ListFileVersionResp list(ListFileVersionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/files/:file_token/versions" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListFileVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFileVersionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/versions" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取文档版本列表,获取文档所有版本。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileVersionSample.java ; + */ + public ListFileVersionResp list(ListFileVersionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/files/:file_token/versions" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListFileVersionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFileVersionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/versions" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/FileViewRecord.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/FileViewRecord.java new file mode 100644 index 000000000..a06f299e5 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/FileViewRecord.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.drive.v1.model.ListFileViewRecordReq; +import com.lark.oapi.service.drive.v1.model.ListFileViewRecordResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class FileViewRecord { + private static final Logger log = LoggerFactory.getLogger(FileViewRecord.class); + private final Config config; + + public FileViewRecord(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=drive&resource=file.view_record&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileViewRecordSample.java ; + */ + public ListFileViewRecordResp list(ListFileViewRecordReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/files/:file_token/view_records" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListFileViewRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFileViewRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/view_records" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=drive&resource=file.view_record&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileViewRecordSample.java ; + */ + public ListFileViewRecordResp list(ListFileViewRecordReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/files/:file_token/view_records" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListFileViewRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFileViewRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/files/:file_token/view_records" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/ImportTask.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/ImportTask.java new file mode 100644 index 000000000..a7050308a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/ImportTask.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.drive.v1.model.CreateImportTaskReq; +import com.lark.oapi.service.drive.v1.model.CreateImportTaskResp; +import com.lark.oapi.service.drive.v1.model.GetImportTaskReq; +import com.lark.oapi.service.drive.v1.model.GetImportTaskResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ImportTask { + private static final Logger log = LoggerFactory.getLogger(ImportTask.class); + private final Config config; + + public ImportTask(Config config) { + this.config = config; + } + + + /** + * 创建导入任务,创建导入任务。支持导入为 doc、docx、sheet、bitable,参考[导入用户指南](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/import_task/import-user-guide) + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/import_task/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateImportTaskSample.java ; + */ + public CreateImportTaskResp create(CreateImportTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/import_tasks" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateImportTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateImportTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/import_tasks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建导入任务,创建导入任务。支持导入为 doc、docx、sheet、bitable,参考[导入用户指南](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/import_task/import-user-guide) + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/import_task/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateImportTaskSample.java ; + */ + public CreateImportTaskResp create(CreateImportTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/import_tasks" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateImportTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateImportTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/import_tasks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询导入结果,根据创建导入任务返回的 ticket 查询导入结果。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/import_task/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetImportTaskSample.java ; + */ + public GetImportTaskResp get(GetImportTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/import_tasks/:ticket" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetImportTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetImportTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/import_tasks/:ticket" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询导入结果,根据创建导入任务返回的 ticket 查询导入结果。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/import_task/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetImportTaskSample.java ; + */ + public GetImportTaskResp get(GetImportTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/import_tasks/:ticket" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetImportTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetImportTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/import_tasks/:ticket" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/Media.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/Media.java new file mode 100644 index 000000000..94a0f6e65 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/Media.java @@ -0,0 +1,476 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.drive.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.ByteArrayOutputStream; +import java.nio.charset.StandardCharsets; + +public class Media { + private static final Logger log = LoggerFactory.getLogger(Media.class); + private final Config config; + + public Media(Config config) { + this.config = config; + } + + + /** + * 获取素材临时下载链接,通过file_token获取素材临时下载链接,链接时效性是24小时,过期失效。 + *

该接口不支持太高的并发,且调用频率上限为5QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/batch_get_tmp_download_url ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/BatchGetTmpDownloadUrlMediaSample.java ; + */ + public BatchGetTmpDownloadUrlMediaResp batchGetTmpDownloadUrl(BatchGetTmpDownloadUrlMediaReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/medias/batch_get_tmp_download_url" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchGetTmpDownloadUrlMediaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetTmpDownloadUrlMediaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/medias/batch_get_tmp_download_url" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取素材临时下载链接,通过file_token获取素材临时下载链接,链接时效性是24小时,过期失效。 + *

该接口不支持太高的并发,且调用频率上限为5QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/batch_get_tmp_download_url ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/BatchGetTmpDownloadUrlMediaSample.java ; + */ + public BatchGetTmpDownloadUrlMediaResp batchGetTmpDownloadUrl(BatchGetTmpDownloadUrlMediaReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/medias/batch_get_tmp_download_url" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchGetTmpDownloadUrlMediaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetTmpDownloadUrlMediaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/medias/batch_get_tmp_download_url" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 下载素材,使用该接口可以下载素材。素材表示在各种创作容器里的文件,如Doc文档内的图片,文件均属于素材。支持range下载。 + *

该接口不支持太高的并发,且调用频率上限为5QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/download ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DownloadMediaSample.java ; + */ + public DownloadMediaResp download(DownloadMediaReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/medias/:file_token/download" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + if (httpResponse.getStatusCode() == 200) { + DownloadMediaResp resp = new DownloadMediaResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + DownloadMediaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadMediaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/medias/:file_token/download" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 下载素材,使用该接口可以下载素材。素材表示在各种创作容器里的文件,如Doc文档内的图片,文件均属于素材。支持range下载。 + *

该接口不支持太高的并发,且调用频率上限为5QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/download ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DownloadMediaSample.java ; + */ + public DownloadMediaResp download(DownloadMediaReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/medias/:file_token/download" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 下载请求,返回流 + if (httpResponse.getStatusCode() == 200) { + DownloadMediaResp resp = new DownloadMediaResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + DownloadMediaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadMediaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/medias/:file_token/download" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 上传素材,将文件、图片、视频等素材文件上传到指定云文档中。素材文件在云空间中不会显示,只会显示在对应云文档中。 + *

请不要使用这个接口上传大于20MB的文件,如果有这个需求可以尝试使用[分片上传接口](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/multipart-upload-media/introduction)。 ; + *

该接口支持调用频率上限为5QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_all ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadAllMediaSample.java ; + */ + public UploadAllMediaResp uploadAll(UploadAllMediaReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/medias/upload_all" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UploadAllMediaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadAllMediaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/medias/upload_all" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 上传素材,将文件、图片、视频等素材文件上传到指定云文档中。素材文件在云空间中不会显示,只会显示在对应云文档中。 + *

请不要使用这个接口上传大于20MB的文件,如果有这个需求可以尝试使用[分片上传接口](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/multipart-upload-media/introduction)。 ; + *

该接口支持调用频率上限为5QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_all ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadAllMediaSample.java ; + */ + public UploadAllMediaResp uploadAll(UploadAllMediaReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/medias/upload_all" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UploadAllMediaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadAllMediaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/medias/upload_all" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 分片上传素材(完成上传),触发完成上传。 + *

该接口不支持太高的并发,且调用频率上限为5QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_finish ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadFinishMediaSample.java ; + */ + public UploadFinishMediaResp uploadFinish(UploadFinishMediaReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/medias/upload_finish" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UploadFinishMediaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadFinishMediaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/medias/upload_finish" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 分片上传素材(完成上传),触发完成上传。 + *

该接口不支持太高的并发,且调用频率上限为5QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_finish ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadFinishMediaSample.java ; + */ + public UploadFinishMediaResp uploadFinish(UploadFinishMediaReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/medias/upload_finish" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UploadFinishMediaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadFinishMediaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/medias/upload_finish" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 分片上传素材(上传分片),上传对应的文件块。 + *

该接口不支持太高的并发,且调用频率上限为5QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_part ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPartMediaSample.java ; + */ + public UploadPartMediaResp uploadPart(UploadPartMediaReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/medias/upload_part" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UploadPartMediaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadPartMediaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/medias/upload_part" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 分片上传素材(上传分片),上传对应的文件块。 + *

该接口不支持太高的并发,且调用频率上限为5QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_part ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPartMediaSample.java ; + */ + public UploadPartMediaResp uploadPart(UploadPartMediaReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/medias/upload_part" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UploadPartMediaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadPartMediaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/medias/upload_part" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 分片上传素材(预上传),发送初始化请求获取上传事务ID和分块策略,目前是以4MB大小进行定长分片。 + *

您在24小时内可保存上传事务ID和上传进度,以便可以恢复上传 ; + *

该接口不支持太高的并发,且调用频率上限为5QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_prepare ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPrepareMediaSample.java ; + */ + public UploadPrepareMediaResp uploadPrepare(UploadPrepareMediaReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/medias/upload_prepare" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UploadPrepareMediaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadPrepareMediaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/medias/upload_prepare" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 分片上传素材(预上传),发送初始化请求获取上传事务ID和分块策略,目前是以4MB大小进行定长分片。 + *

您在24小时内可保存上传事务ID和上传进度,以便可以恢复上传 ; + *

该接口不支持太高的并发,且调用频率上限为5QPS ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_prepare ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPrepareMediaSample.java ; + */ + public UploadPrepareMediaResp uploadPrepare(UploadPrepareMediaReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/medias/upload_prepare" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UploadPrepareMediaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadPrepareMediaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/medias/upload_prepare" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/Meta.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/Meta.java new file mode 100644 index 000000000..72862ba3b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/Meta.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.drive.v1.model.BatchQueryMetaReq; +import com.lark.oapi.service.drive.v1.model.BatchQueryMetaResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Meta { + private static final Logger log = LoggerFactory.getLogger(Meta.class); + private final Config config; + + public Meta(Config config) { + this.config = config; + } + + + /** + * 获取文档元数据,该接口用于根据 token 获取各类文件的元数据 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/meta/batch_query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/BatchQueryMetaSample.java ; + */ + public BatchQueryMetaResp batchQuery(BatchQueryMetaReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/metas/batch_query" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + BatchQueryMetaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchQueryMetaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/metas/batch_query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取文档元数据,该接口用于根据 token 获取各类文件的元数据 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/meta/batch_query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/BatchQueryMetaSample.java ; + */ + public BatchQueryMetaResp batchQuery(BatchQueryMetaReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/metas/batch_query" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + BatchQueryMetaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchQueryMetaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/metas/batch_query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/PermissionMember.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/PermissionMember.java new file mode 100644 index 000000000..cb40e4630 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/PermissionMember.java @@ -0,0 +1,438 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.drive.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class PermissionMember { + private static final Logger log = LoggerFactory.getLogger(PermissionMember.class); + private final Config config; + + public PermissionMember(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=auth&project=drive&resource=permission.member&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/AuthPermissionMemberSample.java ; + */ + public AuthPermissionMemberResp auth(AuthPermissionMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/permissions/:token/members/auth" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + AuthPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AuthPermissionMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/members/auth" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=auth&project=drive&resource=permission.member&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/AuthPermissionMemberSample.java ; + */ + public AuthPermissionMemberResp auth(AuthPermissionMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/permissions/:token/members/auth" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + AuthPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AuthPermissionMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/members/auth" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 增加协作者权限,该接口用于根据 filetoken 给用户增加文档的权限。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreatePermissionMemberSample.java ; + */ + public CreatePermissionMemberResp create(CreatePermissionMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/permissions/:token/members" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreatePermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePermissionMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 增加协作者权限,该接口用于根据 filetoken 给用户增加文档的权限。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreatePermissionMemberSample.java ; + */ + public CreatePermissionMemberResp create(CreatePermissionMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/permissions/:token/members" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreatePermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePermissionMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 移除协作者权限,该接口用于根据 filetoken 移除文档协作者的权限。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeletePermissionMemberSample.java ; + */ + public DeletePermissionMemberResp delete(DeletePermissionMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/drive/v1/permissions/:token/members/:member_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeletePermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePermissionMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/members/:member_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 移除协作者权限,该接口用于根据 filetoken 移除文档协作者的权限。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeletePermissionMemberSample.java ; + */ + public DeletePermissionMemberResp delete(DeletePermissionMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/drive/v1/permissions/:token/members/:member_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeletePermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePermissionMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/members/:member_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取协作者列表,该接口用于根据 filetoken 查询协作者 + *

- 你能获取到协作者列表的前提是你对该文档有分享权限;- 目前仅支持人、群、组织架构三种类型的协作者 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListPermissionMemberSample.java ; + */ + public ListPermissionMemberResp list(ListPermissionMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/permissions/:token/members" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPermissionMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取协作者列表,该接口用于根据 filetoken 查询协作者 + *

- 你能获取到协作者列表的前提是你对该文档有分享权限;- 目前仅支持人、群、组织架构三种类型的协作者 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListPermissionMemberSample.java ; + */ + public ListPermissionMemberResp list(ListPermissionMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/permissions/:token/members" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPermissionMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=transfer_owner&project=drive&resource=permission.member&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/TransferOwnerPermissionMemberSample.java ; + */ + public TransferOwnerPermissionMemberResp transferOwner(TransferOwnerPermissionMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/permissions/:token/members/transfer_owner" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + TransferOwnerPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TransferOwnerPermissionMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/members/transfer_owner" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=transfer_owner&project=drive&resource=permission.member&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/TransferOwnerPermissionMemberSample.java ; + */ + public TransferOwnerPermissionMemberResp transferOwner(TransferOwnerPermissionMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/permissions/:token/members/transfer_owner" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + TransferOwnerPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TransferOwnerPermissionMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/members/transfer_owner" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新协作者权限,该接口用于根据 filetoken 更新文档协作者的权限。 + *

该接口要求文档协作者已存在,如还未对文档协作者授权请先调用[「增加权限」 ](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/create)接口进行授权。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UpdatePermissionMemberSample.java ; + */ + public UpdatePermissionMemberResp update(UpdatePermissionMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/drive/v1/permissions/:token/members/:member_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UpdatePermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdatePermissionMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/members/:member_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新协作者权限,该接口用于根据 filetoken 更新文档协作者的权限。 + *

该接口要求文档协作者已存在,如还未对文档协作者授权请先调用[「增加权限」 ](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/create)接口进行授权。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UpdatePermissionMemberSample.java ; + */ + public UpdatePermissionMemberResp update(UpdatePermissionMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/drive/v1/permissions/:token/members/:member_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UpdatePermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdatePermissionMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/members/:member_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/PermissionPublic.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/PermissionPublic.java new file mode 100644 index 000000000..c285e703c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/PermissionPublic.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.drive.v1.model.GetPermissionPublicReq; +import com.lark.oapi.service.drive.v1.model.GetPermissionPublicResp; +import com.lark.oapi.service.drive.v1.model.PatchPermissionPublicReq; +import com.lark.oapi.service.drive.v1.model.PatchPermissionPublicResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class PermissionPublic { + private static final Logger log = LoggerFactory.getLogger(PermissionPublic.class); + private final Config config; + + public PermissionPublic(Config config) { + this.config = config; + } + + + /** + * 获取云文档权限设置,该接口用于根据 filetoken 获取云文档的权限设置。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-public/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetPermissionPublicSample.java ; + */ + public GetPermissionPublicResp get(GetPermissionPublicReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/permissions/:token/public" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetPermissionPublicResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetPermissionPublicResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/public" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取云文档权限设置,该接口用于根据 filetoken 获取云文档的权限设置。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-public/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetPermissionPublicSample.java ; + */ + public GetPermissionPublicResp get(GetPermissionPublicReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v1/permissions/:token/public" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetPermissionPublicResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetPermissionPublicResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/public" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新云文档权限设置,该接口用于根据 filetoken 更新云文档的权限设置。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-public/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/PatchPermissionPublicSample.java ; + */ + public PatchPermissionPublicResp patch(PatchPermissionPublicReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/drive/v1/permissions/:token/public" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchPermissionPublicResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchPermissionPublicResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/public" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新云文档权限设置,该接口用于根据 filetoken 更新云文档的权限设置。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-public/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/PatchPermissionPublicSample.java ; + */ + public PatchPermissionPublicResp patch(PatchPermissionPublicReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/drive/v1/permissions/:token/public" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchPermissionPublicResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchPermissionPublicResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/public" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/PermissionPublicPassword.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/PermissionPublicPassword.java new file mode 100644 index 000000000..0d4db9afa --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v1/resource/PermissionPublicPassword.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.drive.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class PermissionPublicPassword { + private static final Logger log = LoggerFactory.getLogger(PermissionPublicPassword.class); + private final Config config; + + public PermissionPublicPassword(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=drive&resource=permission.public.password&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreatePermissionPublicPasswordSample.java ; + */ + public CreatePermissionPublicPasswordResp create(CreatePermissionPublicPasswordReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/permissions/:token/public/password" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreatePermissionPublicPasswordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePermissionPublicPasswordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/public/password" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=drive&resource=permission.public.password&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreatePermissionPublicPasswordSample.java ; + */ + public CreatePermissionPublicPasswordResp create(CreatePermissionPublicPasswordReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/drive/v1/permissions/:token/public/password" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreatePermissionPublicPasswordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePermissionPublicPasswordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/public/password" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=drive&resource=permission.public.password&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeletePermissionPublicPasswordSample.java ; + */ + public DeletePermissionPublicPasswordResp delete(DeletePermissionPublicPasswordReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/drive/v1/permissions/:token/public/password" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeletePermissionPublicPasswordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePermissionPublicPasswordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/public/password" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=drive&resource=permission.public.password&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeletePermissionPublicPasswordSample.java ; + */ + public DeletePermissionPublicPasswordResp delete(DeletePermissionPublicPasswordReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/drive/v1/permissions/:token/public/password" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeletePermissionPublicPasswordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePermissionPublicPasswordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/public/password" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=drive&resource=permission.public.password&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UpdatePermissionPublicPasswordSample.java ; + */ + public UpdatePermissionPublicPasswordResp update(UpdatePermissionPublicPasswordReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/drive/v1/permissions/:token/public/password" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UpdatePermissionPublicPasswordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdatePermissionPublicPasswordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/public/password" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=drive&resource=permission.public.password&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UpdatePermissionPublicPasswordSample.java ; + */ + public UpdatePermissionPublicPasswordResp update(UpdatePermissionPublicPasswordReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/drive/v1/permissions/:token/public/password" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UpdatePermissionPublicPasswordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdatePermissionPublicPasswordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v1/permissions/:token/public/password" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/V2.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/V2.java new file mode 100644 index 000000000..9609a2f33 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/V2.java @@ -0,0 +1,29 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.drive.v2.resource.PermissionPublic; + +public class V2 { + private final PermissionPublic permissionPublic; // permission.public + + public V2(Config config) { + this.permissionPublic = new PermissionPublic(config); + } + + public PermissionPublic permissionPublic() { + return permissionPublic; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/GetPermissionPublicTokenTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/GetPermissionPublicTokenTypeEnum.java new file mode 100644 index 000000000..95ab0dcdf --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/GetPermissionPublicTokenTypeEnum.java @@ -0,0 +1,39 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.enums; + +/** + * 文件类型,需要与文件的 token 相匹配 + */ +public enum GetPermissionPublicTokenTypeEnum { + DOC("doc"), // 旧版文档 + SHEET("sheet"), // 电子表格 + FILE("file"), // 云空间文件 + WIKI("wiki"), // 知识库节点 + BITABLE("bitable"), // 多维表格 + DOCX("docx"), // 新版文档 + MINDNOTE("mindnote"), // 思维笔记 + MINUTES("minutes"), // 妙记 + SLIDES("slides"), // 幻灯片 + ; + private String value; + + GetPermissionPublicTokenTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/MyLikeFileTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/MyLikeFileTypeEnum.java new file mode 100644 index 000000000..33a134a7e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/MyLikeFileTypeEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.enums; + +/** + * 点赞的文件类型 + */ +public enum MyLikeFileTypeEnum { + DOC("doc"), // 旧版文档 + DOCX("docx"), // 新版文档 + FILE("file"), // 文件 + ; + private String value; + + MyLikeFileTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicCommentEntityEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicCommentEntityEnum.java new file mode 100644 index 000000000..2807a9080 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicCommentEntityEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.enums; + +/** + * 谁可以评论 + */ +public enum PatchPermissionPublicCommentEntityEnum { + ANYONECANVIEW("anyone_can_view"), // 拥有可阅读权限的用户 + ANYONECANEDIT("anyone_can_edit"), // 拥有可编辑权限的用户 + ; + private String value; + + PatchPermissionPublicCommentEntityEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicCopyEntityEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicCopyEntityEnum.java new file mode 100644 index 000000000..386c8146f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicCopyEntityEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.enums; + +/** + * 谁可以复制内容 + */ +public enum PatchPermissionPublicCopyEntityEnum { + ANYONECANVIEW("anyone_can_view"), // 拥有可阅读权限的用户 + ANYONECANEDIT("anyone_can_edit"), // 拥有可编辑权限的用户 + ONLYFULLACCESS("only_full_access"), // 拥有可管理权限(包括我)的协作者 + ; + private String value; + + PatchPermissionPublicCopyEntityEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicExternalAccessEntityEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicExternalAccessEntityEnum.java new file mode 100644 index 000000000..27e191b30 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicExternalAccessEntityEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.enums; + +/** + * 允许内容被分享到组织外 + */ +public enum PatchPermissionPublicExternalAccessEntityEnum { + OPEN("open"), // 打开 + CLOSED("closed"), // 关闭 + ALLOWSHAREPARTNERTENANT("allow_share_partner_tenant"), // 允许分享给关联组织 + ; + private String value; + + PatchPermissionPublicExternalAccessEntityEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicLinkShareEntityEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicLinkShareEntityEnum.java new file mode 100644 index 000000000..64555c51a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicLinkShareEntityEnum.java @@ -0,0 +1,37 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.enums; + +/** + * 链接分享设置 + */ +public enum PatchPermissionPublicLinkShareEntityEnum { + TENANTREADABLE("tenant_readable"), // 组织内获得链接的人可阅读 + TENANTEDITABLE("tenant_editable"), // 组织内获得链接的人可编辑 + PARTNERTENANTREADABLE("partner_tenant_readable"), // 关联组织的人可阅读 + PARTNERTENANTEDITABLE("partner_tenant_editable"), // 关联组织的人可编辑 + ANYONEREADABLE("anyone_readable"), // 互联网上获得链接的任何人可阅读(仅external_access=“true”时有效) + ANYONEEDITABLE("anyone_editable"), // 互联网上获得链接的任何人可编辑(仅external_access=“true”时有效) + CLOSED("closed"), // 关闭链接分享 + ; + private String value; + + PatchPermissionPublicLinkShareEntityEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicManageCollaboratorEntityEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicManageCollaboratorEntityEnum.java new file mode 100644 index 000000000..75777ea85 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicManageCollaboratorEntityEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.enums; + +/** + * 谁可以添加和管理协作者-协作者维度 + */ +public enum PatchPermissionPublicManageCollaboratorEntityEnum { + COLLABORATORCANVIEW("collaborator_can_view"), // 拥有可阅读权限的协作者 + COLLABORATORCANEDIT("collaborator_can_edit"), // 拥有可编辑权限的协作者 + COLLABORATORFULLACCESS("collaborator_full_access"), // 拥有可管理权限(包括我)的协作者 + ; + private String value; + + PatchPermissionPublicManageCollaboratorEntityEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicSecurityEntityEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicSecurityEntityEnum.java new file mode 100644 index 000000000..c48af0146 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicSecurityEntityEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.enums; + +/** + * 谁可以创建副本、打印、下载 + */ +public enum PatchPermissionPublicSecurityEntityEnum { + ANYONECANVIEW("anyone_can_view"), // 拥有可阅读权限的用户 + ANYONECANEDIT("anyone_can_edit"), // 拥有可编辑权限的用户 + ONLYFULLACCESS("only_full_access"), // 拥有可管理权限(包括我)的用户 + ; + private String value; + + PatchPermissionPublicSecurityEntityEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicShareEntityEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicShareEntityEnum.java new file mode 100644 index 000000000..665f75f1d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicShareEntityEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.enums; + +/** + * 谁可以添加和管理协作者-组织维度 + */ +public enum PatchPermissionPublicShareEntityEnum { + ANYONE("anyone"), // 所有可阅读或编辑此文档的用户 + SAMETENANT("same_tenant"), // 组织内所有可阅读或编辑此文档的用户 + ; + private String value; + + PatchPermissionPublicShareEntityEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicTokenTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicTokenTypeEnum.java new file mode 100644 index 000000000..32015e02e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PatchPermissionPublicTokenTypeEnum.java @@ -0,0 +1,39 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.enums; + +/** + * 文件类型,需要与文件的 token 相匹配 + */ +public enum PatchPermissionPublicTokenTypeEnum { + DOC("doc"), // 旧版文档 + SHEET("sheet"), // 电子表格 + FILE("file"), // 云空间文件 + WIKI("wiki"), // 知识库节点 + BITABLE("bitable"), // 多维表格 + DOCX("docx"), // 新版文档 + MINDNOTE("mindnote"), // 思维笔记 + MINUTES("minutes"), // 妙记 + SLIDES("slides"), // 幻灯片 + ; + private String value; + + PatchPermissionPublicTokenTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicCommentEntityEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicCommentEntityEnum.java new file mode 100644 index 000000000..068ef2865 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicCommentEntityEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.enums; + +/** + * 谁可以评论 + */ +public enum PermissionPublicCommentEntityEnum { + ANYONECANVIEW("anyone_can_view"), // 拥有可阅读权限的用户 + ANYONECANEDIT("anyone_can_edit"), // 拥有可编辑权限的用户 + ; + private String value; + + PermissionPublicCommentEntityEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicCopyEntityEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicCopyEntityEnum.java new file mode 100644 index 000000000..84d636273 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicCopyEntityEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.enums; + +/** + * 谁可以复制内容 + */ +public enum PermissionPublicCopyEntityEnum { + ANYONECANVIEW("anyone_can_view"), // 拥有可阅读权限的用户 + ANYONECANEDIT("anyone_can_edit"), // 拥有可编辑权限的用户 + ONLYFULLACCESS("only_full_access"), // 拥有可管理权限(包括我)的协作者 + ; + private String value; + + PermissionPublicCopyEntityEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicExternalAccessEntityEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicExternalAccessEntityEnum.java new file mode 100644 index 000000000..8a3dd4002 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicExternalAccessEntityEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.enums; + +/** + * 允许内容被分享到组织外 + */ +public enum PermissionPublicExternalAccessEntityEnum { + OPEN("open"), // 打开 + CLOSED("closed"), // 关闭 + ALLOWSHAREPARTNERTENANT("allow_share_partner_tenant"), // 允许分享给关联组织 + ; + private String value; + + PermissionPublicExternalAccessEntityEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicLinkShareEntityEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicLinkShareEntityEnum.java new file mode 100644 index 000000000..ee461c51a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicLinkShareEntityEnum.java @@ -0,0 +1,37 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.enums; + +/** + * 链接分享设置 + */ +public enum PermissionPublicLinkShareEntityEnum { + TENANTREADABLE("tenant_readable"), // 组织内获得链接的人可阅读 + TENANTEDITABLE("tenant_editable"), // 组织内获得链接的人可编辑 + PARTNERTENANTREADABLE("partner_tenant_readable"), // 关联组织的人可阅读 + PARTNERTENANTEDITABLE("partner_tenant_editable"), // 关联组织的人可编辑 + ANYONEREADABLE("anyone_readable"), // 互联网上获得链接的任何人可阅读(仅external_access=“true”时有效) + ANYONEEDITABLE("anyone_editable"), // 互联网上获得链接的任何人可编辑(仅external_access=“true”时有效) + CLOSED("closed"), // 关闭链接分享 + ; + private String value; + + PermissionPublicLinkShareEntityEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicManageCollaboratorEntityEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicManageCollaboratorEntityEnum.java new file mode 100644 index 000000000..abc2be194 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicManageCollaboratorEntityEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.enums; + +/** + * 谁可以添加和管理协作者-协作者维度 + */ +public enum PermissionPublicManageCollaboratorEntityEnum { + COLLABORATORCANVIEW("collaborator_can_view"), // 拥有可阅读权限的协作者 + COLLABORATORCANEDIT("collaborator_can_edit"), // 拥有可编辑权限的协作者 + COLLABORATORFULLACCESS("collaborator_full_access"), // 拥有可管理权限(包括我)的协作者 + ; + private String value; + + PermissionPublicManageCollaboratorEntityEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicSecurityEntityEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicSecurityEntityEnum.java new file mode 100644 index 000000000..040d32a79 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicSecurityEntityEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.enums; + +/** + * 谁可以创建副本、打印、下载 + */ +public enum PermissionPublicSecurityEntityEnum { + ANYONECANVIEW("anyone_can_view"), // 拥有可阅读权限的用户 + ANYONECANEDIT("anyone_can_edit"), // 拥有可编辑权限的用户 + ONLYFULLACCESS("only_full_access"), // 拥有可管理权限(包括我)的用户 + ; + private String value; + + PermissionPublicSecurityEntityEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicShareEntityEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicShareEntityEnum.java new file mode 100644 index 000000000..27f4ce2cc --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/enums/PermissionPublicShareEntityEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.enums; + +/** + * 谁可以添加和管理协作者-组织维度 + */ +public enum PermissionPublicShareEntityEnum { + ANYONE("anyone"), // 所有可阅读或编辑此文档的用户 + SAMETENANT("same_tenant"), // 组织内所有可阅读或编辑此文档的用户 + ; + private String value; + + PermissionPublicShareEntityEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/DepartmentId.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/DepartmentId.java new file mode 100644 index 000000000..42480ad8f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/DepartmentId.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class DepartmentId { + /** + *

示例值: + */ + @SerializedName("department_id") + private String departmentId; + /** + *

示例值: + */ + @SerializedName("open_department_id") + private String openDepartmentId; + + // builder 开始 + public DepartmentId() { + } + + public DepartmentId(Builder builder) { + /** + * + *

示例值: + */ + this.departmentId = builder.departmentId; + /** + * + *

示例值: + */ + this.openDepartmentId = builder.openDepartmentId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getDepartmentId() { + return this.departmentId; + } + + public void setDepartmentId(String departmentId) { + this.departmentId = departmentId; + } + + public String getOpenDepartmentId() { + return this.openDepartmentId; + } + + public void setOpenDepartmentId(String openDepartmentId) { + this.openDepartmentId = openDepartmentId; + } + + public static class Builder { + /** + *

示例值: + */ + private String departmentId; + /** + *

示例值: + */ + private String openDepartmentId; + + /** + *

示例值: + * + * @param departmentId + * @return + */ + public Builder departmentId(String departmentId) { + this.departmentId = departmentId; + return this; + } + + + /** + *

示例值: + * + * @param openDepartmentId + * @return + */ + public Builder openDepartmentId(String openDepartmentId) { + this.openDepartmentId = openDepartmentId; + return this; + } + + + public DepartmentId build() { + return new DepartmentId(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/FileLike.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/FileLike.java new file mode 100644 index 000000000..f495171c6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/FileLike.java @@ -0,0 +1,259 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class FileLike { + /** + * 用户 ID + *

示例值:ou_3bbe8a09c20e89cce9bff989ed840674 + */ + @SerializedName("user_id") + private String userId; + /** + * 用户最后点赞时间,秒级时间戳 + *

示例值:1690857821 + */ + @SerializedName("last_liked_time") + private String lastLikedTime; + /** + * 用户名字,用户信息被脱敏时此值不会返回 + *

示例值:张三 + */ + @SerializedName("user_name") + private String userName; + /** + * 用户英文名字,用户信息被脱敏时此值不会返回 + *

示例值:San Zhang + */ + @SerializedName("user_en_name") + private String userEnName; + /** + * 用户头像,用户信息被脱敏时此值不会返回 + *

示例值:https://foo.icon.com/xxxx + */ + @SerializedName("user_avatar_url") + private String userAvatarUrl; + /** + * 用户信息是否脱敏 + *

示例值:false + */ + @SerializedName("user_is_desensitized") + private Boolean userIsDesensitized; + + // builder 开始 + public FileLike() { + } + + public FileLike(Builder builder) { + /** + * 用户 ID + *

示例值:ou_3bbe8a09c20e89cce9bff989ed840674 + */ + this.userId = builder.userId; + /** + * 用户最后点赞时间,秒级时间戳 + *

示例值:1690857821 + */ + this.lastLikedTime = builder.lastLikedTime; + /** + * 用户名字,用户信息被脱敏时此值不会返回 + *

示例值:张三 + */ + this.userName = builder.userName; + /** + * 用户英文名字,用户信息被脱敏时此值不会返回 + *

示例值:San Zhang + */ + this.userEnName = builder.userEnName; + /** + * 用户头像,用户信息被脱敏时此值不会返回 + *

示例值:https://foo.icon.com/xxxx + */ + this.userAvatarUrl = builder.userAvatarUrl; + /** + * 用户信息是否脱敏 + *

示例值:false + */ + this.userIsDesensitized = builder.userIsDesensitized; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserId() { + return this.userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getLastLikedTime() { + return this.lastLikedTime; + } + + public void setLastLikedTime(String lastLikedTime) { + this.lastLikedTime = lastLikedTime; + } + + public String getUserName() { + return this.userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getUserEnName() { + return this.userEnName; + } + + public void setUserEnName(String userEnName) { + this.userEnName = userEnName; + } + + public String getUserAvatarUrl() { + return this.userAvatarUrl; + } + + public void setUserAvatarUrl(String userAvatarUrl) { + this.userAvatarUrl = userAvatarUrl; + } + + public Boolean getUserIsDesensitized() { + return this.userIsDesensitized; + } + + public void setUserIsDesensitized(Boolean userIsDesensitized) { + this.userIsDesensitized = userIsDesensitized; + } + + public static class Builder { + /** + * 用户 ID + *

示例值:ou_3bbe8a09c20e89cce9bff989ed840674 + */ + private String userId; + /** + * 用户最后点赞时间,秒级时间戳 + *

示例值:1690857821 + */ + private String lastLikedTime; + /** + * 用户名字,用户信息被脱敏时此值不会返回 + *

示例值:张三 + */ + private String userName; + /** + * 用户英文名字,用户信息被脱敏时此值不会返回 + *

示例值:San Zhang + */ + private String userEnName; + /** + * 用户头像,用户信息被脱敏时此值不会返回 + *

示例值:https://foo.icon.com/xxxx + */ + private String userAvatarUrl; + /** + * 用户信息是否脱敏 + *

示例值:false + */ + private Boolean userIsDesensitized; + + /** + * 用户 ID + *

示例值:ou_3bbe8a09c20e89cce9bff989ed840674 + * + * @param userId + * @return + */ + public Builder userId(String userId) { + this.userId = userId; + return this; + } + + + /** + * 用户最后点赞时间,秒级时间戳 + *

示例值:1690857821 + * + * @param lastLikedTime + * @return + */ + public Builder lastLikedTime(String lastLikedTime) { + this.lastLikedTime = lastLikedTime; + return this; + } + + + /** + * 用户名字,用户信息被脱敏时此值不会返回 + *

示例值:张三 + * + * @param userName + * @return + */ + public Builder userName(String userName) { + this.userName = userName; + return this; + } + + + /** + * 用户英文名字,用户信息被脱敏时此值不会返回 + *

示例值:San Zhang + * + * @param userEnName + * @return + */ + public Builder userEnName(String userEnName) { + this.userEnName = userEnName; + return this; + } + + + /** + * 用户头像,用户信息被脱敏时此值不会返回 + *

示例值:https://foo.icon.com/xxxx + * + * @param userAvatarUrl + * @return + */ + public Builder userAvatarUrl(String userAvatarUrl) { + this.userAvatarUrl = userAvatarUrl; + return this; + } + + + /** + * 用户信息是否脱敏 + *

示例值:false + * + * @param userIsDesensitized + * @return + */ + public Builder userIsDesensitized(Boolean userIsDesensitized) { + this.userIsDesensitized = userIsDesensitized; + return this; + } + + + public FileLike build() { + return new FileLike(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/GetPermissionPublicReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/GetPermissionPublicReq.java new file mode 100644 index 000000000..250882e3b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/GetPermissionPublicReq.java @@ -0,0 +1,117 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class GetPermissionPublicReq { + /** + * 文件类型,需要与文件的 token 相匹配 + *

示例值:doc + */ + @Query + @SerializedName("type") + private String type; + /** + * 文件的 token + *

示例值:doccnBKgoMyY5OMbUG6FioTXuBe + */ + @Path + @SerializedName("token") + private String token; + + // builder 开始 + public GetPermissionPublicReq() { + } + + public GetPermissionPublicReq(Builder builder) { + /** + * 文件类型,需要与文件的 token 相匹配 + *

示例值:doc + */ + this.type = builder.type; + /** + * 文件的 token + *

示例值:doccnBKgoMyY5OMbUG6FioTXuBe + */ + this.token = builder.token; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getToken() { + return this.token; + } + + public void setToken(String token) { + this.token = token; + } + + public static class Builder { + private String type; // 文件类型,需要与文件的 token 相匹配 + private String token; // 文件的 token + + /** + * 文件类型,需要与文件的 token 相匹配 + *

示例值:doc + * + * @param type + * @return + */ + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * 文件类型,需要与文件的 token 相匹配 + *

示例值:doc + * + * @param type {@link com.lark.oapi.service.drive.v2.enums.GetPermissionPublicTokenTypeEnum} + * @return + */ + public Builder type(com.lark.oapi.service.drive.v2.enums.GetPermissionPublicTokenTypeEnum type) { + this.type = type.getValue(); + return this; + } + + /** + * 文件的 token + *

示例值:doccnBKgoMyY5OMbUG6FioTXuBe + * + * @param token + * @return + */ + public Builder token(String token) { + this.token = token; + return this; + } + + public GetPermissionPublicReq build() { + return new GetPermissionPublicReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/GetPermissionPublicResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/GetPermissionPublicResp.java new file mode 100644 index 000000000..bcfd18d35 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/GetPermissionPublicResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class GetPermissionPublicResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/GetPermissionPublicRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/GetPermissionPublicRespBody.java new file mode 100644 index 000000000..fa1f0a57f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/GetPermissionPublicRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class GetPermissionPublicRespBody { + /** + * 返回的文档公共设置 + *

示例值: + */ + @SerializedName("permission_public") + private PermissionPublic permissionPublic; + + public PermissionPublic getPermissionPublic() { + return this.permissionPublic; + } + + public void setPermissionPublic(PermissionPublic permissionPublic) { + this.permissionPublic = permissionPublic; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/MyLike.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/MyLike.java new file mode 100644 index 000000000..5ec788a3e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/MyLike.java @@ -0,0 +1,271 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class MyLike { + /** + * 用户最后点赞时间,秒级时间戳 + *

示例值:1690857821 + */ + @SerializedName("last_liked_time") + private String lastLikedTime; + /** + * 点赞的文件 token + *

示例值:J6Lddz22AovnqkxWEXBcUJIingx + */ + @SerializedName("file_token") + private String fileToken; + /** + * 点赞的文件类型 + *

示例值:doc + */ + @SerializedName("file_type") + private String fileType; + /** + * 点赞的文件名,无文件阅读权限时不返回此字段 + *

示例值:title + */ + @SerializedName("file_name") + private String fileName; + /** + * 点赞的文件链接,无文件阅读权限时不返回此字段 + *

示例值:https://sample.feishu.cn/docs/doccnfYZzTlvXqZIGTdAHKabcef + */ + @SerializedName("file_url") + private String fileUrl; + /** + * 点赞的文件是否已被删除 + *

示例值:false + */ + @SerializedName("file_is_deleted") + private Boolean fileIsDeleted; + + // builder 开始 + public MyLike() { + } + + public MyLike(Builder builder) { + /** + * 用户最后点赞时间,秒级时间戳 + *

示例值:1690857821 + */ + this.lastLikedTime = builder.lastLikedTime; + /** + * 点赞的文件 token + *

示例值:J6Lddz22AovnqkxWEXBcUJIingx + */ + this.fileToken = builder.fileToken; + /** + * 点赞的文件类型 + *

示例值:doc + */ + this.fileType = builder.fileType; + /** + * 点赞的文件名,无文件阅读权限时不返回此字段 + *

示例值:title + */ + this.fileName = builder.fileName; + /** + * 点赞的文件链接,无文件阅读权限时不返回此字段 + *

示例值:https://sample.feishu.cn/docs/doccnfYZzTlvXqZIGTdAHKabcef + */ + this.fileUrl = builder.fileUrl; + /** + * 点赞的文件是否已被删除 + *

示例值:false + */ + this.fileIsDeleted = builder.fileIsDeleted; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getLastLikedTime() { + return this.lastLikedTime; + } + + public void setLastLikedTime(String lastLikedTime) { + this.lastLikedTime = lastLikedTime; + } + + public String getFileToken() { + return this.fileToken; + } + + public void setFileToken(String fileToken) { + this.fileToken = fileToken; + } + + public String getFileType() { + return this.fileType; + } + + public void setFileType(String fileType) { + this.fileType = fileType; + } + + public String getFileName() { + return this.fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public String getFileUrl() { + return this.fileUrl; + } + + public void setFileUrl(String fileUrl) { + this.fileUrl = fileUrl; + } + + public Boolean getFileIsDeleted() { + return this.fileIsDeleted; + } + + public void setFileIsDeleted(Boolean fileIsDeleted) { + this.fileIsDeleted = fileIsDeleted; + } + + public static class Builder { + /** + * 用户最后点赞时间,秒级时间戳 + *

示例值:1690857821 + */ + private String lastLikedTime; + /** + * 点赞的文件 token + *

示例值:J6Lddz22AovnqkxWEXBcUJIingx + */ + private String fileToken; + /** + * 点赞的文件类型 + *

示例值:doc + */ + private String fileType; + /** + * 点赞的文件名,无文件阅读权限时不返回此字段 + *

示例值:title + */ + private String fileName; + /** + * 点赞的文件链接,无文件阅读权限时不返回此字段 + *

示例值:https://sample.feishu.cn/docs/doccnfYZzTlvXqZIGTdAHKabcef + */ + private String fileUrl; + /** + * 点赞的文件是否已被删除 + *

示例值:false + */ + private Boolean fileIsDeleted; + + /** + * 用户最后点赞时间,秒级时间戳 + *

示例值:1690857821 + * + * @param lastLikedTime + * @return + */ + public Builder lastLikedTime(String lastLikedTime) { + this.lastLikedTime = lastLikedTime; + return this; + } + + + /** + * 点赞的文件 token + *

示例值:J6Lddz22AovnqkxWEXBcUJIingx + * + * @param fileToken + * @return + */ + public Builder fileToken(String fileToken) { + this.fileToken = fileToken; + return this; + } + + + /** + * 点赞的文件类型 + *

示例值:doc + * + * @param fileType + * @return + */ + public Builder fileType(String fileType) { + this.fileType = fileType; + return this; + } + + /** + * 点赞的文件类型 + *

示例值:doc + * + * @param fileType {@link com.lark.oapi.service.drive.v2.enums.MyLikeFileTypeEnum} + * @return + */ + public Builder fileType(com.lark.oapi.service.drive.v2.enums.MyLikeFileTypeEnum fileType) { + this.fileType = fileType.getValue(); + return this; + } + + + /** + * 点赞的文件名,无文件阅读权限时不返回此字段 + *

示例值:title + * + * @param fileName + * @return + */ + public Builder fileName(String fileName) { + this.fileName = fileName; + return this; + } + + + /** + * 点赞的文件链接,无文件阅读权限时不返回此字段 + *

示例值:https://sample.feishu.cn/docs/doccnfYZzTlvXqZIGTdAHKabcef + * + * @param fileUrl + * @return + */ + public Builder fileUrl(String fileUrl) { + this.fileUrl = fileUrl; + return this; + } + + + /** + * 点赞的文件是否已被删除 + *

示例值:false + * + * @param fileIsDeleted + * @return + */ + public Builder fileIsDeleted(Boolean fileIsDeleted) { + this.fileIsDeleted = fileIsDeleted; + return this; + } + + + public MyLike build() { + return new MyLike(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/PatchPermissionPublicReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/PatchPermissionPublicReq.java new file mode 100644 index 000000000..24e871dd1 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/PatchPermissionPublicReq.java @@ -0,0 +1,145 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class PatchPermissionPublicReq { + /** + * 文件类型,需要与文件的 token 相匹配 + *

示例值:doc + */ + @Query + @SerializedName("type") + private String type; + /** + * 文件的 token + *

示例值:doccnBKgoMyY5OMbUG6FioTXuBe + */ + @Path + @SerializedName("token") + private String token; + @Body + private PermissionPublic body; + + // builder 开始 + public PatchPermissionPublicReq() { + } + + public PatchPermissionPublicReq(Builder builder) { + /** + * 文件类型,需要与文件的 token 相匹配 + *

示例值:doc + */ + this.type = builder.type; + /** + * 文件的 token + *

示例值:doccnBKgoMyY5OMbUG6FioTXuBe + */ + this.token = builder.token; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getToken() { + return this.token; + } + + public void setToken(String token) { + this.token = token; + } + + public PermissionPublic getPermissionPublic() { + return this.body; + } + + public void setPermissionPublic(PermissionPublic body) { + this.body = body; + } + + public static class Builder { + private String type; // 文件类型,需要与文件的 token 相匹配 + private String token; // 文件的 token + private PermissionPublic body; + + /** + * 文件类型,需要与文件的 token 相匹配 + *

示例值:doc + * + * @param type + * @return + */ + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * 文件类型,需要与文件的 token 相匹配 + *

示例值:doc + * + * @param type {@link com.lark.oapi.service.drive.v2.enums.PatchPermissionPublicTokenTypeEnum} + * @return + */ + public Builder type(com.lark.oapi.service.drive.v2.enums.PatchPermissionPublicTokenTypeEnum type) { + this.type = type.getValue(); + return this; + } + + /** + * 文件的 token + *

示例值:doccnBKgoMyY5OMbUG6FioTXuBe + * + * @param token + * @return + */ + public Builder token(String token) { + this.token = token; + return this; + } + + public PermissionPublic getPermissionPublic() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder permissionPublic(PermissionPublic body) { + this.body = body; + return this; + } + + public PatchPermissionPublicReq build() { + return new PatchPermissionPublicReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/PatchPermissionPublicResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/PatchPermissionPublicResp.java new file mode 100644 index 000000000..93b357d5b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/PatchPermissionPublicResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class PatchPermissionPublicResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/PatchPermissionPublicRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/PatchPermissionPublicRespBody.java new file mode 100644 index 000000000..2046397a1 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/PatchPermissionPublicRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PatchPermissionPublicRespBody { + /** + * 本次更新后文档公共设置 + *

示例值: + */ + @SerializedName("permission_public") + private PermissionPublic permissionPublic; + + public PermissionPublic getPermissionPublic() { + return this.permissionPublic; + } + + public void setPermissionPublic(PermissionPublic permissionPublic) { + this.permissionPublic = permissionPublic; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/PermissionPublic.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/PermissionPublic.java new file mode 100644 index 000000000..893c92024 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/PermissionPublic.java @@ -0,0 +1,417 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PermissionPublic { + /** + * 允许内容被分享到组织外 + *

示例值:open + */ + @SerializedName("external_access_entity") + private String externalAccessEntity; + /** + * 谁可以创建副本、打印、下载 + *

示例值:anyone_can_view + */ + @SerializedName("security_entity") + private String securityEntity; + /** + * 谁可以评论 + *

示例值:anyone_can_view + */ + @SerializedName("comment_entity") + private String commentEntity; + /** + * 谁可以添加和管理协作者-组织维度 + *

示例值:anyone + */ + @SerializedName("share_entity") + private String shareEntity; + /** + * 谁可以添加和管理协作者-协作者维度 + *

示例值:collaborator_can_view + */ + @SerializedName("manage_collaborator_entity") + private String manageCollaboratorEntity; + /** + * 链接分享设置 + *

示例值:tenant_readable + */ + @SerializedName("link_share_entity") + private String linkShareEntity; + /** + * 谁可以复制内容 + *

示例值:anyone_can_view + */ + @SerializedName("copy_entity") + private String copyEntity; + /** + * 节点是否已加锁,加锁之后不再继承父级页面的权限 + *

示例值:false + */ + @SerializedName("lock_switch") + private Boolean lockSwitch; + + // builder 开始 + public PermissionPublic() { + } + + public PermissionPublic(Builder builder) { + /** + * 允许内容被分享到组织外 + *

示例值:open + */ + this.externalAccessEntity = builder.externalAccessEntity; + /** + * 谁可以创建副本、打印、下载 + *

示例值:anyone_can_view + */ + this.securityEntity = builder.securityEntity; + /** + * 谁可以评论 + *

示例值:anyone_can_view + */ + this.commentEntity = builder.commentEntity; + /** + * 谁可以添加和管理协作者-组织维度 + *

示例值:anyone + */ + this.shareEntity = builder.shareEntity; + /** + * 谁可以添加和管理协作者-协作者维度 + *

示例值:collaborator_can_view + */ + this.manageCollaboratorEntity = builder.manageCollaboratorEntity; + /** + * 链接分享设置 + *

示例值:tenant_readable + */ + this.linkShareEntity = builder.linkShareEntity; + /** + * 谁可以复制内容 + *

示例值:anyone_can_view + */ + this.copyEntity = builder.copyEntity; + /** + * 节点是否已加锁,加锁之后不再继承父级页面的权限 + *

示例值:false + */ + this.lockSwitch = builder.lockSwitch; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getExternalAccessEntity() { + return this.externalAccessEntity; + } + + public void setExternalAccessEntity(String externalAccessEntity) { + this.externalAccessEntity = externalAccessEntity; + } + + public String getSecurityEntity() { + return this.securityEntity; + } + + public void setSecurityEntity(String securityEntity) { + this.securityEntity = securityEntity; + } + + public String getCommentEntity() { + return this.commentEntity; + } + + public void setCommentEntity(String commentEntity) { + this.commentEntity = commentEntity; + } + + public String getShareEntity() { + return this.shareEntity; + } + + public void setShareEntity(String shareEntity) { + this.shareEntity = shareEntity; + } + + public String getManageCollaboratorEntity() { + return this.manageCollaboratorEntity; + } + + public void setManageCollaboratorEntity(String manageCollaboratorEntity) { + this.manageCollaboratorEntity = manageCollaboratorEntity; + } + + public String getLinkShareEntity() { + return this.linkShareEntity; + } + + public void setLinkShareEntity(String linkShareEntity) { + this.linkShareEntity = linkShareEntity; + } + + public String getCopyEntity() { + return this.copyEntity; + } + + public void setCopyEntity(String copyEntity) { + this.copyEntity = copyEntity; + } + + public Boolean getLockSwitch() { + return this.lockSwitch; + } + + public void setLockSwitch(Boolean lockSwitch) { + this.lockSwitch = lockSwitch; + } + + public static class Builder { + /** + * 允许内容被分享到组织外 + *

示例值:open + */ + private String externalAccessEntity; + /** + * 谁可以创建副本、打印、下载 + *

示例值:anyone_can_view + */ + private String securityEntity; + /** + * 谁可以评论 + *

示例值:anyone_can_view + */ + private String commentEntity; + /** + * 谁可以添加和管理协作者-组织维度 + *

示例值:anyone + */ + private String shareEntity; + /** + * 谁可以添加和管理协作者-协作者维度 + *

示例值:collaborator_can_view + */ + private String manageCollaboratorEntity; + /** + * 链接分享设置 + *

示例值:tenant_readable + */ + private String linkShareEntity; + /** + * 谁可以复制内容 + *

示例值:anyone_can_view + */ + private String copyEntity; + /** + * 节点是否已加锁,加锁之后不再继承父级页面的权限 + *

示例值:false + */ + private Boolean lockSwitch; + + /** + * 允许内容被分享到组织外 + *

示例值:open + * + * @param externalAccessEntity + * @return + */ + public Builder externalAccessEntity(String externalAccessEntity) { + this.externalAccessEntity = externalAccessEntity; + return this; + } + + /** + * 允许内容被分享到组织外 + *

示例值:open + * + * @param externalAccessEntity {@link com.lark.oapi.service.drive.v2.enums.PermissionPublicExternalAccessEntityEnum} + * @return + */ + public Builder externalAccessEntity(com.lark.oapi.service.drive.v2.enums.PermissionPublicExternalAccessEntityEnum externalAccessEntity) { + this.externalAccessEntity = externalAccessEntity.getValue(); + return this; + } + + + /** + * 谁可以创建副本、打印、下载 + *

示例值:anyone_can_view + * + * @param securityEntity + * @return + */ + public Builder securityEntity(String securityEntity) { + this.securityEntity = securityEntity; + return this; + } + + /** + * 谁可以创建副本、打印、下载 + *

示例值:anyone_can_view + * + * @param securityEntity {@link com.lark.oapi.service.drive.v2.enums.PermissionPublicSecurityEntityEnum} + * @return + */ + public Builder securityEntity(com.lark.oapi.service.drive.v2.enums.PermissionPublicSecurityEntityEnum securityEntity) { + this.securityEntity = securityEntity.getValue(); + return this; + } + + + /** + * 谁可以评论 + *

示例值:anyone_can_view + * + * @param commentEntity + * @return + */ + public Builder commentEntity(String commentEntity) { + this.commentEntity = commentEntity; + return this; + } + + /** + * 谁可以评论 + *

示例值:anyone_can_view + * + * @param commentEntity {@link com.lark.oapi.service.drive.v2.enums.PermissionPublicCommentEntityEnum} + * @return + */ + public Builder commentEntity(com.lark.oapi.service.drive.v2.enums.PermissionPublicCommentEntityEnum commentEntity) { + this.commentEntity = commentEntity.getValue(); + return this; + } + + + /** + * 谁可以添加和管理协作者-组织维度 + *

示例值:anyone + * + * @param shareEntity + * @return + */ + public Builder shareEntity(String shareEntity) { + this.shareEntity = shareEntity; + return this; + } + + /** + * 谁可以添加和管理协作者-组织维度 + *

示例值:anyone + * + * @param shareEntity {@link com.lark.oapi.service.drive.v2.enums.PermissionPublicShareEntityEnum} + * @return + */ + public Builder shareEntity(com.lark.oapi.service.drive.v2.enums.PermissionPublicShareEntityEnum shareEntity) { + this.shareEntity = shareEntity.getValue(); + return this; + } + + + /** + * 谁可以添加和管理协作者-协作者维度 + *

示例值:collaborator_can_view + * + * @param manageCollaboratorEntity + * @return + */ + public Builder manageCollaboratorEntity(String manageCollaboratorEntity) { + this.manageCollaboratorEntity = manageCollaboratorEntity; + return this; + } + + /** + * 谁可以添加和管理协作者-协作者维度 + *

示例值:collaborator_can_view + * + * @param manageCollaboratorEntity {@link com.lark.oapi.service.drive.v2.enums.PermissionPublicManageCollaboratorEntityEnum} + * @return + */ + public Builder manageCollaboratorEntity(com.lark.oapi.service.drive.v2.enums.PermissionPublicManageCollaboratorEntityEnum manageCollaboratorEntity) { + this.manageCollaboratorEntity = manageCollaboratorEntity.getValue(); + return this; + } + + + /** + * 链接分享设置 + *

示例值:tenant_readable + * + * @param linkShareEntity + * @return + */ + public Builder linkShareEntity(String linkShareEntity) { + this.linkShareEntity = linkShareEntity; + return this; + } + + /** + * 链接分享设置 + *

示例值:tenant_readable + * + * @param linkShareEntity {@link com.lark.oapi.service.drive.v2.enums.PermissionPublicLinkShareEntityEnum} + * @return + */ + public Builder linkShareEntity(com.lark.oapi.service.drive.v2.enums.PermissionPublicLinkShareEntityEnum linkShareEntity) { + this.linkShareEntity = linkShareEntity.getValue(); + return this; + } + + + /** + * 谁可以复制内容 + *

示例值:anyone_can_view + * + * @param copyEntity + * @return + */ + public Builder copyEntity(String copyEntity) { + this.copyEntity = copyEntity; + return this; + } + + /** + * 谁可以复制内容 + *

示例值:anyone_can_view + * + * @param copyEntity {@link com.lark.oapi.service.drive.v2.enums.PermissionPublicCopyEntityEnum} + * @return + */ + public Builder copyEntity(com.lark.oapi.service.drive.v2.enums.PermissionPublicCopyEntityEnum copyEntity) { + this.copyEntity = copyEntity.getValue(); + return this; + } + + + /** + * 节点是否已加锁,加锁之后不再继承父级页面的权限 + *

示例值:false + * + * @param lockSwitch + * @return + */ + public Builder lockSwitch(Boolean lockSwitch) { + this.lockSwitch = lockSwitch; + return this; + } + + + public PermissionPublic build() { + return new PermissionPublic(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/SecureLabel.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/SecureLabel.java new file mode 100644 index 000000000..996faea8d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/model/SecureLabel.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class SecureLabel { + /** + * 密级标签 ID + *

示例值:7217780879644737540 + */ + @SerializedName("id") + private String id; + /** + * 密级标签名称 + *

示例值:L1 + */ + @SerializedName("name") + private String name; + + // builder 开始 + public SecureLabel() { + } + + public SecureLabel(Builder builder) { + /** + * 密级标签 ID + *

示例值:7217780879644737540 + */ + this.id = builder.id; + /** + * 密级标签名称 + *

示例值:L1 + */ + this.name = builder.name; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public static class Builder { + /** + * 密级标签 ID + *

示例值:7217780879644737540 + */ + private String id; + /** + * 密级标签名称 + *

示例值:L1 + */ + private String name; + + /** + * 密级标签 ID + *

示例值:7217780879644737540 + * + * @param id + * @return + */ + public Builder id(String id) { + this.id = id; + return this; + } + + + /** + * 密级标签名称 + *

示例值:L1 + * + * @param name + * @return + */ + public Builder name(String name) { + this.name = name; + return this; + } + + + public SecureLabel build() { + return new SecureLabel(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/resource/PermissionPublic.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/resource/PermissionPublic.java new file mode 100644 index 000000000..6b20a84a1 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/drive/v2/resource/PermissionPublic.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.drive.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.drive.v2.model.GetPermissionPublicReq; +import com.lark.oapi.service.drive.v2.model.GetPermissionPublicResp; +import com.lark.oapi.service.drive.v2.model.PatchPermissionPublicReq; +import com.lark.oapi.service.drive.v2.model.PatchPermissionPublicResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class PermissionPublic { + private static final Logger log = LoggerFactory.getLogger(PermissionPublic.class); + private final Config config; + + public PermissionPublic(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=drive&resource=permission.public&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev2/GetPermissionPublicSample.java ; + */ + public GetPermissionPublicResp get(GetPermissionPublicReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v2/permissions/:token/public" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetPermissionPublicResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetPermissionPublicResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v2/permissions/:token/public" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=drive&resource=permission.public&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev2/GetPermissionPublicSample.java ; + */ + public GetPermissionPublicResp get(GetPermissionPublicReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/drive/v2/permissions/:token/public" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetPermissionPublicResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetPermissionPublicResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v2/permissions/:token/public" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=drive&resource=permission.public&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev2/PatchPermissionPublicSample.java ; + */ + public PatchPermissionPublicResp patch(PatchPermissionPublicReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/drive/v2/permissions/:token/public" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchPermissionPublicResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchPermissionPublicResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v2/permissions/:token/public" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=drive&resource=permission.public&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/drivev2/PatchPermissionPublicSample.java ; + */ + public PatchPermissionPublicResp patch(PatchPermissionPublicReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/drive/v2/permissions/:token/public" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchPermissionPublicResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchPermissionPublicResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/drive/v2/permissions/:token/public" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/ehr/EhrService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/ehr/EhrService.java new file mode 100644 index 000000000..ed721664f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/ehr/EhrService.java @@ -0,0 +1,42 @@ +// Code generated by lark suite 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 com.lark.oapi.service.ehr; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.ehr.v1.V1; +import com.lark.oapi.service.ehr.v1.resource.Attachment; +import com.lark.oapi.service.ehr.v1.resource.Employee; + +public class EhrService { + private final V1 v1; + private final Attachment attachment; // 飞书人事(标准版) + private final Employee employee; // 飞书人事(标准版) + + public EhrService(Config config) { + this.v1 = new V1(config); + this.attachment = new Attachment(config); + this.employee = new Employee(config); + } + + public V1 v1() { + return v1; + } + + public Attachment attachment() { + return attachment; + } + + public Employee employee() { + return employee; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/ehr/v1/EhrService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/ehr/v1/EhrService.java deleted file mode 100644 index 0274fda79..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/ehr/v1/EhrService.java +++ /dev/null @@ -1,233 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.ehr.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.ehr.v1.model.GetAttachmentReq; -import com.lark.oapi.service.ehr.v1.model.GetAttachmentResp; -import com.lark.oapi.service.ehr.v1.model.ListEmployeeReq; -import com.lark.oapi.service.ehr.v1.model.ListEmployeeResp; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.ByteArrayOutputStream; -import java.nio.charset.StandardCharsets; - -public class EhrService { - private static final Logger log = LoggerFactory.getLogger(EhrService.class); - private final Attachment attachment; // 飞书人事(标准版) - private final Employee employee; // 飞书人事(标准版) - - public EhrService(Config config) { - this.attachment = new Attachment(config); - this.employee = new Employee(config); - } - - /** - * 飞书人事(标准版) - * - * @return - */ - public Attachment attachment() { - return attachment; - } - - /** - * 飞书人事(标准版) - * - * @return - */ - public Employee employee() { - return employee; - } - - public static class Attachment { - private final Config config; - - public Attachment(Config config) { - this.config = config; - } - - /** - * 下载附件,根据文件 token 下载文件。;;调用 「批量获取员工花名册信息」接口的返回值中,「文件」类型的字段 id,即是文件 token - *

![image.png](//sf1-ttcdn-tos.pstatp.com/obj/open-platform-opendoc/bed391d2a8ce6ed2d5985ea69bf92850_9GY1mnuDXP.png) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/ehr/ehr-v1/attachment/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/ehrv1/GetAttachmentSample.java ; - */ - public GetAttachmentResp get(GetAttachmentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/ehr/v1/attachments/:token" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - if (httpResponse.getStatusCode() == 200) { - GetAttachmentResp resp = new GetAttachmentResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - GetAttachmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAttachmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/ehr/v1/attachments/:token" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 下载附件,根据文件 token 下载文件。;;调用 「批量获取员工花名册信息」接口的返回值中,「文件」类型的字段 id,即是文件 token - *

![image.png](//sf1-ttcdn-tos.pstatp.com/obj/open-platform-opendoc/bed391d2a8ce6ed2d5985ea69bf92850_9GY1mnuDXP.png) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/ehr/ehr-v1/attachment/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/ehrv1/GetAttachmentSample.java ; - */ - public GetAttachmentResp get(GetAttachmentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/ehr/v1/attachments/:token" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 下载请求,返回流 - if (httpResponse.getStatusCode() == 200) { - GetAttachmentResp resp = new GetAttachmentResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - GetAttachmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAttachmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/ehr/v1/attachments/:token" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Employee { - private final Config config; - - public Employee(Config config) { - this.config = config; - } - - /** - * 批量获取员工花名册信息,根据员工飞书用户 ID / 员工状态 / 雇员类型等搜索条件 ,批量获取员工花名册字段信息。字段包括「系统标准字段 / system_fields」和「自定义字段 / custom_fields」 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/ehr/ehr-v1/employee/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/ehrv1/ListEmployeeSample.java ; - */ - public ListEmployeeResp list(ListEmployeeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/ehr/v1/employees" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListEmployeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListEmployeeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/ehr/v1/employees" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量获取员工花名册信息,根据员工飞书用户 ID / 员工状态 / 雇员类型等搜索条件 ,批量获取员工花名册字段信息。字段包括「系统标准字段 / system_fields」和「自定义字段 / custom_fields」 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/ehr/ehr-v1/employee/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/ehrv1/ListEmployeeSample.java ; - */ - public ListEmployeeResp list(ListEmployeeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/ehr/v1/employees" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListEmployeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListEmployeeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/ehr/v1/employees" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/ehr/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/ehr/v1/V1.java new file mode 100644 index 000000000..e341e5a23 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/ehr/v1/V1.java @@ -0,0 +1,36 @@ +// Code generated by lark suite 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 com.lark.oapi.service.ehr.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.ehr.v1.resource.Attachment; +import com.lark.oapi.service.ehr.v1.resource.Employee; + +public class V1 { + private final Attachment attachment; // 飞书人事(标准版) + private final Employee employee; // 飞书人事(标准版) + + public V1(Config config) { + this.attachment = new Attachment(config); + this.employee = new Employee(config); + } + + public Attachment attachment() { + return attachment; + } + + public Employee employee() { + return employee; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/ehr/v1/resource/Attachment.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/ehr/v1/resource/Attachment.java new file mode 100644 index 000000000..2feb5ba44 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/ehr/v1/resource/Attachment.java @@ -0,0 +1,129 @@ +// Code generated by lark suite 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 com.lark.oapi.service.ehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.ehr.v1.model.GetAttachmentReq; +import com.lark.oapi.service.ehr.v1.model.GetAttachmentResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.ByteArrayOutputStream; +import java.nio.charset.StandardCharsets; + +public class Attachment { + private static final Logger log = LoggerFactory.getLogger(Attachment.class); + private final Config config; + + public Attachment(Config config) { + this.config = config; + } + + + /** + * 下载附件,根据文件 token 下载文件。;;调用 「批量获取员工花名册信息」接口的返回值中,「文件」类型的字段 id,即是文件 token + *

![image.png](//sf1-ttcdn-tos.pstatp.com/obj/open-platform-opendoc/bed391d2a8ce6ed2d5985ea69bf92850_9GY1mnuDXP.png) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/ehr/ehr-v1/attachment/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/ehrv1/GetAttachmentSample.java ; + */ + public GetAttachmentResp get(GetAttachmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/ehr/v1/attachments/:token" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + if (httpResponse.getStatusCode() == 200) { + GetAttachmentResp resp = new GetAttachmentResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + GetAttachmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAttachmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/ehr/v1/attachments/:token" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 下载附件,根据文件 token 下载文件。;;调用 「批量获取员工花名册信息」接口的返回值中,「文件」类型的字段 id,即是文件 token + *

![image.png](//sf1-ttcdn-tos.pstatp.com/obj/open-platform-opendoc/bed391d2a8ce6ed2d5985ea69bf92850_9GY1mnuDXP.png) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/ehr/ehr-v1/attachment/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/ehrv1/GetAttachmentSample.java ; + */ + public GetAttachmentResp get(GetAttachmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/ehr/v1/attachments/:token" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 下载请求,返回流 + if (httpResponse.getStatusCode() == 200) { + GetAttachmentResp resp = new GetAttachmentResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + GetAttachmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAttachmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/ehr/v1/attachments/:token" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/ehr/v1/resource/Employee.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/ehr/v1/resource/Employee.java new file mode 100644 index 000000000..dd8f4e457 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/ehr/v1/resource/Employee.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.ehr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.ehr.v1.model.ListEmployeeReq; +import com.lark.oapi.service.ehr.v1.model.ListEmployeeResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Employee { + private static final Logger log = LoggerFactory.getLogger(Employee.class); + private final Config config; + + public Employee(Config config) { + this.config = config; + } + + + /** + * 批量获取员工花名册信息,根据员工飞书用户 ID / 员工状态 / 雇员类型等搜索条件 ,批量获取员工花名册字段信息。字段包括「系统标准字段 / system_fields」和「自定义字段 / custom_fields」 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/ehr/ehr-v1/employee/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/ehrv1/ListEmployeeSample.java ; + */ + public ListEmployeeResp list(ListEmployeeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/ehr/v1/employees" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListEmployeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListEmployeeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/ehr/v1/employees" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量获取员工花名册信息,根据员工飞书用户 ID / 员工状态 / 雇员类型等搜索条件 ,批量获取员工花名册字段信息。字段包括「系统标准字段 / system_fields」和「自定义字段 / custom_fields」 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/ehr/ehr-v1/employee/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/ehrv1/ListEmployeeSample.java ; + */ + public ListEmployeeResp list(ListEmployeeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/ehr/v1/employees" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListEmployeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListEmployeeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/ehr/v1/employees" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/event/EventService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/event/EventService.java new file mode 100644 index 000000000..abfd70b90 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/event/EventService.java @@ -0,0 +1,28 @@ +// Code generated by lark suite 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 com.lark.oapi.service.event; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.event.v1.V1; + +public class EventService { + private final V1 v1; + + public EventService(Config config) { + this.v1 = new V1(config); + } + + public V1 v1() { + return v1; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/event/v1/EventService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/event/v1/EventService.java deleted file mode 100644 index 0560d6e62..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/event/v1/EventService.java +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.event.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.event.v1.model.ListOutboundIpReq; -import com.lark.oapi.service.event.v1.model.ListOutboundIpResp; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class EventService { - private static final Logger log = LoggerFactory.getLogger(EventService.class); - private final OutboundIp outboundIp; // 事件订阅 - - public EventService(Config config) { - this.outboundIp = new OutboundIp(config); - } - - /** - * 事件订阅 - * - * @return - */ - public OutboundIp outboundIp() { - return outboundIp; - } - - public static class OutboundIp { - private final Config config; - - public OutboundIp(Config config) { - this.config = config; - } - - /** - * 获取事件出口 IP,飞书开放平台向应用配置的回调地址推送事件时,是通过特定的 IP 发送出去的,应用可以通过本接口获取所有相关的 IP 地址。 - *

IP 地址有变更可能,建议应用每隔 6 小时定时拉取最新的 IP 地址,以免由于企业防火墙设置,导致应用无法及时接收到飞书开放平台推送的事件。 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uYDNxYjL2QTM24iN0EjN/event-v1/outbound_ip/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/eventv1/ListOutboundIpSample.java ; - */ - public ListOutboundIpResp list(ListOutboundIpReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/event/v1/outbound_ip" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListOutboundIpResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListOutboundIpResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/event/v1/outbound_ip" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取事件出口 IP,飞书开放平台向应用配置的回调地址推送事件时,是通过特定的 IP 发送出去的,应用可以通过本接口获取所有相关的 IP 地址。 - *

IP 地址有变更可能,建议应用每隔 6 小时定时拉取最新的 IP 地址,以免由于企业防火墙设置,导致应用无法及时接收到飞书开放平台推送的事件。 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uYDNxYjL2QTM24iN0EjN/event-v1/outbound_ip/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/eventv1/ListOutboundIpSample.java ; - */ - public ListOutboundIpResp list(ListOutboundIpReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/event/v1/outbound_ip" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListOutboundIpResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListOutboundIpResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/event/v1/outbound_ip" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/event/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/event/v1/V1.java new file mode 100644 index 000000000..c424060cf --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/event/v1/V1.java @@ -0,0 +1,29 @@ +// Code generated by lark suite 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 com.lark.oapi.service.event.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.event.v1.resource.OutboundIp; + +public class V1 { + private final OutboundIp outboundIp; // 事件订阅 + + public V1(Config config) { + this.outboundIp = new OutboundIp(config); + } + + public OutboundIp outboundIp() { + return outboundIp; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/event/v1/resource/OutboundIp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/event/v1/resource/OutboundIp.java new file mode 100644 index 000000000..a61ad925b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/event/v1/resource/OutboundIp.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.event.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.event.v1.model.ListOutboundIpReq; +import com.lark.oapi.service.event.v1.model.ListOutboundIpResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class OutboundIp { + private static final Logger log = LoggerFactory.getLogger(OutboundIp.class); + private final Config config; + + public OutboundIp(Config config) { + this.config = config; + } + + + /** + * 获取事件出口 IP,飞书开放平台向应用配置的回调地址推送事件时,是通过特定的 IP 发送出去的,应用可以通过本接口获取所有相关的 IP 地址。 + *

IP 地址有变更可能,建议应用每隔 6 小时定时拉取最新的 IP 地址,以免由于企业防火墙设置,导致应用无法及时接收到飞书开放平台推送的事件。 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uYDNxYjL2QTM24iN0EjN/event-v1/outbound_ip/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/eventv1/ListOutboundIpSample.java ; + */ + public ListOutboundIpResp list(ListOutboundIpReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/event/v1/outbound_ip" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListOutboundIpResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListOutboundIpResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/event/v1/outbound_ip" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取事件出口 IP,飞书开放平台向应用配置的回调地址推送事件时,是通过特定的 IP 发送出去的,应用可以通过本接口获取所有相关的 IP 地址。 + *

IP 地址有变更可能,建议应用每隔 6 小时定时拉取最新的 IP 地址,以免由于企业防火墙设置,导致应用无法及时接收到飞书开放平台推送的事件。 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uYDNxYjL2QTM24iN0EjN/event-v1/outbound_ip/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/eventv1/ListOutboundIpSample.java ; + */ + public ListOutboundIpResp list(ListOutboundIpReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/event/v1/outbound_ip" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListOutboundIpResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListOutboundIpResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/event/v1/outbound_ip" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/gray_test_open_sg/GrayTestOpenSgService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/gray_test_open_sg/GrayTestOpenSgService.java new file mode 100644 index 000000000..24cc7c534 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/gray_test_open_sg/GrayTestOpenSgService.java @@ -0,0 +1,35 @@ +// Code generated by lark suite 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 com.lark.oapi.service.gray_test_open_sg; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.gray_test_open_sg.v1.V1; +import com.lark.oapi.service.gray_test_open_sg.v1.resource.Moto; + +public class GrayTestOpenSgService { + private final V1 v1; + private final Moto moto; // moto + + public GrayTestOpenSgService(Config config) { + this.v1 = new V1(config); + this.moto = new Moto(config); + } + + public V1 v1() { + return v1; + } + + public Moto moto() { + return moto; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/gray_test_open_sg/v1/GrayTestOpenSgService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/gray_test_open_sg/v1/GrayTestOpenSgService.java deleted file mode 100644 index 14c3d97db..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/gray_test_open_sg/v1/GrayTestOpenSgService.java +++ /dev/null @@ -1,253 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.gray_test_open_sg.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.gray_test_open_sg.v1.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class GrayTestOpenSgService { - private static final Logger log = LoggerFactory.getLogger(GrayTestOpenSgService.class); - private final Moto moto; // moto - - public GrayTestOpenSgService(Config config) { - this.moto = new Moto(config); - } - - /** - * moto - * - * @return - */ - public Moto moto() { - return moto; - } - - public static class Moto { - private final Config config; - - public Moto(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=gray_test_open_sg&resource=moto&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/gray_test_open_sgv1/CreateMotoSample.java ; - */ - public CreateMotoResp create(CreateMotoReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/gray_test_open_sg/v1/motos" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateMotoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMotoResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/gray_test_open_sg/v1/motos" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=gray_test_open_sg&resource=moto&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/gray_test_open_sgv1/CreateMotoSample.java ; - */ - public CreateMotoResp create(CreateMotoReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/gray_test_open_sg/v1/motos" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateMotoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMotoResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/gray_test_open_sg/v1/motos" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=gray_test_open_sg&resource=moto&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/gray_test_open_sgv1/GetMotoSample.java ; - */ - public GetMotoResp get(GetMotoReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/gray_test_open_sg/v1/motos/:moto_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetMotoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMotoResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/gray_test_open_sg/v1/motos/:moto_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=gray_test_open_sg&resource=moto&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/gray_test_open_sgv1/GetMotoSample.java ; - */ - public GetMotoResp get(GetMotoReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/gray_test_open_sg/v1/motos/:moto_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetMotoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMotoResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/gray_test_open_sg/v1/motos/:moto_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=gray_test_open_sg&resource=moto&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/gray_test_open_sgv1/ListMotoSample.java ; - */ - public ListMotoResp list(ListMotoReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/gray_test_open_sg/v1/motos" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListMotoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMotoResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/gray_test_open_sg/v1/motos" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=gray_test_open_sg&resource=moto&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/gray_test_open_sgv1/ListMotoSample.java ; - */ - public ListMotoResp list(ListMotoReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/gray_test_open_sg/v1/motos" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListMotoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMotoResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/gray_test_open_sg/v1/motos" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/gray_test_open_sg/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/gray_test_open_sg/v1/V1.java new file mode 100644 index 000000000..d8a5730a2 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/gray_test_open_sg/v1/V1.java @@ -0,0 +1,29 @@ +// Code generated by lark suite 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 com.lark.oapi.service.gray_test_open_sg.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.gray_test_open_sg.v1.resource.Moto; + +public class V1 { + private final Moto moto; // moto + + public V1(Config config) { + this.moto = new Moto(config); + } + + public Moto moto() { + return moto; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/gray_test_open_sg/v1/resource/Moto.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/gray_test_open_sg/v1/resource/Moto.java new file mode 100644 index 000000000..b141dcc4a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/gray_test_open_sg/v1/resource/Moto.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.gray_test_open_sg.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.gray_test_open_sg.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Moto { + private static final Logger log = LoggerFactory.getLogger(Moto.class); + private final Config config; + + public Moto(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=gray_test_open_sg&resource=moto&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/gray_test_open_sgv1/CreateMotoSample.java ; + */ + public CreateMotoResp create(CreateMotoReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/gray_test_open_sg/v1/motos" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateMotoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMotoResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/gray_test_open_sg/v1/motos" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=gray_test_open_sg&resource=moto&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/gray_test_open_sgv1/CreateMotoSample.java ; + */ + public CreateMotoResp create(CreateMotoReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/gray_test_open_sg/v1/motos" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateMotoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMotoResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/gray_test_open_sg/v1/motos" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=gray_test_open_sg&resource=moto&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/gray_test_open_sgv1/GetMotoSample.java ; + */ + public GetMotoResp get(GetMotoReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/gray_test_open_sg/v1/motos/:moto_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetMotoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMotoResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/gray_test_open_sg/v1/motos/:moto_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=gray_test_open_sg&resource=moto&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/gray_test_open_sgv1/GetMotoSample.java ; + */ + public GetMotoResp get(GetMotoReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/gray_test_open_sg/v1/motos/:moto_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetMotoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMotoResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/gray_test_open_sg/v1/motos/:moto_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=gray_test_open_sg&resource=moto&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/gray_test_open_sgv1/ListMotoSample.java ; + */ + public ListMotoResp list(ListMotoReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/gray_test_open_sg/v1/motos" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListMotoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMotoResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/gray_test_open_sg/v1/motos" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=gray_test_open_sg&resource=moto&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/gray_test_open_sgv1/ListMotoSample.java ; + */ + public ListMotoResp list(ListMotoReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/gray_test_open_sg/v1/motos" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListMotoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMotoResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/gray_test_open_sg/v1/motos" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/HelpdeskService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/HelpdeskService.java new file mode 100644 index 000000000..0e9160c76 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/HelpdeskService.java @@ -0,0 +1,140 @@ +// Code generated by lark suite 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 com.lark.oapi.service.helpdesk; + +import com.lark.oapi.core.Config; +import com.lark.oapi.event.IEventHandler; +import com.lark.oapi.service.helpdesk.v1.V1; +import com.lark.oapi.service.helpdesk.v1.model.P2NotificationApproveV1; +import com.lark.oapi.service.helpdesk.v1.model.P2TicketCreatedV1; +import com.lark.oapi.service.helpdesk.v1.model.P2TicketMessageCreatedV1; +import com.lark.oapi.service.helpdesk.v1.model.P2TicketUpdatedV1; +import com.lark.oapi.service.helpdesk.v1.resource.*; + +public class HelpdeskService { + private final V1 v1; + private final Agent agent; // 客服 + private final AgentSchedules agentSchedules; // 客服工作日程 + private final AgentSchedule agentSchedule; // agent_schedule + private final AgentSkill agentSkill; // 客服技能 + private final AgentSkillRule agentSkillRule; // 客服技能规则 + private final BotMessage botMessage; // 机器人消息 + private final Category category; // 知识库分类 + private final Event event; // 事件订阅 + private final Faq faq; // 知识库 + private final Notification notification; // 推送中心 + private final Ticket ticket; // 工单 + private final TicketMessage ticketMessage; // 工单消息 + private final TicketCustomizedField ticketCustomizedField; // 工单自定义字段 + + public HelpdeskService(Config config) { + this.v1 = new V1(config); + this.agent = new Agent(config); + this.agentSchedules = new AgentSchedules(config); + this.agentSchedule = new AgentSchedule(config); + this.agentSkill = new AgentSkill(config); + this.agentSkillRule = new AgentSkillRule(config); + this.botMessage = new BotMessage(config); + this.category = new Category(config); + this.event = new Event(config); + this.faq = new Faq(config); + this.notification = new Notification(config); + this.ticket = new Ticket(config); + this.ticketMessage = new TicketMessage(config); + this.ticketCustomizedField = new TicketCustomizedField(config); + } + + public V1 v1() { + return v1; + } + + public Agent agent() { + return agent; + } + + public AgentSchedules agentSchedules() { + return agentSchedules; + } + + public AgentSchedule agentSchedule() { + return agentSchedule; + } + + public AgentSkill agentSkill() { + return agentSkill; + } + + public AgentSkillRule agentSkillRule() { + return agentSkillRule; + } + + public BotMessage botMessage() { + return botMessage; + } + + public Category category() { + return category; + } + + public Event event() { + return event; + } + + public Faq faq() { + return faq; + } + + public Notification notification() { + return notification; + } + + public Ticket ticket() { + return ticket; + } + + public TicketMessage ticketMessage() { + return ticketMessage; + } + + public TicketCustomizedField ticketCustomizedField() { + return ticketCustomizedField; + } + + public abstract static class P2NotificationApproveV1Handler implements IEventHandler { + @Override + public P2NotificationApproveV1 getEvent() { + return new P2NotificationApproveV1(); + } + } + + public abstract static class P2TicketCreatedV1Handler implements IEventHandler { + @Override + public P2TicketCreatedV1 getEvent() { + return new P2TicketCreatedV1(); + } + } + + public abstract static class P2TicketUpdatedV1Handler implements IEventHandler { + @Override + public P2TicketUpdatedV1 getEvent() { + return new P2TicketUpdatedV1(); + } + } + + public abstract static class P2TicketMessageCreatedV1Handler implements IEventHandler { + @Override + public P2TicketMessageCreatedV1 getEvent() { + return new P2TicketMessageCreatedV1(); + } + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/HelpdeskService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/HelpdeskService.java deleted file mode 100644 index 398de57ac..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/HelpdeskService.java +++ /dev/null @@ -1,3648 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.helpdesk.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.event.IEventHandler; -import com.lark.oapi.service.helpdesk.v1.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.ByteArrayOutputStream; -import java.nio.charset.StandardCharsets; - -public class HelpdeskService { - private static final Logger log = LoggerFactory.getLogger(HelpdeskService.class); - private final Agent agent; // 客服 - private final AgentSchedules agentSchedules; // 客服工作日程 - private final AgentSchedule agentSchedule; // agent_schedule - private final AgentSkill agentSkill; // 客服技能 - private final AgentSkillRule agentSkillRule; // 客服技能规则 - private final BotMessage botMessage; // 机器人消息 - private final Category category; // 知识库分类 - private final Event event; // 事件订阅 - private final Faq faq; // 知识库 - private final Notification notification; // 推送中心 - private final Ticket ticket; // 工单 - private final TicketMessage ticketMessage; // 工单消息 - private final TicketCustomizedField ticketCustomizedField; // 工单自定义字段 - - public HelpdeskService(Config config) { - this.agent = new Agent(config); - this.agentSchedules = new AgentSchedules(config); - this.agentSchedule = new AgentSchedule(config); - this.agentSkill = new AgentSkill(config); - this.agentSkillRule = new AgentSkillRule(config); - this.botMessage = new BotMessage(config); - this.category = new Category(config); - this.event = new Event(config); - this.faq = new Faq(config); - this.notification = new Notification(config); - this.ticket = new Ticket(config); - this.ticketMessage = new TicketMessage(config); - this.ticketCustomizedField = new TicketCustomizedField(config); - } - - /** - * 客服 - * - * @return - */ - public Agent agent() { - return agent; - } - - /** - * 客服工作日程 - * - * @return - */ - public AgentSchedules agentSchedules() { - return agentSchedules; - } - - /** - * agent_schedule - * - * @return - */ - public AgentSchedule agentSchedule() { - return agentSchedule; - } - - /** - * 客服技能 - * - * @return - */ - public AgentSkill agentSkill() { - return agentSkill; - } - - /** - * 客服技能规则 - * - * @return - */ - public AgentSkillRule agentSkillRule() { - return agentSkillRule; - } - - /** - * 机器人消息 - * - * @return - */ - public BotMessage botMessage() { - return botMessage; - } - - /** - * 知识库分类 - * - * @return - */ - public Category category() { - return category; - } - - /** - * 事件订阅 - * - * @return - */ - public Event event() { - return event; - } - - /** - * 知识库 - * - * @return - */ - public Faq faq() { - return faq; - } - - /** - * 推送中心 - * - * @return - */ - public Notification notification() { - return notification; - } - - /** - * 工单 - * - * @return - */ - public Ticket ticket() { - return ticket; - } - - /** - * 工单消息 - * - * @return - */ - public TicketMessage ticketMessage() { - return ticketMessage; - } - - /** - * 工单自定义字段 - * - * @return - */ - public TicketCustomizedField ticketCustomizedField() { - return ticketCustomizedField; - } - - public static class Agent { - private final Config config; - - public Agent(Config config) { - this.config = config; - } - - /** - * 获取客服邮箱地址,该接口用于获取客服邮箱地址 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent/agent_email ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/AgentEmailAgentSample.java ; - */ - public AgentEmailAgentResp agentEmail(RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/agent_emails" - , Sets.newHashSet(AccessTokenType.Tenant) - , null); - - // 反序列化 - AgentEmailAgentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AgentEmailAgentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_emails" - , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - return resp; - } - - /** - * 获取客服邮箱地址,该接口用于获取客服邮箱地址 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent/agent_email ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/AgentEmailAgentSample.java ; - */ - public AgentEmailAgentResp agentEmail() throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/agent_emails" - , Sets.newHashSet(AccessTokenType.Tenant) - , null); - - // 反序列化 - AgentEmailAgentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AgentEmailAgentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_emails" - , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - return resp; - } - - /** - * 更新客服信息,更新客服状态等信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchAgentSample.java ; - */ - public PatchAgentResp patch(PatchAgentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/helpdesk/v1/agents/:agent_id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - PatchAgentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAgentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agents/:agent_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新客服信息,更新客服状态等信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchAgentSample.java ; - */ - public PatchAgentResp patch(PatchAgentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/helpdesk/v1/agents/:agent_id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - PatchAgentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAgentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agents/:agent_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class AgentSchedules { - private final Config config; - - public AgentSchedules(Config config) { - this.config = config; - } - - /** - * 删除客服,该接口用于删除客服 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent-schedules/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteAgentSchedulesSample.java ; - */ - public DeleteAgentSchedulesResp delete(DeleteAgentSchedulesReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/helpdesk/v1/agents/:agent_id/schedules" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - DeleteAgentSchedulesResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAgentSchedulesResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agents/:agent_id/schedules" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除客服,该接口用于删除客服 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent-schedules/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteAgentSchedulesSample.java ; - */ - public DeleteAgentSchedulesResp delete(DeleteAgentSchedulesReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/helpdesk/v1/agents/:agent_id/schedules" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - DeleteAgentSchedulesResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAgentSchedulesResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agents/:agent_id/schedules" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取客服工作日程;,该接口用于获取客服信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent-schedules/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetAgentSchedulesSample.java ; - */ - public GetAgentSchedulesResp get(GetAgentSchedulesReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/agents/:agent_id/schedules" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetAgentSchedulesResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAgentSchedulesResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agents/:agent_id/schedules" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取客服工作日程;,该接口用于获取客服信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent-schedules/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetAgentSchedulesSample.java ; - */ - public GetAgentSchedulesResp get(GetAgentSchedulesReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/agents/:agent_id/schedules" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetAgentSchedulesResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAgentSchedulesResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agents/:agent_id/schedules" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新客服日程,该接口用于更新客服的日程 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent-schedules/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchAgentSchedulesSample.java ; - */ - public PatchAgentSchedulesResp patch(PatchAgentSchedulesReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/helpdesk/v1/agents/:agent_id/schedules" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - PatchAgentSchedulesResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAgentSchedulesResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agents/:agent_id/schedules" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新客服日程,该接口用于更新客服的日程 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent-schedules/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchAgentSchedulesSample.java ; - */ - public PatchAgentSchedulesResp patch(PatchAgentSchedulesReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/helpdesk/v1/agents/:agent_id/schedules" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - PatchAgentSchedulesResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAgentSchedulesResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agents/:agent_id/schedules" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class AgentSchedule { - private final Config config; - - public AgentSchedule(Config config) { - this.config = config; - } - - /** - * 创建客服,该接口用于创建客服 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_schedule/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateAgentScheduleSample.java ; - */ - public CreateAgentScheduleResp create(CreateAgentScheduleReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/agent_schedules" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - CreateAgentScheduleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAgentScheduleResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_schedules" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建客服,该接口用于创建客服 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_schedule/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateAgentScheduleSample.java ; - */ - public CreateAgentScheduleResp create(CreateAgentScheduleReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/agent_schedules" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - CreateAgentScheduleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAgentScheduleResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_schedules" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取全部客服工作日程,该接口用于获取所有客服信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_schedule/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListAgentScheduleSample.java ; - */ - public ListAgentScheduleResp list(ListAgentScheduleReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/agent_schedules" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListAgentScheduleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAgentScheduleResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_schedules" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取全部客服工作日程,该接口用于获取所有客服信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_schedule/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListAgentScheduleSample.java ; - */ - public ListAgentScheduleResp list(ListAgentScheduleReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/agent_schedules" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListAgentScheduleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAgentScheduleResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_schedules" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class AgentSkill { - private final Config config; - - public AgentSkill(Config config) { - this.config = config; - } - - /** - * 创建客服技能,该接口用于创建客服技能 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateAgentSkillSample.java ; - */ - public CreateAgentSkillResp create(CreateAgentSkillReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/agent_skills" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - CreateAgentSkillResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAgentSkillResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_skills" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建客服技能,该接口用于创建客服技能 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateAgentSkillSample.java ; - */ - public CreateAgentSkillResp create(CreateAgentSkillReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/agent_skills" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - CreateAgentSkillResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAgentSkillResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_skills" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除客服技能,该接口用于删除客服技能 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteAgentSkillSample.java ; - */ - public DeleteAgentSkillResp delete(DeleteAgentSkillReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/helpdesk/v1/agent_skills/:agent_skill_id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - DeleteAgentSkillResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAgentSkillResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_skills/:agent_skill_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除客服技能,该接口用于删除客服技能 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteAgentSkillSample.java ; - */ - public DeleteAgentSkillResp delete(DeleteAgentSkillReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/helpdesk/v1/agent_skills/:agent_skill_id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - DeleteAgentSkillResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAgentSkillResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_skills/:agent_skill_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取客服技能,该接口用于获取客服技能 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetAgentSkillSample.java ; - */ - public GetAgentSkillResp get(GetAgentSkillReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/agent_skills/:agent_skill_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetAgentSkillResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAgentSkillResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_skills/:agent_skill_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取客服技能,该接口用于获取客服技能 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetAgentSkillSample.java ; - */ - public GetAgentSkillResp get(GetAgentSkillReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/agent_skills/:agent_skill_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetAgentSkillResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAgentSkillResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_skills/:agent_skill_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取全部客服技能,获取全部客服技能 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListAgentSkillSample.java ; - */ - public ListAgentSkillResp list(RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/agent_skills" - , Sets.newHashSet(AccessTokenType.Tenant) - , null); - - // 反序列化 - ListAgentSkillResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAgentSkillResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_skills" - , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - return resp; - } - - /** - * 获取全部客服技能,获取全部客服技能 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListAgentSkillSample.java ; - */ - public ListAgentSkillResp list() throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/agent_skills" - , Sets.newHashSet(AccessTokenType.Tenant) - , null); - - // 反序列化 - ListAgentSkillResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAgentSkillResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_skills" - , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - return resp; - } - - /** - * 更新客服技能,该接口用于更新客服技能 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchAgentSkillSample.java ; - */ - public PatchAgentSkillResp patch(PatchAgentSkillReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/helpdesk/v1/agent_skills/:agent_skill_id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - PatchAgentSkillResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAgentSkillResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_skills/:agent_skill_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新客服技能,该接口用于更新客服技能 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchAgentSkillSample.java ; - */ - public PatchAgentSkillResp patch(PatchAgentSkillReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/helpdesk/v1/agent_skills/:agent_skill_id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - PatchAgentSkillResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAgentSkillResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_skills/:agent_skill_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class AgentSkillRule { - private final Config config; - - public AgentSkillRule(Config config) { - this.config = config; - } - - /** - * 获取客服技能列表,该接口用于获取全部客服技能。仅支持自建应用。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill_rule/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListAgentSkillRuleSample.java ; - */ - public ListAgentSkillRuleResp list(RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/agent_skill_rules" - , Sets.newHashSet(AccessTokenType.Tenant) - , null); - - // 反序列化 - ListAgentSkillRuleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAgentSkillRuleResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_skill_rules" - , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - return resp; - } - - /** - * 获取客服技能列表,该接口用于获取全部客服技能。仅支持自建应用。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill_rule/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListAgentSkillRuleSample.java ; - */ - public ListAgentSkillRuleResp list() throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/agent_skill_rules" - , Sets.newHashSet(AccessTokenType.Tenant) - , null); - - // 反序列化 - ListAgentSkillRuleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAgentSkillRuleResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_skill_rules" - , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - return resp; - } - } - - public static class BotMessage { - private final Config config; - - public BotMessage(Config config) { - this.config = config; - } - - /** - * 服务台机器人发送消息,通过服务台机器人给指定用户的服务台专属群或私聊发送消息,支持文本、富文本、卡片、图片。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/bot-message/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateBotMessageSample.java ; - */ - public CreateBotMessageResp create(CreateBotMessageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/message" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateBotMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateBotMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/message" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 服务台机器人发送消息,通过服务台机器人给指定用户的服务台专属群或私聊发送消息,支持文本、富文本、卡片、图片。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/bot-message/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateBotMessageSample.java ; - */ - public CreateBotMessageResp create(CreateBotMessageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/message" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateBotMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateBotMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/message" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Category { - private final Config config; - - public Category(Config config) { - this.config = config; - } - - /** - * 创建知识库分类,该接口用于创建知识库分类。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateCategorySample.java ; - */ - public CreateCategoryResp create(CreateCategoryReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/categories" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - CreateCategoryResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCategoryResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/categories" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建知识库分类,该接口用于创建知识库分类。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateCategorySample.java ; - */ - public CreateCategoryResp create(CreateCategoryReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/categories" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - CreateCategoryResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCategoryResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/categories" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除知识库分类详情,该接口用于删除知识库分类详情。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteCategorySample.java ; - */ - public DeleteCategoryResp delete(DeleteCategoryReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/helpdesk/v1/categories/:id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - DeleteCategoryResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteCategoryResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/categories/:id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除知识库分类详情,该接口用于删除知识库分类详情。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteCategorySample.java ; - */ - public DeleteCategoryResp delete(DeleteCategoryReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/helpdesk/v1/categories/:id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - DeleteCategoryResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteCategoryResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/categories/:id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取知识库分类,该接口用于获取知识库分类。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetCategorySample.java ; - */ - public GetCategoryResp get(GetCategoryReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/categories/:id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetCategoryResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCategoryResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/categories/:id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取知识库分类,该接口用于获取知识库分类。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetCategorySample.java ; - */ - public GetCategoryResp get(GetCategoryReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/categories/:id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetCategoryResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCategoryResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/categories/:id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取全部知识库分类 - meta,该接口用于获取服务台知识库所有分类 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListCategorySample.java ; - */ - public ListCategoryResp list(ListCategoryReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/categories" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListCategoryResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCategoryResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/categories" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取全部知识库分类 - meta,该接口用于获取服务台知识库所有分类 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListCategorySample.java ; - */ - public ListCategoryResp list(ListCategoryReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/categories" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListCategoryResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCategoryResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/categories" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新知识库分类详情,该接口用于更新知识库分类详情。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchCategorySample.java ; - */ - public PatchCategoryResp patch(PatchCategoryReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/helpdesk/v1/categories/:id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - PatchCategoryResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchCategoryResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/categories/:id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新知识库分类详情,该接口用于更新知识库分类详情。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchCategorySample.java ; - */ - public PatchCategoryResp patch(PatchCategoryReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/helpdesk/v1/categories/:id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - PatchCategoryResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchCategoryResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/categories/:id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Event { - private final Config config; - - public Event(Config config) { - this.config = config; - } - - /** - * 订阅服务台事件,用于订阅服务台事件 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/event/subscribe ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/SubscribeEventSample.java ; - */ - public SubscribeEventResp subscribe(SubscribeEventReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/events/subscribe" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SubscribeEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscribeEventResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/events/subscribe" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 订阅服务台事件,用于订阅服务台事件 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/event/subscribe ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/SubscribeEventSample.java ; - */ - public SubscribeEventResp subscribe(SubscribeEventReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/events/subscribe" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SubscribeEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscribeEventResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/events/subscribe" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 取消订阅服务台事件,用于取消订阅服务台事件 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/event/unsubscribe ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/UnsubscribeEventSample.java ; - */ - public UnsubscribeEventResp unsubscribe(UnsubscribeEventReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/events/unsubscribe" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UnsubscribeEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnsubscribeEventResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/events/unsubscribe" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 取消订阅服务台事件,用于取消订阅服务台事件 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/event/unsubscribe ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/UnsubscribeEventSample.java ; - */ - public UnsubscribeEventResp unsubscribe(UnsubscribeEventReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/events/unsubscribe" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UnsubscribeEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnsubscribeEventResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/events/unsubscribe" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Faq { - private final Config config; - - public Faq(Config config) { - this.config = config; - } - - /** - * 创建知识库,该接口用于创建知识库。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateFaqSample.java ; - */ - public CreateFaqResp create(CreateFaqReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/faqs" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - CreateFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFaqResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建知识库,该接口用于创建知识库。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateFaqSample.java ; - */ - public CreateFaqResp create(CreateFaqReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/faqs" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - CreateFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFaqResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除知识库,该接口用于删除知识库。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteFaqSample.java ; - */ - public DeleteFaqResp delete(DeleteFaqReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/helpdesk/v1/faqs/:id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - DeleteFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteFaqResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs/:id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除知识库,该接口用于删除知识库。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteFaqSample.java ; - */ - public DeleteFaqResp delete(DeleteFaqReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/helpdesk/v1/faqs/:id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - DeleteFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteFaqResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs/:id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取知识库图像,该接口用于获取知识库图像。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/faq_image ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/FaqImageFaqSample.java ; - */ - public FaqImageFaqResp faqImage(FaqImageFaqReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/faqs/:id/image/:image_key" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - if (httpResponse.getStatusCode() == 200) { - FaqImageFaqResp resp = new FaqImageFaqResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - FaqImageFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, FaqImageFaqResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs/:id/image/:image_key" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取知识库图像,该接口用于获取知识库图像。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/faq_image ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/FaqImageFaqSample.java ; - */ - public FaqImageFaqResp faqImage(FaqImageFaqReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/faqs/:id/image/:image_key" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 下载请求,返回流 - if (httpResponse.getStatusCode() == 200) { - FaqImageFaqResp resp = new FaqImageFaqResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - FaqImageFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, FaqImageFaqResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs/:id/image/:image_key" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取知识库详情,该接口用于获取服务台知识库详情。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetFaqSample.java ; - */ - public GetFaqResp get(GetFaqReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/faqs/:id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFaqResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs/:id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取知识库详情,该接口用于获取服务台知识库详情。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetFaqSample.java ; - */ - public GetFaqResp get(GetFaqReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/faqs/:id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFaqResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs/:id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取全部知识库详情,该接口用于获取服务台知识库详情。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListFaqSample.java ; - */ - public ListFaqResp list(ListFaqReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/faqs" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFaqResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取全部知识库详情,该接口用于获取服务台知识库详情。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListFaqSample.java ; - */ - public ListFaqResp list(ListFaqReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/faqs" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFaqResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改知识库,该接口用于修改知识库。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchFaqSample.java ; - */ - public PatchFaqResp patch(PatchFaqReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/helpdesk/v1/faqs/:id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - PatchFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchFaqResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs/:id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改知识库,该接口用于修改知识库。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchFaqSample.java ; - */ - public PatchFaqResp patch(PatchFaqReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/helpdesk/v1/faqs/:id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - PatchFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchFaqResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs/:id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 搜索知识库,该接口用于搜索服务台知识库。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/search ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/SearchFaqSample.java ; - */ - public SearchFaqResp search(SearchFaqReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/faqs/search" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SearchFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchFaqResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 搜索知识库,该接口用于搜索服务台知识库。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/search ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/SearchFaqSample.java ; - */ - public SearchFaqResp search(SearchFaqReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/faqs/search" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SearchFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchFaqResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Notification { - private final Config config; - - public Notification(Config config) { - this.config = config; - } - - /** - * 取消审核,提交审核后,如果需要取消审核,则调用此接口 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/cancel_approve ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CancelApproveNotificationSample.java ; - */ - public CancelApproveNotificationResp cancelApprove(CancelApproveNotificationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/notifications/:notification_id/cancel_approve" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - CancelApproveNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CancelApproveNotificationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/cancel_approve" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 取消审核,提交审核后,如果需要取消审核,则调用此接口 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/cancel_approve ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CancelApproveNotificationSample.java ; - */ - public CancelApproveNotificationResp cancelApprove(CancelApproveNotificationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/notifications/:notification_id/cancel_approve" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - CancelApproveNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CancelApproveNotificationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/cancel_approve" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 取消推送,取消推送接口,审核通过后待调度可以调用,发送过程中可以调用(会撤回已发送的消息),发送完成后可以需要推送(会撤回所有已发送的消息) - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/cancel_send ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CancelSendNotificationSample.java ; - */ - public CancelSendNotificationResp cancelSend(CancelSendNotificationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/notifications/:notification_id/cancel_send" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - CancelSendNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CancelSendNotificationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/cancel_send" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 取消推送,取消推送接口,审核通过后待调度可以调用,发送过程中可以调用(会撤回已发送的消息),发送完成后可以需要推送(会撤回所有已发送的消息) - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/cancel_send ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CancelSendNotificationSample.java ; - */ - public CancelSendNotificationResp cancelSend(CancelSendNotificationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/notifications/:notification_id/cancel_send" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - CancelSendNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CancelSendNotificationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/cancel_send" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建推送,调用接口创建推送,创建成功后为草稿状态 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateNotificationSample.java ; - */ - public CreateNotificationResp create(CreateNotificationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/notifications" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - CreateNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateNotificationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建推送,调用接口创建推送,创建成功后为草稿状态 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateNotificationSample.java ; - */ - public CreateNotificationResp create(CreateNotificationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/notifications" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - CreateNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateNotificationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 执行推送,审核通过后调用此接口设置推送时间,等待调度系统调度,发送消息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/execute_send ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ExecuteSendNotificationSample.java ; - */ - public ExecuteSendNotificationResp executeSend(ExecuteSendNotificationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/notifications/:notification_id/execute_send" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - ExecuteSendNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ExecuteSendNotificationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/execute_send" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 执行推送,审核通过后调用此接口设置推送时间,等待调度系统调度,发送消息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/execute_send ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ExecuteSendNotificationSample.java ; - */ - public ExecuteSendNotificationResp executeSend(ExecuteSendNotificationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/notifications/:notification_id/execute_send" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - ExecuteSendNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ExecuteSendNotificationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/execute_send" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询推送,查询推送详情 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetNotificationSample.java ; - */ - public GetNotificationResp get(GetNotificationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/notifications/:notification_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetNotificationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询推送,查询推送详情 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetNotificationSample.java ; - */ - public GetNotificationResp get(GetNotificationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/notifications/:notification_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetNotificationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新推送,更新推送信息,只有在草稿状态下才可以调用此接口进行更新 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchNotificationSample.java ; - */ - public PatchNotificationResp patch(PatchNotificationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/helpdesk/v1/notifications/:notification_id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - PatchNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchNotificationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新推送,更新推送信息,只有在草稿状态下才可以调用此接口进行更新 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchNotificationSample.java ; - */ - public PatchNotificationResp patch(PatchNotificationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/helpdesk/v1/notifications/:notification_id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - PatchNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchNotificationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 预览推送内容,在正式执行推送之前是可以调用此接口预览设置的推送内容 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/preview ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PreviewNotificationSample.java ; - */ - public PreviewNotificationResp preview(PreviewNotificationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/notifications/:notification_id/preview" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - PreviewNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PreviewNotificationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/preview" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 预览推送内容,在正式执行推送之前是可以调用此接口预览设置的推送内容 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/preview ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PreviewNotificationSample.java ; - */ - public PreviewNotificationResp preview(PreviewNotificationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/notifications/:notification_id/preview" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - PreviewNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PreviewNotificationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/preview" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 提交审核,正常情况下调用创建推送接口后,就可以调用提交审核接口,如果创建人是服务台owner则会自动审核通过,否则会通知服务台owner审核此推送信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/submit_approve ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/SubmitApproveNotificationSample.java ; - */ - public SubmitApproveNotificationResp submitApprove(SubmitApproveNotificationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/notifications/:notification_id/submit_approve" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - SubmitApproveNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubmitApproveNotificationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/submit_approve" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 提交审核,正常情况下调用创建推送接口后,就可以调用提交审核接口,如果创建人是服务台owner则会自动审核通过,否则会通知服务台owner审核此推送信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/submit_approve ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/SubmitApproveNotificationSample.java ; - */ - public SubmitApproveNotificationResp submitApprove(SubmitApproveNotificationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/notifications/:notification_id/submit_approve" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - SubmitApproveNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubmitApproveNotificationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/submit_approve" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Ticket { - private final Config config; - - public Ticket(Config config) { - this.config = config; - } - - /** - * 回复用户提问结果至工单,该接口用于回复用户提问结果至工单,需要工单仍处于进行中且未接入人工状态。仅支持自建应用。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/answer_user_query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/AnswerUserQueryTicketSample.java ; - */ - public AnswerUserQueryTicketResp answerUserQuery(AnswerUserQueryTicketReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/tickets/:ticket_id/answer_user_query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - AnswerUserQueryTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AnswerUserQueryTicketResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/tickets/:ticket_id/answer_user_query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 回复用户提问结果至工单,该接口用于回复用户提问结果至工单,需要工单仍处于进行中且未接入人工状态。仅支持自建应用。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/answer_user_query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/AnswerUserQueryTicketSample.java ; - */ - public AnswerUserQueryTicketResp answerUserQuery(AnswerUserQueryTicketReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/tickets/:ticket_id/answer_user_query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - AnswerUserQueryTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AnswerUserQueryTicketResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/tickets/:ticket_id/answer_user_query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取服务台自定义字段详情,该接口用于获取服务台自定义字段详情。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/customized_fields ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CustomizedFieldsTicketSample.java ; - */ - public CustomizedFieldsTicketResp customizedFields(CustomizedFieldsTicketReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/customized_fields" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CustomizedFieldsTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CustomizedFieldsTicketResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/customized_fields" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取服务台自定义字段详情,该接口用于获取服务台自定义字段详情。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/customized_fields ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CustomizedFieldsTicketSample.java ; - */ - public CustomizedFieldsTicketResp customizedFields(CustomizedFieldsTicketReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/customized_fields" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CustomizedFieldsTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CustomizedFieldsTicketResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/customized_fields" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取工单详情,该接口用于获取单个服务台工单详情。仅支持自建应用。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetTicketSample.java ; - */ - public GetTicketResp get(GetTicketReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/tickets/:ticket_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTicketResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/tickets/:ticket_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取工单详情,该接口用于获取单个服务台工单详情。仅支持自建应用。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetTicketSample.java ; - */ - public GetTicketResp get(GetTicketReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/tickets/:ticket_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTicketResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/tickets/:ticket_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取全部工单详情,该接口用于获取全部工单详情。仅支持自建应用。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListTicketSample.java ; - */ - public ListTicketResp list(ListTicketReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/tickets" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTicketResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/tickets" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取全部工单详情,该接口用于获取全部工单详情。仅支持自建应用。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListTicketSample.java ; - */ - public ListTicketResp list(ListTicketReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/tickets" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTicketResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/tickets" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建服务台对话,该接口用于创建服务台对话。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/start_service ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/StartServiceTicketSample.java ; - */ - public StartServiceTicketResp startService(StartServiceTicketReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/start_service" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - StartServiceTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, StartServiceTicketResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/start_service" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建服务台对话,该接口用于创建服务台对话。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/start_service ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/StartServiceTicketSample.java ; - */ - public StartServiceTicketResp startService(StartServiceTicketReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/start_service" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - StartServiceTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, StartServiceTicketResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/start_service" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取服务台工单内消息图像,该接口用于获取服务台工单消息图象。仅支持自建应用。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/ticket_image ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/TicketImageTicketSample.java ; - */ - public TicketImageTicketResp ticketImage(TicketImageTicketReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/ticket_images" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - if (httpResponse.getStatusCode() == 200) { - TicketImageTicketResp resp = new TicketImageTicketResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - TicketImageTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TicketImageTicketResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/ticket_images" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取服务台工单内消息图像,该接口用于获取服务台工单消息图象。仅支持自建应用。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/ticket_image ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/TicketImageTicketSample.java ; - */ - public TicketImageTicketResp ticketImage(TicketImageTicketReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/ticket_images" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 下载请求,返回流 - if (httpResponse.getStatusCode() == 200) { - TicketImageTicketResp resp = new TicketImageTicketResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - TicketImageTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TicketImageTicketResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/ticket_images" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新工单详情,该接口用于更新服务台工单详情。只会更新数据,不会触发相关操作。如修改工单状态到关单,不会关闭聊天页面。仅支持自建应用。要更新的工单字段必须至少输入一项。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/UpdateTicketSample.java ; - */ - public UpdateTicketResp update(UpdateTicketReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/helpdesk/v1/tickets/:ticket_id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - UpdateTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateTicketResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/tickets/:ticket_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新工单详情,该接口用于更新服务台工单详情。只会更新数据,不会触发相关操作。如修改工单状态到关单,不会关闭聊天页面。仅支持自建应用。要更新的工单字段必须至少输入一项。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/UpdateTicketSample.java ; - */ - public UpdateTicketResp update(UpdateTicketReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/helpdesk/v1/tickets/:ticket_id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - UpdateTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateTicketResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/tickets/:ticket_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class TicketMessage { - private final Config config; - - public TicketMessage(Config config) { - this.config = config; - } - - /** - * 工单发送消息,该接口用于工单发送消息。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket-message/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateTicketMessageSample.java ; - */ - public CreateTicketMessageResp create(CreateTicketMessageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/tickets/:ticket_id/messages" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateTicketMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTicketMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/tickets/:ticket_id/messages" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 工单发送消息,该接口用于工单发送消息。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket-message/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateTicketMessageSample.java ; - */ - public CreateTicketMessageResp create(CreateTicketMessageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/tickets/:ticket_id/messages" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateTicketMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTicketMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/tickets/:ticket_id/messages" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取服务台工单消息详情,该接口用于获取服务台工单消息详情。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket-message/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListTicketMessageSample.java ; - */ - public ListTicketMessageResp list(ListTicketMessageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/tickets/:ticket_id/messages" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListTicketMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTicketMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/tickets/:ticket_id/messages" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取服务台工单消息详情,该接口用于获取服务台工单消息详情。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket-message/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListTicketMessageSample.java ; - */ - public ListTicketMessageResp list(ListTicketMessageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/tickets/:ticket_id/messages" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListTicketMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTicketMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/tickets/:ticket_id/messages" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class TicketCustomizedField { - private final Config config; - - public TicketCustomizedField(Config config) { - this.config = config; - } - - /** - * 创建工单自定义字段,该接口用于创建自定义字段 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateTicketCustomizedFieldSample.java ; - */ - public CreateTicketCustomizedFieldResp create(CreateTicketCustomizedFieldReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/ticket_customized_fields" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - CreateTicketCustomizedFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTicketCustomizedFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/ticket_customized_fields" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建工单自定义字段,该接口用于创建自定义字段 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateTicketCustomizedFieldSample.java ; - */ - public CreateTicketCustomizedFieldResp create(CreateTicketCustomizedFieldReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/helpdesk/v1/ticket_customized_fields" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - CreateTicketCustomizedFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTicketCustomizedFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/ticket_customized_fields" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除工单自定义字段,该接口用于删除工单自定义字段。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteTicketCustomizedFieldSample.java ; - */ - public DeleteTicketCustomizedFieldResp delete(DeleteTicketCustomizedFieldReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - DeleteTicketCustomizedFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTicketCustomizedFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除工单自定义字段,该接口用于删除工单自定义字段。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteTicketCustomizedFieldSample.java ; - */ - public DeleteTicketCustomizedFieldResp delete(DeleteTicketCustomizedFieldReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - DeleteTicketCustomizedFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTicketCustomizedFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取工单自定义字段,该接口用于获取工单自定义字段详情。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetTicketCustomizedFieldSample.java ; - */ - public GetTicketCustomizedFieldResp get(GetTicketCustomizedFieldReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetTicketCustomizedFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTicketCustomizedFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取工单自定义字段,该接口用于获取工单自定义字段详情。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetTicketCustomizedFieldSample.java ; - */ - public GetTicketCustomizedFieldResp get(GetTicketCustomizedFieldReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetTicketCustomizedFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTicketCustomizedFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取全部工单自定义字段,该接口用于获取全部工单自定义字段。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListTicketCustomizedFieldSample.java ; - */ - public ListTicketCustomizedFieldResp list(ListTicketCustomizedFieldReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/ticket_customized_fields" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListTicketCustomizedFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTicketCustomizedFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/ticket_customized_fields" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取全部工单自定义字段,该接口用于获取全部工单自定义字段。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListTicketCustomizedFieldSample.java ; - */ - public ListTicketCustomizedFieldResp list(ListTicketCustomizedFieldReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/helpdesk/v1/ticket_customized_fields" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListTicketCustomizedFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTicketCustomizedFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/ticket_customized_fields" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新工单自定义字段,该接口用于更新自定义字段。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchTicketCustomizedFieldSample.java ; - */ - public PatchTicketCustomizedFieldResp patch(PatchTicketCustomizedFieldReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - PatchTicketCustomizedFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchTicketCustomizedFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新工单自定义字段,该接口用于更新自定义字段。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchTicketCustomizedFieldSample.java ; - */ - public PatchTicketCustomizedFieldResp patch(PatchTicketCustomizedFieldReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - PatchTicketCustomizedFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchTicketCustomizedFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public abstract static class P2NotificationApproveV1Handler implements IEventHandler { - @Override - public P2NotificationApproveV1 getEvent() { - return new P2NotificationApproveV1(); - } - } - - public abstract static class P2TicketCreatedV1Handler implements IEventHandler { - @Override - public P2TicketCreatedV1 getEvent() { - return new P2TicketCreatedV1(); - } - } - - public abstract static class P2TicketUpdatedV1Handler implements IEventHandler { - @Override - public P2TicketUpdatedV1 getEvent() { - return new P2TicketUpdatedV1(); - } - } - - public abstract static class P2TicketMessageCreatedV1Handler implements IEventHandler { - @Override - public P2TicketMessageCreatedV1 getEvent() { - return new P2TicketMessageCreatedV1(); - } - } -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/V1.java new file mode 100644 index 000000000..90157de1f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/V1.java @@ -0,0 +1,101 @@ +// Code generated by lark suite 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 com.lark.oapi.service.helpdesk.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.helpdesk.v1.resource.*; + +public class V1 { + private final Agent agent; // 客服 + private final AgentSchedules agentSchedules; // 客服工作日程 + private final AgentSchedule agentSchedule; // agent_schedule + private final AgentSkill agentSkill; // 客服技能 + private final AgentSkillRule agentSkillRule; // 客服技能规则 + private final BotMessage botMessage; // 机器人消息 + private final Category category; // 知识库分类 + private final Event event; // 事件订阅 + private final Faq faq; // 知识库 + private final Notification notification; // 推送中心 + private final Ticket ticket; // 工单 + private final TicketMessage ticketMessage; // 工单消息 + private final TicketCustomizedField ticketCustomizedField; // 工单自定义字段 + + public V1(Config config) { + this.agent = new Agent(config); + this.agentSchedules = new AgentSchedules(config); + this.agentSchedule = new AgentSchedule(config); + this.agentSkill = new AgentSkill(config); + this.agentSkillRule = new AgentSkillRule(config); + this.botMessage = new BotMessage(config); + this.category = new Category(config); + this.event = new Event(config); + this.faq = new Faq(config); + this.notification = new Notification(config); + this.ticket = new Ticket(config); + this.ticketMessage = new TicketMessage(config); + this.ticketCustomizedField = new TicketCustomizedField(config); + } + + public Agent agent() { + return agent; + } + + public AgentSchedules agentSchedules() { + return agentSchedules; + } + + public AgentSchedule agentSchedule() { + return agentSchedule; + } + + public AgentSkill agentSkill() { + return agentSkill; + } + + public AgentSkillRule agentSkillRule() { + return agentSkillRule; + } + + public BotMessage botMessage() { + return botMessage; + } + + public Category category() { + return category; + } + + public Event event() { + return event; + } + + public Faq faq() { + return faq; + } + + public Notification notification() { + return notification; + } + + public Ticket ticket() { + return ticket; + } + + public TicketMessage ticketMessage() { + return ticketMessage; + } + + public TicketCustomizedField ticketCustomizedField() { + return ticketCustomizedField; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/Agent.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/Agent.java new file mode 100644 index 000000000..b573f6e22 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/Agent.java @@ -0,0 +1,170 @@ +// Code generated by lark suite 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 com.lark.oapi.service.helpdesk.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.helpdesk.v1.model.AgentEmailAgentResp; +import com.lark.oapi.service.helpdesk.v1.model.PatchAgentReq; +import com.lark.oapi.service.helpdesk.v1.model.PatchAgentResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Agent { + private static final Logger log = LoggerFactory.getLogger(Agent.class); + private final Config config; + + public Agent(Config config) { + this.config = config; + } + + + /** + * 获取客服邮箱地址,该接口用于获取客服邮箱地址 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent/agent_email ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/AgentEmailAgentSample.java ; + */ + public AgentEmailAgentResp agentEmail(RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/agent_emails" + , Sets.newHashSet(AccessTokenType.Tenant) + , null); + + // 反序列化 + AgentEmailAgentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AgentEmailAgentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_emails" + , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + return resp; + } + + /** + * 获取客服邮箱地址,该接口用于获取客服邮箱地址 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent/agent_email ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/AgentEmailAgentSample.java ; + */ + public AgentEmailAgentResp agentEmail() throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/agent_emails" + , Sets.newHashSet(AccessTokenType.Tenant) + , null); + + // 反序列化 + AgentEmailAgentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AgentEmailAgentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_emails" + , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + return resp; + } + + /** + * 更新客服信息,更新客服状态等信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchAgentSample.java ; + */ + public PatchAgentResp patch(PatchAgentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/helpdesk/v1/agents/:agent_id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + PatchAgentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAgentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agents/:agent_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新客服信息,更新客服状态等信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchAgentSample.java ; + */ + public PatchAgentResp patch(PatchAgentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/helpdesk/v1/agents/:agent_id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + PatchAgentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAgentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agents/:agent_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/AgentSchedule.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/AgentSchedule.java new file mode 100644 index 000000000..94efa0ba7 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/AgentSchedule.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.helpdesk.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.helpdesk.v1.model.CreateAgentScheduleReq; +import com.lark.oapi.service.helpdesk.v1.model.CreateAgentScheduleResp; +import com.lark.oapi.service.helpdesk.v1.model.ListAgentScheduleReq; +import com.lark.oapi.service.helpdesk.v1.model.ListAgentScheduleResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class AgentSchedule { + private static final Logger log = LoggerFactory.getLogger(AgentSchedule.class); + private final Config config; + + public AgentSchedule(Config config) { + this.config = config; + } + + + /** + * 创建客服,该接口用于创建客服 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_schedule/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateAgentScheduleSample.java ; + */ + public CreateAgentScheduleResp create(CreateAgentScheduleReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/agent_schedules" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + CreateAgentScheduleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAgentScheduleResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_schedules" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建客服,该接口用于创建客服 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_schedule/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateAgentScheduleSample.java ; + */ + public CreateAgentScheduleResp create(CreateAgentScheduleReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/agent_schedules" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + CreateAgentScheduleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAgentScheduleResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_schedules" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取全部客服工作日程,该接口用于获取所有客服信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_schedule/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListAgentScheduleSample.java ; + */ + public ListAgentScheduleResp list(ListAgentScheduleReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/agent_schedules" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListAgentScheduleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAgentScheduleResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_schedules" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取全部客服工作日程,该接口用于获取所有客服信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_schedule/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListAgentScheduleSample.java ; + */ + public ListAgentScheduleResp list(ListAgentScheduleReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/agent_schedules" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListAgentScheduleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAgentScheduleResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_schedules" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/AgentSchedules.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/AgentSchedules.java new file mode 100644 index 000000000..2761d4f69 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/AgentSchedules.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.helpdesk.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.helpdesk.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class AgentSchedules { + private static final Logger log = LoggerFactory.getLogger(AgentSchedules.class); + private final Config config; + + public AgentSchedules(Config config) { + this.config = config; + } + + + /** + * 删除客服,该接口用于删除客服 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent-schedules/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteAgentSchedulesSample.java ; + */ + public DeleteAgentSchedulesResp delete(DeleteAgentSchedulesReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/helpdesk/v1/agents/:agent_id/schedules" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + DeleteAgentSchedulesResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAgentSchedulesResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agents/:agent_id/schedules" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除客服,该接口用于删除客服 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent-schedules/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteAgentSchedulesSample.java ; + */ + public DeleteAgentSchedulesResp delete(DeleteAgentSchedulesReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/helpdesk/v1/agents/:agent_id/schedules" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + DeleteAgentSchedulesResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAgentSchedulesResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agents/:agent_id/schedules" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取客服工作日程;,该接口用于获取客服信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent-schedules/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetAgentSchedulesSample.java ; + */ + public GetAgentSchedulesResp get(GetAgentSchedulesReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/agents/:agent_id/schedules" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetAgentSchedulesResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAgentSchedulesResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agents/:agent_id/schedules" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取客服工作日程;,该接口用于获取客服信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent-schedules/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetAgentSchedulesSample.java ; + */ + public GetAgentSchedulesResp get(GetAgentSchedulesReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/agents/:agent_id/schedules" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetAgentSchedulesResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAgentSchedulesResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agents/:agent_id/schedules" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新客服日程,该接口用于更新客服的日程 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent-schedules/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchAgentSchedulesSample.java ; + */ + public PatchAgentSchedulesResp patch(PatchAgentSchedulesReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/helpdesk/v1/agents/:agent_id/schedules" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + PatchAgentSchedulesResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAgentSchedulesResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agents/:agent_id/schedules" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新客服日程,该接口用于更新客服的日程 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent-schedules/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchAgentSchedulesSample.java ; + */ + public PatchAgentSchedulesResp patch(PatchAgentSchedulesReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/helpdesk/v1/agents/:agent_id/schedules" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + PatchAgentSchedulesResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAgentSchedulesResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agents/:agent_id/schedules" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/AgentSkill.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/AgentSkill.java new file mode 100644 index 000000000..c5d9f2655 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/AgentSkill.java @@ -0,0 +1,366 @@ +// Code generated by lark suite 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 com.lark.oapi.service.helpdesk.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.helpdesk.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class AgentSkill { + private static final Logger log = LoggerFactory.getLogger(AgentSkill.class); + private final Config config; + + public AgentSkill(Config config) { + this.config = config; + } + + + /** + * 创建客服技能,该接口用于创建客服技能 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateAgentSkillSample.java ; + */ + public CreateAgentSkillResp create(CreateAgentSkillReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/agent_skills" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + CreateAgentSkillResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAgentSkillResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_skills" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建客服技能,该接口用于创建客服技能 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateAgentSkillSample.java ; + */ + public CreateAgentSkillResp create(CreateAgentSkillReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/agent_skills" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + CreateAgentSkillResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAgentSkillResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_skills" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除客服技能,该接口用于删除客服技能 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteAgentSkillSample.java ; + */ + public DeleteAgentSkillResp delete(DeleteAgentSkillReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/helpdesk/v1/agent_skills/:agent_skill_id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + DeleteAgentSkillResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAgentSkillResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_skills/:agent_skill_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除客服技能,该接口用于删除客服技能 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteAgentSkillSample.java ; + */ + public DeleteAgentSkillResp delete(DeleteAgentSkillReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/helpdesk/v1/agent_skills/:agent_skill_id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + DeleteAgentSkillResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAgentSkillResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_skills/:agent_skill_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取客服技能,该接口用于获取客服技能 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetAgentSkillSample.java ; + */ + public GetAgentSkillResp get(GetAgentSkillReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/agent_skills/:agent_skill_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetAgentSkillResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAgentSkillResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_skills/:agent_skill_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取客服技能,该接口用于获取客服技能 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetAgentSkillSample.java ; + */ + public GetAgentSkillResp get(GetAgentSkillReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/agent_skills/:agent_skill_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetAgentSkillResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAgentSkillResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_skills/:agent_skill_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取全部客服技能,获取全部客服技能 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListAgentSkillSample.java ; + */ + public ListAgentSkillResp list(RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/agent_skills" + , Sets.newHashSet(AccessTokenType.Tenant) + , null); + + // 反序列化 + ListAgentSkillResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAgentSkillResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_skills" + , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + return resp; + } + + /** + * 获取全部客服技能,获取全部客服技能 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListAgentSkillSample.java ; + */ + public ListAgentSkillResp list() throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/agent_skills" + , Sets.newHashSet(AccessTokenType.Tenant) + , null); + + // 反序列化 + ListAgentSkillResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAgentSkillResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_skills" + , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + return resp; + } + + /** + * 更新客服技能,该接口用于更新客服技能 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchAgentSkillSample.java ; + */ + public PatchAgentSkillResp patch(PatchAgentSkillReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/helpdesk/v1/agent_skills/:agent_skill_id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + PatchAgentSkillResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAgentSkillResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_skills/:agent_skill_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新客服技能,该接口用于更新客服技能 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchAgentSkillSample.java ; + */ + public PatchAgentSkillResp patch(PatchAgentSkillReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/helpdesk/v1/agent_skills/:agent_skill_id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + PatchAgentSkillResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchAgentSkillResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_skills/:agent_skill_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/AgentSkillRule.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/AgentSkillRule.java new file mode 100644 index 000000000..8a866b504 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/AgentSkillRule.java @@ -0,0 +1,102 @@ +// Code generated by lark suite 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 com.lark.oapi.service.helpdesk.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.helpdesk.v1.model.ListAgentSkillRuleResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class AgentSkillRule { + private static final Logger log = LoggerFactory.getLogger(AgentSkillRule.class); + private final Config config; + + public AgentSkillRule(Config config) { + this.config = config; + } + + + /** + * 获取客服技能列表,该接口用于获取全部客服技能。仅支持自建应用。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill_rule/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListAgentSkillRuleSample.java ; + */ + public ListAgentSkillRuleResp list(RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/agent_skill_rules" + , Sets.newHashSet(AccessTokenType.Tenant) + , null); + + // 反序列化 + ListAgentSkillRuleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAgentSkillRuleResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_skill_rules" + , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + return resp; + } + + /** + * 获取客服技能列表,该接口用于获取全部客服技能。仅支持自建应用。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill_rule/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListAgentSkillRuleSample.java ; + */ + public ListAgentSkillRuleResp list() throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/agent_skill_rules" + , Sets.newHashSet(AccessTokenType.Tenant) + , null); + + // 反序列化 + ListAgentSkillRuleResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAgentSkillRuleResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/agent_skill_rules" + , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/BotMessage.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/BotMessage.java new file mode 100644 index 000000000..590d7abf6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/BotMessage.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.helpdesk.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.helpdesk.v1.model.CreateBotMessageReq; +import com.lark.oapi.service.helpdesk.v1.model.CreateBotMessageResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class BotMessage { + private static final Logger log = LoggerFactory.getLogger(BotMessage.class); + private final Config config; + + public BotMessage(Config config) { + this.config = config; + } + + + /** + * 服务台机器人发送消息,通过服务台机器人给指定用户的服务台专属群或私聊发送消息,支持文本、富文本、卡片、图片。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/bot-message/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateBotMessageSample.java ; + */ + public CreateBotMessageResp create(CreateBotMessageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/message" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateBotMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateBotMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/message" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 服务台机器人发送消息,通过服务台机器人给指定用户的服务台专属群或私聊发送消息,支持文本、富文本、卡片、图片。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/bot-message/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateBotMessageSample.java ; + */ + public CreateBotMessageResp create(CreateBotMessageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/message" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateBotMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateBotMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/message" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/Category.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/Category.java new file mode 100644 index 000000000..eef01e3e0 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/Category.java @@ -0,0 +1,368 @@ +// Code generated by lark suite 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 com.lark.oapi.service.helpdesk.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.helpdesk.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Category { + private static final Logger log = LoggerFactory.getLogger(Category.class); + private final Config config; + + public Category(Config config) { + this.config = config; + } + + + /** + * 创建知识库分类,该接口用于创建知识库分类。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateCategorySample.java ; + */ + public CreateCategoryResp create(CreateCategoryReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/categories" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + CreateCategoryResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCategoryResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/categories" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建知识库分类,该接口用于创建知识库分类。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateCategorySample.java ; + */ + public CreateCategoryResp create(CreateCategoryReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/categories" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + CreateCategoryResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCategoryResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/categories" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除知识库分类详情,该接口用于删除知识库分类详情。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteCategorySample.java ; + */ + public DeleteCategoryResp delete(DeleteCategoryReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/helpdesk/v1/categories/:id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + DeleteCategoryResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteCategoryResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/categories/:id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除知识库分类详情,该接口用于删除知识库分类详情。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteCategorySample.java ; + */ + public DeleteCategoryResp delete(DeleteCategoryReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/helpdesk/v1/categories/:id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + DeleteCategoryResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteCategoryResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/categories/:id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取知识库分类,该接口用于获取知识库分类。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetCategorySample.java ; + */ + public GetCategoryResp get(GetCategoryReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/categories/:id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetCategoryResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCategoryResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/categories/:id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取知识库分类,该接口用于获取知识库分类。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetCategorySample.java ; + */ + public GetCategoryResp get(GetCategoryReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/categories/:id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetCategoryResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCategoryResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/categories/:id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取全部知识库分类 - meta,该接口用于获取服务台知识库所有分类 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListCategorySample.java ; + */ + public ListCategoryResp list(ListCategoryReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/categories" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListCategoryResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCategoryResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/categories" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取全部知识库分类 - meta,该接口用于获取服务台知识库所有分类 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListCategorySample.java ; + */ + public ListCategoryResp list(ListCategoryReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/categories" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListCategoryResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCategoryResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/categories" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新知识库分类详情,该接口用于更新知识库分类详情。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchCategorySample.java ; + */ + public PatchCategoryResp patch(PatchCategoryReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/helpdesk/v1/categories/:id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + PatchCategoryResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchCategoryResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/categories/:id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新知识库分类详情,该接口用于更新知识库分类详情。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchCategorySample.java ; + */ + public PatchCategoryResp patch(PatchCategoryReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/helpdesk/v1/categories/:id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + PatchCategoryResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchCategoryResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/categories/:id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/Event.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/Event.java new file mode 100644 index 000000000..e1c27e145 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/Event.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.helpdesk.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.helpdesk.v1.model.SubscribeEventReq; +import com.lark.oapi.service.helpdesk.v1.model.SubscribeEventResp; +import com.lark.oapi.service.helpdesk.v1.model.UnsubscribeEventReq; +import com.lark.oapi.service.helpdesk.v1.model.UnsubscribeEventResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Event { + private static final Logger log = LoggerFactory.getLogger(Event.class); + private final Config config; + + public Event(Config config) { + this.config = config; + } + + + /** + * 订阅服务台事件,用于订阅服务台事件 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/event/subscribe ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/SubscribeEventSample.java ; + */ + public SubscribeEventResp subscribe(SubscribeEventReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/events/subscribe" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SubscribeEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscribeEventResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/events/subscribe" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 订阅服务台事件,用于订阅服务台事件 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/event/subscribe ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/SubscribeEventSample.java ; + */ + public SubscribeEventResp subscribe(SubscribeEventReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/events/subscribe" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SubscribeEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubscribeEventResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/events/subscribe" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 取消订阅服务台事件,用于取消订阅服务台事件 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/event/unsubscribe ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/UnsubscribeEventSample.java ; + */ + public UnsubscribeEventResp unsubscribe(UnsubscribeEventReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/events/unsubscribe" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UnsubscribeEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnsubscribeEventResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/events/unsubscribe" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 取消订阅服务台事件,用于取消订阅服务台事件 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/event/unsubscribe ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/UnsubscribeEventSample.java ; + */ + public UnsubscribeEventResp unsubscribe(UnsubscribeEventReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/events/unsubscribe" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UnsubscribeEventResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnsubscribeEventResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/events/unsubscribe" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/Faq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/Faq.java new file mode 100644 index 000000000..9c12a1bcc --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/Faq.java @@ -0,0 +1,522 @@ +// Code generated by lark suite 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 com.lark.oapi.service.helpdesk.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.helpdesk.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.ByteArrayOutputStream; +import java.nio.charset.StandardCharsets; + +public class Faq { + private static final Logger log = LoggerFactory.getLogger(Faq.class); + private final Config config; + + public Faq(Config config) { + this.config = config; + } + + + /** + * 创建知识库,该接口用于创建知识库。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateFaqSample.java ; + */ + public CreateFaqResp create(CreateFaqReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/faqs" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + CreateFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFaqResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建知识库,该接口用于创建知识库。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateFaqSample.java ; + */ + public CreateFaqResp create(CreateFaqReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/faqs" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + CreateFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFaqResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除知识库,该接口用于删除知识库。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteFaqSample.java ; + */ + public DeleteFaqResp delete(DeleteFaqReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/helpdesk/v1/faqs/:id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + DeleteFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteFaqResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs/:id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除知识库,该接口用于删除知识库。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteFaqSample.java ; + */ + public DeleteFaqResp delete(DeleteFaqReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/helpdesk/v1/faqs/:id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + DeleteFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteFaqResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs/:id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取知识库图像,该接口用于获取知识库图像。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/faq_image ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/FaqImageFaqSample.java ; + */ + public FaqImageFaqResp faqImage(FaqImageFaqReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/faqs/:id/image/:image_key" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + if (httpResponse.getStatusCode() == 200) { + FaqImageFaqResp resp = new FaqImageFaqResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + FaqImageFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, FaqImageFaqResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs/:id/image/:image_key" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取知识库图像,该接口用于获取知识库图像。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/faq_image ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/FaqImageFaqSample.java ; + */ + public FaqImageFaqResp faqImage(FaqImageFaqReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/faqs/:id/image/:image_key" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 下载请求,返回流 + if (httpResponse.getStatusCode() == 200) { + FaqImageFaqResp resp = new FaqImageFaqResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + FaqImageFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, FaqImageFaqResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs/:id/image/:image_key" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取知识库详情,该接口用于获取服务台知识库详情。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetFaqSample.java ; + */ + public GetFaqResp get(GetFaqReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/faqs/:id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFaqResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs/:id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取知识库详情,该接口用于获取服务台知识库详情。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetFaqSample.java ; + */ + public GetFaqResp get(GetFaqReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/faqs/:id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFaqResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs/:id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取全部知识库详情,该接口用于获取服务台知识库详情。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListFaqSample.java ; + */ + public ListFaqResp list(ListFaqReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/faqs" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFaqResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取全部知识库详情,该接口用于获取服务台知识库详情。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListFaqSample.java ; + */ + public ListFaqResp list(ListFaqReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/faqs" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListFaqResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改知识库,该接口用于修改知识库。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchFaqSample.java ; + */ + public PatchFaqResp patch(PatchFaqReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/helpdesk/v1/faqs/:id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + PatchFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchFaqResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs/:id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改知识库,该接口用于修改知识库。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchFaqSample.java ; + */ + public PatchFaqResp patch(PatchFaqReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/helpdesk/v1/faqs/:id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + PatchFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchFaqResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs/:id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 搜索知识库,该接口用于搜索服务台知识库。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/search ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/SearchFaqSample.java ; + */ + public SearchFaqResp search(SearchFaqReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/faqs/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchFaqResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 搜索知识库,该接口用于搜索服务台知识库。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/search ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/SearchFaqSample.java ; + */ + public SearchFaqResp search(SearchFaqReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/faqs/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchFaqResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchFaqResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/faqs/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/Notification.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/Notification.java new file mode 100644 index 000000000..68bfadf98 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/Notification.java @@ -0,0 +1,566 @@ +// Code generated by lark suite 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 com.lark.oapi.service.helpdesk.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.helpdesk.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Notification { + private static final Logger log = LoggerFactory.getLogger(Notification.class); + private final Config config; + + public Notification(Config config) { + this.config = config; + } + + + /** + * 取消审核,提交审核后,如果需要取消审核,则调用此接口 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/cancel_approve ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CancelApproveNotificationSample.java ; + */ + public CancelApproveNotificationResp cancelApprove(CancelApproveNotificationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/notifications/:notification_id/cancel_approve" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + CancelApproveNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CancelApproveNotificationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/cancel_approve" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 取消审核,提交审核后,如果需要取消审核,则调用此接口 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/cancel_approve ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CancelApproveNotificationSample.java ; + */ + public CancelApproveNotificationResp cancelApprove(CancelApproveNotificationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/notifications/:notification_id/cancel_approve" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + CancelApproveNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CancelApproveNotificationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/cancel_approve" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 取消推送,取消推送接口,审核通过后待调度可以调用,发送过程中可以调用(会撤回已发送的消息),发送完成后可以需要推送(会撤回所有已发送的消息) + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/cancel_send ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CancelSendNotificationSample.java ; + */ + public CancelSendNotificationResp cancelSend(CancelSendNotificationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/notifications/:notification_id/cancel_send" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + CancelSendNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CancelSendNotificationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/cancel_send" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 取消推送,取消推送接口,审核通过后待调度可以调用,发送过程中可以调用(会撤回已发送的消息),发送完成后可以需要推送(会撤回所有已发送的消息) + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/cancel_send ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CancelSendNotificationSample.java ; + */ + public CancelSendNotificationResp cancelSend(CancelSendNotificationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/notifications/:notification_id/cancel_send" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + CancelSendNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CancelSendNotificationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/cancel_send" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建推送,调用接口创建推送,创建成功后为草稿状态 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateNotificationSample.java ; + */ + public CreateNotificationResp create(CreateNotificationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/notifications" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + CreateNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateNotificationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建推送,调用接口创建推送,创建成功后为草稿状态 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateNotificationSample.java ; + */ + public CreateNotificationResp create(CreateNotificationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/notifications" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + CreateNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateNotificationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 执行推送,审核通过后调用此接口设置推送时间,等待调度系统调度,发送消息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/execute_send ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ExecuteSendNotificationSample.java ; + */ + public ExecuteSendNotificationResp executeSend(ExecuteSendNotificationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/notifications/:notification_id/execute_send" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + ExecuteSendNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ExecuteSendNotificationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/execute_send" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 执行推送,审核通过后调用此接口设置推送时间,等待调度系统调度,发送消息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/execute_send ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ExecuteSendNotificationSample.java ; + */ + public ExecuteSendNotificationResp executeSend(ExecuteSendNotificationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/notifications/:notification_id/execute_send" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + ExecuteSendNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ExecuteSendNotificationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/execute_send" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询推送,查询推送详情 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetNotificationSample.java ; + */ + public GetNotificationResp get(GetNotificationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/notifications/:notification_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetNotificationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询推送,查询推送详情 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetNotificationSample.java ; + */ + public GetNotificationResp get(GetNotificationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/notifications/:notification_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetNotificationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新推送,更新推送信息,只有在草稿状态下才可以调用此接口进行更新 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchNotificationSample.java ; + */ + public PatchNotificationResp patch(PatchNotificationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/helpdesk/v1/notifications/:notification_id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + PatchNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchNotificationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新推送,更新推送信息,只有在草稿状态下才可以调用此接口进行更新 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchNotificationSample.java ; + */ + public PatchNotificationResp patch(PatchNotificationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/helpdesk/v1/notifications/:notification_id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + PatchNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchNotificationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 预览推送内容,在正式执行推送之前是可以调用此接口预览设置的推送内容 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/preview ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PreviewNotificationSample.java ; + */ + public PreviewNotificationResp preview(PreviewNotificationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/notifications/:notification_id/preview" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + PreviewNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PreviewNotificationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/preview" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 预览推送内容,在正式执行推送之前是可以调用此接口预览设置的推送内容 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/preview ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PreviewNotificationSample.java ; + */ + public PreviewNotificationResp preview(PreviewNotificationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/notifications/:notification_id/preview" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + PreviewNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PreviewNotificationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/preview" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 提交审核,正常情况下调用创建推送接口后,就可以调用提交审核接口,如果创建人是服务台owner则会自动审核通过,否则会通知服务台owner审核此推送信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/submit_approve ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/SubmitApproveNotificationSample.java ; + */ + public SubmitApproveNotificationResp submitApprove(SubmitApproveNotificationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/notifications/:notification_id/submit_approve" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + SubmitApproveNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubmitApproveNotificationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/submit_approve" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 提交审核,正常情况下调用创建推送接口后,就可以调用提交审核接口,如果创建人是服务台owner则会自动审核通过,否则会通知服务台owner审核此推送信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/submit_approve ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/SubmitApproveNotificationSample.java ; + */ + public SubmitApproveNotificationResp submitApprove(SubmitApproveNotificationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/notifications/:notification_id/submit_approve" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + SubmitApproveNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubmitApproveNotificationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/submit_approve" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/Ticket.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/Ticket.java new file mode 100644 index 000000000..0eb425773 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/Ticket.java @@ -0,0 +1,522 @@ +// Code generated by lark suite 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 com.lark.oapi.service.helpdesk.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.helpdesk.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.ByteArrayOutputStream; +import java.nio.charset.StandardCharsets; + +public class Ticket { + private static final Logger log = LoggerFactory.getLogger(Ticket.class); + private final Config config; + + public Ticket(Config config) { + this.config = config; + } + + + /** + * 回复用户提问结果至工单,该接口用于回复用户提问结果至工单,需要工单仍处于进行中且未接入人工状态。仅支持自建应用。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/answer_user_query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/AnswerUserQueryTicketSample.java ; + */ + public AnswerUserQueryTicketResp answerUserQuery(AnswerUserQueryTicketReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/tickets/:ticket_id/answer_user_query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + AnswerUserQueryTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AnswerUserQueryTicketResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/tickets/:ticket_id/answer_user_query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 回复用户提问结果至工单,该接口用于回复用户提问结果至工单,需要工单仍处于进行中且未接入人工状态。仅支持自建应用。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/answer_user_query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/AnswerUserQueryTicketSample.java ; + */ + public AnswerUserQueryTicketResp answerUserQuery(AnswerUserQueryTicketReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/tickets/:ticket_id/answer_user_query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + AnswerUserQueryTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AnswerUserQueryTicketResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/tickets/:ticket_id/answer_user_query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取服务台自定义字段详情,该接口用于获取服务台自定义字段详情。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/customized_fields ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CustomizedFieldsTicketSample.java ; + */ + public CustomizedFieldsTicketResp customizedFields(CustomizedFieldsTicketReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/customized_fields" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CustomizedFieldsTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CustomizedFieldsTicketResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/customized_fields" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取服务台自定义字段详情,该接口用于获取服务台自定义字段详情。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/customized_fields ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CustomizedFieldsTicketSample.java ; + */ + public CustomizedFieldsTicketResp customizedFields(CustomizedFieldsTicketReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/customized_fields" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CustomizedFieldsTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CustomizedFieldsTicketResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/customized_fields" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取工单详情,该接口用于获取单个服务台工单详情。仅支持自建应用。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetTicketSample.java ; + */ + public GetTicketResp get(GetTicketReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/tickets/:ticket_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTicketResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/tickets/:ticket_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取工单详情,该接口用于获取单个服务台工单详情。仅支持自建应用。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetTicketSample.java ; + */ + public GetTicketResp get(GetTicketReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/tickets/:ticket_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTicketResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/tickets/:ticket_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取全部工单详情,该接口用于获取全部工单详情。仅支持自建应用。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListTicketSample.java ; + */ + public ListTicketResp list(ListTicketReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/tickets" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTicketResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/tickets" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取全部工单详情,该接口用于获取全部工单详情。仅支持自建应用。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListTicketSample.java ; + */ + public ListTicketResp list(ListTicketReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/tickets" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTicketResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/tickets" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建服务台对话,该接口用于创建服务台对话。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/start_service ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/StartServiceTicketSample.java ; + */ + public StartServiceTicketResp startService(StartServiceTicketReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/start_service" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + StartServiceTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, StartServiceTicketResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/start_service" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建服务台对话,该接口用于创建服务台对话。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/start_service ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/StartServiceTicketSample.java ; + */ + public StartServiceTicketResp startService(StartServiceTicketReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/start_service" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + StartServiceTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, StartServiceTicketResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/start_service" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取服务台工单内消息图像,该接口用于获取服务台工单消息图象。仅支持自建应用。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/ticket_image ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/TicketImageTicketSample.java ; + */ + public TicketImageTicketResp ticketImage(TicketImageTicketReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/ticket_images" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + if (httpResponse.getStatusCode() == 200) { + TicketImageTicketResp resp = new TicketImageTicketResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + TicketImageTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TicketImageTicketResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/ticket_images" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取服务台工单内消息图像,该接口用于获取服务台工单消息图象。仅支持自建应用。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/ticket_image ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/TicketImageTicketSample.java ; + */ + public TicketImageTicketResp ticketImage(TicketImageTicketReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/ticket_images" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 下载请求,返回流 + if (httpResponse.getStatusCode() == 200) { + TicketImageTicketResp resp = new TicketImageTicketResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + TicketImageTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TicketImageTicketResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/ticket_images" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新工单详情,该接口用于更新服务台工单详情。只会更新数据,不会触发相关操作。如修改工单状态到关单,不会关闭聊天页面。仅支持自建应用。要更新的工单字段必须至少输入一项。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/UpdateTicketSample.java ; + */ + public UpdateTicketResp update(UpdateTicketReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/helpdesk/v1/tickets/:ticket_id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + UpdateTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateTicketResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/tickets/:ticket_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新工单详情,该接口用于更新服务台工单详情。只会更新数据,不会触发相关操作。如修改工单状态到关单,不会关闭聊天页面。仅支持自建应用。要更新的工单字段必须至少输入一项。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/UpdateTicketSample.java ; + */ + public UpdateTicketResp update(UpdateTicketReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/helpdesk/v1/tickets/:ticket_id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + UpdateTicketResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateTicketResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/tickets/:ticket_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/TicketCustomizedField.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/TicketCustomizedField.java new file mode 100644 index 000000000..08d26eb04 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/TicketCustomizedField.java @@ -0,0 +1,368 @@ +// Code generated by lark suite 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 com.lark.oapi.service.helpdesk.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.helpdesk.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class TicketCustomizedField { + private static final Logger log = LoggerFactory.getLogger(TicketCustomizedField.class); + private final Config config; + + public TicketCustomizedField(Config config) { + this.config = config; + } + + + /** + * 创建工单自定义字段,该接口用于创建自定义字段 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateTicketCustomizedFieldSample.java ; + */ + public CreateTicketCustomizedFieldResp create(CreateTicketCustomizedFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/ticket_customized_fields" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + CreateTicketCustomizedFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTicketCustomizedFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/ticket_customized_fields" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建工单自定义字段,该接口用于创建自定义字段 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateTicketCustomizedFieldSample.java ; + */ + public CreateTicketCustomizedFieldResp create(CreateTicketCustomizedFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/ticket_customized_fields" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + CreateTicketCustomizedFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTicketCustomizedFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/ticket_customized_fields" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除工单自定义字段,该接口用于删除工单自定义字段。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteTicketCustomizedFieldSample.java ; + */ + public DeleteTicketCustomizedFieldResp delete(DeleteTicketCustomizedFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + DeleteTicketCustomizedFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTicketCustomizedFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除工单自定义字段,该接口用于删除工单自定义字段。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteTicketCustomizedFieldSample.java ; + */ + public DeleteTicketCustomizedFieldResp delete(DeleteTicketCustomizedFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + DeleteTicketCustomizedFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTicketCustomizedFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取工单自定义字段,该接口用于获取工单自定义字段详情。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetTicketCustomizedFieldSample.java ; + */ + public GetTicketCustomizedFieldResp get(GetTicketCustomizedFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetTicketCustomizedFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTicketCustomizedFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取工单自定义字段,该接口用于获取工单自定义字段详情。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetTicketCustomizedFieldSample.java ; + */ + public GetTicketCustomizedFieldResp get(GetTicketCustomizedFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetTicketCustomizedFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTicketCustomizedFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取全部工单自定义字段,该接口用于获取全部工单自定义字段。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListTicketCustomizedFieldSample.java ; + */ + public ListTicketCustomizedFieldResp list(ListTicketCustomizedFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/ticket_customized_fields" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListTicketCustomizedFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTicketCustomizedFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/ticket_customized_fields" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取全部工单自定义字段,该接口用于获取全部工单自定义字段。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListTicketCustomizedFieldSample.java ; + */ + public ListTicketCustomizedFieldResp list(ListTicketCustomizedFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/ticket_customized_fields" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListTicketCustomizedFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTicketCustomizedFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/ticket_customized_fields" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新工单自定义字段,该接口用于更新自定义字段。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchTicketCustomizedFieldSample.java ; + */ + public PatchTicketCustomizedFieldResp patch(PatchTicketCustomizedFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + PatchTicketCustomizedFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchTicketCustomizedFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新工单自定义字段,该接口用于更新自定义字段。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchTicketCustomizedFieldSample.java ; + */ + public PatchTicketCustomizedFieldResp patch(PatchTicketCustomizedFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + PatchTicketCustomizedFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchTicketCustomizedFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/TicketMessage.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/TicketMessage.java new file mode 100644 index 000000000..1dd9584fd --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/helpdesk/v1/resource/TicketMessage.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.helpdesk.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.helpdesk.v1.model.CreateTicketMessageReq; +import com.lark.oapi.service.helpdesk.v1.model.CreateTicketMessageResp; +import com.lark.oapi.service.helpdesk.v1.model.ListTicketMessageReq; +import com.lark.oapi.service.helpdesk.v1.model.ListTicketMessageResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class TicketMessage { + private static final Logger log = LoggerFactory.getLogger(TicketMessage.class); + private final Config config; + + public TicketMessage(Config config) { + this.config = config; + } + + + /** + * 工单发送消息,该接口用于工单发送消息。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket-message/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateTicketMessageSample.java ; + */ + public CreateTicketMessageResp create(CreateTicketMessageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/tickets/:ticket_id/messages" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateTicketMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTicketMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/tickets/:ticket_id/messages" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 工单发送消息,该接口用于工单发送消息。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket-message/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateTicketMessageSample.java ; + */ + public CreateTicketMessageResp create(CreateTicketMessageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/helpdesk/v1/tickets/:ticket_id/messages" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateTicketMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTicketMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/tickets/:ticket_id/messages" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取服务台工单消息详情,该接口用于获取服务台工单消息详情。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket-message/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListTicketMessageSample.java ; + */ + public ListTicketMessageResp list(ListTicketMessageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/tickets/:ticket_id/messages" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListTicketMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTicketMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/tickets/:ticket_id/messages" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取服务台工单消息详情,该接口用于获取服务台工单消息详情。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket-message/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListTicketMessageSample.java ; + */ + public ListTicketMessageResp list(ListTicketMessageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/helpdesk/v1/tickets/:ticket_id/messages" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListTicketMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTicketMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/tickets/:ticket_id/messages" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/HireService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/HireService.java new file mode 100644 index 000000000..61f82211c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/HireService.java @@ -0,0 +1,345 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire; + +import com.lark.oapi.core.Config; +import com.lark.oapi.event.IEventHandler; +import com.lark.oapi.service.hire.v1.V1; +import com.lark.oapi.service.hire.v1.model.*; +import com.lark.oapi.service.hire.v1.resource.Application; +import com.lark.oapi.service.hire.v1.resource.Attachment; +import com.lark.oapi.service.hire.v1.resource.EcoAccountCustomField; +import com.lark.oapi.service.hire.v1.resource.EcoBackgroundCheckCustomField; +import com.lark.oapi.service.hire.v1.resource.EcoBackgroundCheckPackage; +import com.lark.oapi.service.hire.v1.resource.EcoExamPaper; +import com.lark.oapi.service.hire.v1.resource.EhrImportTask; +import com.lark.oapi.service.hire.v1.resource.Employee; +import com.lark.oapi.service.hire.v1.resource.Evaluation; +import com.lark.oapi.service.hire.v1.resource.ExternalApplication; +import com.lark.oapi.service.hire.v1.resource.ExternalBackgroundCheck; +import com.lark.oapi.service.hire.v1.resource.ExternalInterview; +import com.lark.oapi.service.hire.v1.resource.ExternalInterviewAssessment; +import com.lark.oapi.service.hire.v1.resource.Interview; +import com.lark.oapi.service.hire.v1.resource.Job; +import com.lark.oapi.service.hire.v1.resource.JobManager; +import com.lark.oapi.service.hire.v1.resource.JobProcess; +import com.lark.oapi.service.hire.v1.resource.JobRequirement; +import com.lark.oapi.service.hire.v1.resource.JobRequirementSchema; +import com.lark.oapi.service.hire.v1.resource.JobType; +import com.lark.oapi.service.hire.v1.resource.Note; +import com.lark.oapi.service.hire.v1.resource.Offer; +import com.lark.oapi.service.hire.v1.resource.OfferSchema; +import com.lark.oapi.service.hire.v1.resource.Questionnaire; +import com.lark.oapi.service.hire.v1.resource.Referral; +import com.lark.oapi.service.hire.v1.resource.RegistrationSchema; +import com.lark.oapi.service.hire.v1.resource.ResumeSource; +import com.lark.oapi.service.hire.v1.resource.Talent; +import com.lark.oapi.service.hire.v1.resource.TalentFolder; +import com.lark.oapi.service.hire.v1.resource.*; + +public class HireService { + private final V1 v1; + private final Application application; // 投递 + private final ApplicationInterview applicationInterview; // application.interview + private final Attachment attachment; // 附件 + private final EcoAccount ecoAccount; // 事件 + private final EcoAccountCustomField ecoAccountCustomField; // 生态对接账号自定义字段 + private final EcoBackgroundCheck ecoBackgroundCheck; // 背调订单 + private final EcoBackgroundCheckCustomField ecoBackgroundCheckCustomField; // 背调自定义字段 + private final EcoBackgroundCheckPackage ecoBackgroundCheckPackage; // 背调套餐和附加调查项 + private final EcoExam ecoExam; // eco_exam + private final EcoExamPaper ecoExamPaper; // eco_exam_paper + private final EhrImportTask ehrImportTask; // 导入 e-HR + private final EhrImportTaskForInternshipOffer ehrImportTaskForInternshipOffer; // ehr_import_task_for_internship_offer + private final Employee employee; // 入职 + private final Evaluation evaluation; // 评估(灰度租户可见) + private final ExternalApplication externalApplication; // 导入外部系统信息(灰度租户可见) + private final ExternalBackgroundCheck externalBackgroundCheck; // 导入外部系统信息(灰度租户可见) + private final ExternalInterview externalInterview; // 导入外部系统信息(灰度租户可见) + private final ExternalInterviewAssessment externalInterviewAssessment; // 导入外部系统信息(灰度租户可见) + private final Interview interview; // 面试 + private final Job job; // 职位 + private final JobManager jobManager; // job.manager + private final JobProcess jobProcess; // 流程 + private final JobRequirement jobRequirement; // 招聘需求(灰度租户可见) + private final JobRequirementSchema jobRequirementSchema; // job_requirement_schema + private final JobType jobType; // job_type + private final Note note; // 备注 + private final Offer offer; // Offer + private final OfferSchema offerSchema; // offer_schema + private final Questionnaire questionnaire; // 问卷(灰度租户可见) + private final Referral referral; // 内推 + private final ReferralAccount referralAccount; // referral_account + private final ReferralWebsiteJobPost referralWebsiteJobPost; // referral_website.job_post + private final RegistrationSchema registrationSchema; // registration_schema + private final ResumeSource resumeSource; // 简历来源 + private final Talent talent; // 人才 + private final TalentFolder talentFolder; // talent_folder + private final TalentObject talentObject; // talent_object + + public HireService(Config config) { + this.v1 = new V1(config); + this.application = new Application(config); + this.applicationInterview = new ApplicationInterview(config); + this.attachment = new Attachment(config); + this.ecoAccount = new EcoAccount(config); + this.ecoAccountCustomField = new EcoAccountCustomField(config); + this.ecoBackgroundCheck = new EcoBackgroundCheck(config); + this.ecoBackgroundCheckCustomField = new EcoBackgroundCheckCustomField(config); + this.ecoBackgroundCheckPackage = new EcoBackgroundCheckPackage(config); + this.ecoExam = new EcoExam(config); + this.ecoExamPaper = new EcoExamPaper(config); + this.ehrImportTask = new EhrImportTask(config); + this.ehrImportTaskForInternshipOffer = new EhrImportTaskForInternshipOffer(config); + this.employee = new Employee(config); + this.evaluation = new Evaluation(config); + this.externalApplication = new ExternalApplication(config); + this.externalBackgroundCheck = new ExternalBackgroundCheck(config); + this.externalInterview = new ExternalInterview(config); + this.externalInterviewAssessment = new ExternalInterviewAssessment(config); + this.interview = new Interview(config); + this.job = new Job(config); + this.jobManager = new JobManager(config); + this.jobProcess = new JobProcess(config); + this.jobRequirement = new JobRequirement(config); + this.jobRequirementSchema = new JobRequirementSchema(config); + this.jobType = new JobType(config); + this.note = new Note(config); + this.offer = new Offer(config); + this.offerSchema = new OfferSchema(config); + this.questionnaire = new Questionnaire(config); + this.referral = new Referral(config); + this.referralAccount = new ReferralAccount(config); + this.referralWebsiteJobPost = new ReferralWebsiteJobPost(config); + this.registrationSchema = new RegistrationSchema(config); + this.resumeSource = new ResumeSource(config); + this.talent = new Talent(config); + this.talentFolder = new TalentFolder(config); + this.talentObject = new TalentObject(config); + } + + public V1 v1() { + return v1; + } + + public Application application() { + return application; + } + + public ApplicationInterview applicationInterview() { + return applicationInterview; + } + + public Attachment attachment() { + return attachment; + } + + public EcoAccount ecoAccount() { + return ecoAccount; + } + + public EcoAccountCustomField ecoAccountCustomField() { + return ecoAccountCustomField; + } + + public EcoBackgroundCheck ecoBackgroundCheck() { + return ecoBackgroundCheck; + } + + public EcoBackgroundCheckCustomField ecoBackgroundCheckCustomField() { + return ecoBackgroundCheckCustomField; + } + + public EcoBackgroundCheckPackage ecoBackgroundCheckPackage() { + return ecoBackgroundCheckPackage; + } + + public EcoExam ecoExam() { + return ecoExam; + } + + public EcoExamPaper ecoExamPaper() { + return ecoExamPaper; + } + + public EhrImportTask ehrImportTask() { + return ehrImportTask; + } + + public EhrImportTaskForInternshipOffer ehrImportTaskForInternshipOffer() { + return ehrImportTaskForInternshipOffer; + } + + public Employee employee() { + return employee; + } + + public Evaluation evaluation() { + return evaluation; + } + + public ExternalApplication externalApplication() { + return externalApplication; + } + + public ExternalBackgroundCheck externalBackgroundCheck() { + return externalBackgroundCheck; + } + + public ExternalInterview externalInterview() { + return externalInterview; + } + + public ExternalInterviewAssessment externalInterviewAssessment() { + return externalInterviewAssessment; + } + + public Interview interview() { + return interview; + } + + public Job job() { + return job; + } + + public JobManager jobManager() { + return jobManager; + } + + public JobProcess jobProcess() { + return jobProcess; + } + + public JobRequirement jobRequirement() { + return jobRequirement; + } + + public JobRequirementSchema jobRequirementSchema() { + return jobRequirementSchema; + } + + public JobType jobType() { + return jobType; + } + + public Note note() { + return note; + } + + public Offer offer() { + return offer; + } + + public OfferSchema offerSchema() { + return offerSchema; + } + + public Questionnaire questionnaire() { + return questionnaire; + } + + public Referral referral() { + return referral; + } + + public ReferralAccount referralAccount() { + return referralAccount; + } + + public ReferralWebsiteJobPost referralWebsiteJobPost() { + return referralWebsiteJobPost; + } + + public RegistrationSchema registrationSchema() { + return registrationSchema; + } + + public ResumeSource resumeSource() { + return resumeSource; + } + + public Talent talent() { + return talent; + } + + public TalentFolder talentFolder() { + return talentFolder; + } + + public TalentObject talentObject() { + return talentObject; + } + + public abstract static class P2ApplicationStageChangedV1Handler implements IEventHandler { + @Override + public P2ApplicationStageChangedV1 getEvent() { + return new P2ApplicationStageChangedV1(); + } + } + + public abstract static class P2EcoAccountCreatedV1Handler implements IEventHandler { + @Override + public P2EcoAccountCreatedV1 getEvent() { + return new P2EcoAccountCreatedV1(); + } + } + + public abstract static class P2EcoBackgroundCheckCanceledV1Handler implements IEventHandler { + @Override + public P2EcoBackgroundCheckCanceledV1 getEvent() { + return new P2EcoBackgroundCheckCanceledV1(); + } + } + + public abstract static class P2EcoBackgroundCheckCreatedV1Handler implements IEventHandler { + @Override + public P2EcoBackgroundCheckCreatedV1 getEvent() { + return new P2EcoBackgroundCheckCreatedV1(); + } + } + + public abstract static class P2EcoExamCreatedV1Handler implements IEventHandler { + @Override + public P2EcoExamCreatedV1 getEvent() { + return new P2EcoExamCreatedV1(); + } + } + + public abstract static class P2EhrImportTaskImportedV1Handler implements IEventHandler { + @Override + public P2EhrImportTaskImportedV1 getEvent() { + return new P2EhrImportTaskImportedV1(); + } + } + + public abstract static class P2EhrImportTaskForInternshipOfferImportedV1Handler implements IEventHandler { + @Override + public P2EhrImportTaskForInternshipOfferImportedV1 getEvent() { + return new P2EhrImportTaskForInternshipOfferImportedV1(); + } + } + + public abstract static class P2OfferStatusChangedV1Handler implements IEventHandler { + @Override + public P2OfferStatusChangedV1 getEvent() { + return new P2OfferStatusChangedV1(); + } + } + + public abstract static class P2ReferralAccountAssetsUpdateV1Handler implements IEventHandler { + @Override + public P2ReferralAccountAssetsUpdateV1 getEvent() { + return new P2ReferralAccountAssetsUpdateV1(); + } + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/HireService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/HireService.java deleted file mode 100644 index 634c3fee8..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/HireService.java +++ /dev/null @@ -1,5948 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.hire.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.event.IEventHandler; -import com.lark.oapi.service.hire.v1.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class HireService { - private static final Logger log = LoggerFactory.getLogger(HireService.class); - private final Application application; // 投递 - private final ApplicationInterview applicationInterview; // application.interview - private final Attachment attachment; // 附件 - private final EcoAccount ecoAccount; // 事件 - private final EcoAccountCustomField ecoAccountCustomField; // 生态对接账号自定义字段 - private final EcoBackgroundCheck ecoBackgroundCheck; // 背调订单 - private final EcoBackgroundCheckCustomField ecoBackgroundCheckCustomField; // 背调自定义字段 - private final EcoBackgroundCheckPackage ecoBackgroundCheckPackage; // 背调套餐和附加调查项 - private final EcoExam ecoExam; // eco_exam - private final EcoExamPaper ecoExamPaper; // eco_exam_paper - private final EhrImportTask ehrImportTask; // 导入 e-HR - private final EhrImportTaskForInternshipOffer ehrImportTaskForInternshipOffer; // ehr_import_task_for_internship_offer - private final Employee employee; // 入职 - private final Evaluation evaluation; // 评估(灰度租户可见) - private final ExternalApplication externalApplication; // 导入外部系统信息(灰度租户可见) - private final ExternalBackgroundCheck externalBackgroundCheck; // 导入外部系统信息(灰度租户可见) - private final ExternalInterview externalInterview; // 导入外部系统信息(灰度租户可见) - private final ExternalInterviewAssessment externalInterviewAssessment; // 导入外部系统信息(灰度租户可见) - private final Interview interview; // 面试 - private final Job job; // 职位 - private final JobManager jobManager; // job.manager - private final JobProcess jobProcess; // 流程 - private final JobRequirement jobRequirement; // 招聘需求(灰度租户可见) - private final JobRequirementSchema jobRequirementSchema; // job_requirement_schema - private final JobType jobType; // job_type - private final Note note; // 备注 - private final Offer offer; // Offer - private final OfferSchema offerSchema; // offer_schema - private final Questionnaire questionnaire; // 问卷(灰度租户可见) - private final Referral referral; // 内推 - private final ReferralAccount referralAccount; // referral_account - private final ReferralWebsiteJobPost referralWebsiteJobPost; // referral_website.job_post - private final RegistrationSchema registrationSchema; // registration_schema - private final ResumeSource resumeSource; // 简历来源 - private final Talent talent; // 人才 - private final TalentFolder talentFolder; // talent_folder - private final TalentObject talentObject; // talent_object - - public HireService(Config config) { - this.application = new Application(config); - this.applicationInterview = new ApplicationInterview(config); - this.attachment = new Attachment(config); - this.ecoAccount = new EcoAccount(config); - this.ecoAccountCustomField = new EcoAccountCustomField(config); - this.ecoBackgroundCheck = new EcoBackgroundCheck(config); - this.ecoBackgroundCheckCustomField = new EcoBackgroundCheckCustomField(config); - this.ecoBackgroundCheckPackage = new EcoBackgroundCheckPackage(config); - this.ecoExam = new EcoExam(config); - this.ecoExamPaper = new EcoExamPaper(config); - this.ehrImportTask = new EhrImportTask(config); - this.ehrImportTaskForInternshipOffer = new EhrImportTaskForInternshipOffer(config); - this.employee = new Employee(config); - this.evaluation = new Evaluation(config); - this.externalApplication = new ExternalApplication(config); - this.externalBackgroundCheck = new ExternalBackgroundCheck(config); - this.externalInterview = new ExternalInterview(config); - this.externalInterviewAssessment = new ExternalInterviewAssessment(config); - this.interview = new Interview(config); - this.job = new Job(config); - this.jobManager = new JobManager(config); - this.jobProcess = new JobProcess(config); - this.jobRequirement = new JobRequirement(config); - this.jobRequirementSchema = new JobRequirementSchema(config); - this.jobType = new JobType(config); - this.note = new Note(config); - this.offer = new Offer(config); - this.offerSchema = new OfferSchema(config); - this.questionnaire = new Questionnaire(config); - this.referral = new Referral(config); - this.referralAccount = new ReferralAccount(config); - this.referralWebsiteJobPost = new ReferralWebsiteJobPost(config); - this.registrationSchema = new RegistrationSchema(config); - this.resumeSource = new ResumeSource(config); - this.talent = new Talent(config); - this.talentFolder = new TalentFolder(config); - this.talentObject = new TalentObject(config); - } - - /** - * 投递 - * - * @return - */ - public Application application() { - return application; - } - - /** - * application.interview - * - * @return - */ - public ApplicationInterview applicationInterview() { - return applicationInterview; - } - - /** - * 附件 - * - * @return - */ - public Attachment attachment() { - return attachment; - } - - /** - * 事件 - * - * @return - */ - public EcoAccount ecoAccount() { - return ecoAccount; - } - - /** - * 生态对接账号自定义字段 - * - * @return - */ - public EcoAccountCustomField ecoAccountCustomField() { - return ecoAccountCustomField; - } - - /** - * 背调订单 - * - * @return - */ - public EcoBackgroundCheck ecoBackgroundCheck() { - return ecoBackgroundCheck; - } - - /** - * 背调自定义字段 - * - * @return - */ - public EcoBackgroundCheckCustomField ecoBackgroundCheckCustomField() { - return ecoBackgroundCheckCustomField; - } - - /** - * 背调套餐和附加调查项 - * - * @return - */ - public EcoBackgroundCheckPackage ecoBackgroundCheckPackage() { - return ecoBackgroundCheckPackage; - } - - /** - * eco_exam - * - * @return - */ - public EcoExam ecoExam() { - return ecoExam; - } - - /** - * eco_exam_paper - * - * @return - */ - public EcoExamPaper ecoExamPaper() { - return ecoExamPaper; - } - - /** - * 导入 e-HR - * - * @return - */ - public EhrImportTask ehrImportTask() { - return ehrImportTask; - } - - /** - * ehr_import_task_for_internship_offer - * - * @return - */ - public EhrImportTaskForInternshipOffer ehrImportTaskForInternshipOffer() { - return ehrImportTaskForInternshipOffer; - } - - /** - * 入职 - * - * @return - */ - public Employee employee() { - return employee; - } - - /** - * 评估(灰度租户可见) - * - * @return - */ - public Evaluation evaluation() { - return evaluation; - } - - /** - * 导入外部系统信息(灰度租户可见) - * - * @return - */ - public ExternalApplication externalApplication() { - return externalApplication; - } - - /** - * 导入外部系统信息(灰度租户可见) - * - * @return - */ - public ExternalBackgroundCheck externalBackgroundCheck() { - return externalBackgroundCheck; - } - - /** - * 导入外部系统信息(灰度租户可见) - * - * @return - */ - public ExternalInterview externalInterview() { - return externalInterview; - } - - /** - * 导入外部系统信息(灰度租户可见) - * - * @return - */ - public ExternalInterviewAssessment externalInterviewAssessment() { - return externalInterviewAssessment; - } - - /** - * 面试 - * - * @return - */ - public Interview interview() { - return interview; - } - - /** - * 职位 - * - * @return - */ - public Job job() { - return job; - } - - /** - * job.manager - * - * @return - */ - public JobManager jobManager() { - return jobManager; - } - - /** - * 流程 - * - * @return - */ - public JobProcess jobProcess() { - return jobProcess; - } - - /** - * 招聘需求(灰度租户可见) - * - * @return - */ - public JobRequirement jobRequirement() { - return jobRequirement; - } - - /** - * job_requirement_schema - * - * @return - */ - public JobRequirementSchema jobRequirementSchema() { - return jobRequirementSchema; - } - - /** - * job_type - * - * @return - */ - public JobType jobType() { - return jobType; - } - - /** - * 备注 - * - * @return - */ - public Note note() { - return note; - } - - /** - * Offer - * - * @return - */ - public Offer offer() { - return offer; - } - - /** - * offer_schema - * - * @return - */ - public OfferSchema offerSchema() { - return offerSchema; - } - - /** - * 问卷(灰度租户可见) - * - * @return - */ - public Questionnaire questionnaire() { - return questionnaire; - } - - /** - * 内推 - * - * @return - */ - public Referral referral() { - return referral; - } - - /** - * referral_account - * - * @return - */ - public ReferralAccount referralAccount() { - return referralAccount; - } - - /** - * referral_website.job_post - * - * @return - */ - public ReferralWebsiteJobPost referralWebsiteJobPost() { - return referralWebsiteJobPost; - } - - /** - * registration_schema - * - * @return - */ - public RegistrationSchema registrationSchema() { - return registrationSchema; - } - - /** - * 简历来源 - * - * @return - */ - public ResumeSource resumeSource() { - return resumeSource; - } - - /** - * 人才 - * - * @return - */ - public Talent talent() { - return talent; - } - - /** - * talent_folder - * - * @return - */ - public TalentFolder talentFolder() { - return talentFolder; - } - - /** - * talent_object - * - * @return - */ - public TalentObject talentObject() { - return talentObject; - } - - public static class Application { - private final Config config; - - public Application(Config config) { - this.config = config; - } - - /** - * 创建投递,根据人才 ID 和职位 ID 创建投递 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateApplicationSample.java ; - */ - public CreateApplicationResp create(CreateApplicationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/applications" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateApplicationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建投递,根据人才 ID 和职位 ID 创建投递 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateApplicationSample.java ; - */ - public CreateApplicationResp create(CreateApplicationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/applications" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateApplicationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取投递信息,根据投递 ID 获取单个投递信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetApplicationSample.java ; - */ - public GetApplicationResp get(GetApplicationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/applications/:application_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetApplicationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications/:application_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取投递信息,根据投递 ID 获取单个投递信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetApplicationSample.java ; - */ - public GetApplicationResp get(GetApplicationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/applications/:application_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetApplicationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications/:application_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取投递列表,根据限定条件获取投递列表信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListApplicationSample.java ; - */ - public ListApplicationResp list(ListApplicationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/applications" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListApplicationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取投递列表,根据限定条件获取投递列表信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListApplicationSample.java ; - */ - public ListApplicationResp list(ListApplicationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/applications" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListApplicationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取 Offer 信息,根据投递 ID 获取 Offer 信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/offer ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/OfferApplicationSample.java ; - */ - public OfferApplicationResp offer(OfferApplicationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/applications/:application_id/offer" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - OfferApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, OfferApplicationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications/:application_id/offer" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取 Offer 信息,根据投递 ID 获取 Offer 信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/offer ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/OfferApplicationSample.java ; - */ - public OfferApplicationResp offer(OfferApplicationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/applications/:application_id/offer" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - OfferApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, OfferApplicationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications/:application_id/offer" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 终止投递,根据投递 ID 修改投递状态为「已终止」 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/terminate ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/TerminateApplicationSample.java ; - */ - public TerminateApplicationResp terminate(TerminateApplicationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/applications/:application_id/terminate" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - TerminateApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TerminateApplicationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications/:application_id/terminate" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 终止投递,根据投递 ID 修改投递状态为「已终止」 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/terminate ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/TerminateApplicationSample.java ; - */ - public TerminateApplicationResp terminate(TerminateApplicationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/applications/:application_id/terminate" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - TerminateApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TerminateApplicationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications/:application_id/terminate" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 操作候选人入职,根据投递 ID 操作候选人入职并创建员工。投递须处于「待入职」阶段,可通过「转移阶段」接口变更投递状态 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/transfer_onboard ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/TransferOnboardApplicationSample.java ; - */ - public TransferOnboardApplicationResp transferOnboard(TransferOnboardApplicationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/applications/:application_id/transfer_onboard" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - TransferOnboardApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TransferOnboardApplicationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications/:application_id/transfer_onboard" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 操作候选人入职,根据投递 ID 操作候选人入职并创建员工。投递须处于「待入职」阶段,可通过「转移阶段」接口变更投递状态 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/transfer_onboard ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/TransferOnboardApplicationSample.java ; - */ - public TransferOnboardApplicationResp transferOnboard(TransferOnboardApplicationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/applications/:application_id/transfer_onboard" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - TransferOnboardApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TransferOnboardApplicationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications/:application_id/transfer_onboard" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ApplicationInterview { - private final Config config; - - public ApplicationInterview(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=application.interview&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListApplicationInterviewSample.java ; - */ - public ListApplicationInterviewResp list(ListApplicationInterviewReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/applications/:application_id/interviews" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListApplicationInterviewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListApplicationInterviewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications/:application_id/interviews" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=application.interview&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListApplicationInterviewSample.java ; - */ - public ListApplicationInterviewResp list(ListApplicationInterviewReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/applications/:application_id/interviews" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListApplicationInterviewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListApplicationInterviewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications/:application_id/interviews" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Attachment { - private final Config config; - - public Attachment(Config config) { - this.config = config; - } - - /** - * 获取附件信息,获取招聘系统中附件的元信息,比如文件名、创建时间、文件url等 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/attachment/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetAttachmentSample.java ; - */ - public GetAttachmentResp get(GetAttachmentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/attachments/:attachment_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetAttachmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAttachmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/attachments/:attachment_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取附件信息,获取招聘系统中附件的元信息,比如文件名、创建时间、文件url等 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/attachment/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetAttachmentSample.java ; - */ - public GetAttachmentResp get(GetAttachmentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/attachments/:attachment_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetAttachmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAttachmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/attachments/:attachment_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取附件预览信息,根据附件 ID 获取附件预览信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/attachment/preview ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PreviewAttachmentSample.java ; - */ - public PreviewAttachmentResp preview(PreviewAttachmentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/attachments/:attachment_id/preview" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PreviewAttachmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PreviewAttachmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/attachments/:attachment_id/preview" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取附件预览信息,根据附件 ID 获取附件预览信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/attachment/preview ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PreviewAttachmentSample.java ; - */ - public PreviewAttachmentResp preview(PreviewAttachmentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/attachments/:attachment_id/preview" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PreviewAttachmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PreviewAttachmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/attachments/:attachment_id/preview" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class EcoAccount { - private final Config config; - - public EcoAccount(Config config) { - this.config = config; - } - } - - public static class EcoAccountCustomField { - private final Config config; - - public EcoAccountCustomField(Config config) { - this.config = config; - } - - /** - * 删除帐号自定义字段,删除用户在服务商处的身份标示字段(如用户在服务商处的租户 ID)。删除后,不影响已添加帐号对应的自定义字段的值。但在添加新帐号时,将不能再使用此自定义字段。删除不支持撤销,对应的 key 将无法再次复用。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_account_custom_field/batch_delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoAccountCustomFieldSample.java ; - */ - public BatchDeleteEcoAccountCustomFieldResp batchDelete(BatchDeleteEcoAccountCustomFieldReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/eco_account_custom_fields/batch_delete" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchDeleteEcoAccountCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteEcoAccountCustomFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_account_custom_fields/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除帐号自定义字段,删除用户在服务商处的身份标示字段(如用户在服务商处的租户 ID)。删除后,不影响已添加帐号对应的自定义字段的值。但在添加新帐号时,将不能再使用此自定义字段。删除不支持撤销,对应的 key 将无法再次复用。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_account_custom_field/batch_delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoAccountCustomFieldSample.java ; - */ - public BatchDeleteEcoAccountCustomFieldResp batchDelete(BatchDeleteEcoAccountCustomFieldReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/eco_account_custom_fields/batch_delete" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchDeleteEcoAccountCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteEcoAccountCustomFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_account_custom_fields/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新帐号自定义字段,更新用户在服务商处的身份标示字段(如用户在服务商处的租户 ID),此方法只会更新同一 scope 内 key 一致的自定义字段。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_account_custom_field/batch_update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoAccountCustomFieldSample.java ; - */ - public BatchUpdateEcoAccountCustomFieldResp batchUpdate(BatchUpdateEcoAccountCustomFieldReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/hire/v1/eco_account_custom_fields/batch_update" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchUpdateEcoAccountCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUpdateEcoAccountCustomFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_account_custom_fields/batch_update" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新帐号自定义字段,更新用户在服务商处的身份标示字段(如用户在服务商处的租户 ID),此方法只会更新同一 scope 内 key 一致的自定义字段。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_account_custom_field/batch_update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoAccountCustomFieldSample.java ; - */ - public BatchUpdateEcoAccountCustomFieldResp batchUpdate(BatchUpdateEcoAccountCustomFieldReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/hire/v1/eco_account_custom_fields/batch_update" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchUpdateEcoAccountCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUpdateEcoAccountCustomFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_account_custom_fields/batch_update" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建帐号自定义字段,定制用户在服务商处的身份标示字段(如用户在服务商处的租户 ID)。用户在飞书招聘后台添加帐号后,系统会推送「帐号绑定」事件给开发者,事件将携带用户填写的自定义字段信息,开发者可根据此信息识别飞书招聘用户在服务商处的身份信息,完成飞书招聘用户和服务商帐号的绑定,并以此来推送对应的套餐或试卷列表等。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_account_custom_field/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoAccountCustomFieldSample.java ; - */ - public CreateEcoAccountCustomFieldResp create(CreateEcoAccountCustomFieldReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/eco_account_custom_fields" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateEcoAccountCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEcoAccountCustomFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_account_custom_fields" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建帐号自定义字段,定制用户在服务商处的身份标示字段(如用户在服务商处的租户 ID)。用户在飞书招聘后台添加帐号后,系统会推送「帐号绑定」事件给开发者,事件将携带用户填写的自定义字段信息,开发者可根据此信息识别飞书招聘用户在服务商处的身份信息,完成飞书招聘用户和服务商帐号的绑定,并以此来推送对应的套餐或试卷列表等。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_account_custom_field/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoAccountCustomFieldSample.java ; - */ - public CreateEcoAccountCustomFieldResp create(CreateEcoAccountCustomFieldReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/eco_account_custom_fields" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateEcoAccountCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEcoAccountCustomFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_account_custom_fields" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class EcoBackgroundCheck { - private final Config config; - - public EcoBackgroundCheck(Config config) { - this.config = config; - } - - /** - * 终止背调订单,终止背调订单 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check/cancel ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CancelEcoBackgroundCheckSample.java ; - */ - public CancelEcoBackgroundCheckResp cancel(CancelEcoBackgroundCheckReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/eco_background_checks/cancel" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CancelEcoBackgroundCheckResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CancelEcoBackgroundCheckResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_checks/cancel" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 终止背调订单,终止背调订单 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check/cancel ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CancelEcoBackgroundCheckSample.java ; - */ - public CancelEcoBackgroundCheckResp cancel(CancelEcoBackgroundCheckReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/eco_background_checks/cancel" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CancelEcoBackgroundCheckResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CancelEcoBackgroundCheckResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_checks/cancel" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新背调进度,更新指定背调的进度信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check/update_progress ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateProgressEcoBackgroundCheckSample.java ; - */ - public UpdateProgressEcoBackgroundCheckResp updateProgress(UpdateProgressEcoBackgroundCheckReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/eco_background_checks/update_progress" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateProgressEcoBackgroundCheckResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateProgressEcoBackgroundCheckResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_checks/update_progress" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新背调进度,更新指定背调的进度信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check/update_progress ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateProgressEcoBackgroundCheckSample.java ; - */ - public UpdateProgressEcoBackgroundCheckResp updateProgress(UpdateProgressEcoBackgroundCheckReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/eco_background_checks/update_progress" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateProgressEcoBackgroundCheckResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateProgressEcoBackgroundCheckResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_checks/update_progress" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 回传背调的最终结果,回传背调的最终结果 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check/update_result ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateResultEcoBackgroundCheckSample.java ; - */ - public UpdateResultEcoBackgroundCheckResp updateResult(UpdateResultEcoBackgroundCheckReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/eco_background_checks/update_result" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateResultEcoBackgroundCheckResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateResultEcoBackgroundCheckResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_checks/update_result" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 回传背调的最终结果,回传背调的最终结果 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check/update_result ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateResultEcoBackgroundCheckSample.java ; - */ - public UpdateResultEcoBackgroundCheckResp updateResult(UpdateResultEcoBackgroundCheckReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/eco_background_checks/update_result" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateResultEcoBackgroundCheckResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateResultEcoBackgroundCheckResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_checks/update_result" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class EcoBackgroundCheckCustomField { - private final Config config; - - public EcoBackgroundCheckCustomField(Config config) { - this.config = config; - } - - /** - * 删除背调自定义字段,删除用户在发起背调时的自定义字段,删除不影响已创建的背调,删除后对应的自定义字段的 key 不能再复用。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_custom_field/batch_delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoBackgroundCheckCustomFieldSample.java ; - */ - public BatchDeleteEcoBackgroundCheckCustomFieldResp batchDelete(BatchDeleteEcoBackgroundCheckCustomFieldReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/eco_background_check_custom_fields/batch_delete" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchDeleteEcoBackgroundCheckCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteEcoBackgroundCheckCustomFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_check_custom_fields/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除背调自定义字段,删除用户在发起背调时的自定义字段,删除不影响已创建的背调,删除后对应的自定义字段的 key 不能再复用。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_custom_field/batch_delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoBackgroundCheckCustomFieldSample.java ; - */ - public BatchDeleteEcoBackgroundCheckCustomFieldResp batchDelete(BatchDeleteEcoBackgroundCheckCustomFieldReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/eco_background_check_custom_fields/batch_delete" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchDeleteEcoBackgroundCheckCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteEcoBackgroundCheckCustomFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_check_custom_fields/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新背调自定义字段,更新用户在发起背调时的自定义字段。更新操作不支持更新自定义字段类型,且将影响已发起的背调表单展示。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_custom_field/batch_update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoBackgroundCheckCustomFieldSample.java ; - */ - public BatchUpdateEcoBackgroundCheckCustomFieldResp batchUpdate(BatchUpdateEcoBackgroundCheckCustomFieldReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/hire/v1/eco_background_check_custom_fields/batch_update" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchUpdateEcoBackgroundCheckCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUpdateEcoBackgroundCheckCustomFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_check_custom_fields/batch_update" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新背调自定义字段,更新用户在发起背调时的自定义字段。更新操作不支持更新自定义字段类型,且将影响已发起的背调表单展示。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_custom_field/batch_update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoBackgroundCheckCustomFieldSample.java ; - */ - public BatchUpdateEcoBackgroundCheckCustomFieldResp batchUpdate(BatchUpdateEcoBackgroundCheckCustomFieldReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/hire/v1/eco_background_check_custom_fields/batch_update" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchUpdateEcoBackgroundCheckCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUpdateEcoBackgroundCheckCustomFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_check_custom_fields/batch_update" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建背调自定义字段,定制用户在发起背调时的自定义字段 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_custom_field/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoBackgroundCheckCustomFieldSample.java ; - */ - public CreateEcoBackgroundCheckCustomFieldResp create(CreateEcoBackgroundCheckCustomFieldReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/eco_background_check_custom_fields" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateEcoBackgroundCheckCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEcoBackgroundCheckCustomFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_check_custom_fields" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建背调自定义字段,定制用户在发起背调时的自定义字段 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_custom_field/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoBackgroundCheckCustomFieldSample.java ; - */ - public CreateEcoBackgroundCheckCustomFieldResp create(CreateEcoBackgroundCheckCustomFieldReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/eco_background_check_custom_fields" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateEcoBackgroundCheckCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEcoBackgroundCheckCustomFieldResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_check_custom_fields" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class EcoBackgroundCheckPackage { - private final Config config; - - public EcoBackgroundCheckPackage(Config config) { - this.config = config; - } - - /** - * 删除背调套餐和附加调查项,删除指定帐号的指定背调套餐和附加调查项信息,删除不会影响已创建的背调。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_package/batch_delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoBackgroundCheckPackageSample.java ; - */ - public BatchDeleteEcoBackgroundCheckPackageResp batchDelete(BatchDeleteEcoBackgroundCheckPackageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/eco_background_check_packages/batch_delete" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchDeleteEcoBackgroundCheckPackageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteEcoBackgroundCheckPackageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_check_packages/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除背调套餐和附加调查项,删除指定帐号的指定背调套餐和附加调查项信息,删除不会影响已创建的背调。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_package/batch_delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoBackgroundCheckPackageSample.java ; - */ - public BatchDeleteEcoBackgroundCheckPackageResp batchDelete(BatchDeleteEcoBackgroundCheckPackageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/eco_background_check_packages/batch_delete" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchDeleteEcoBackgroundCheckPackageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteEcoBackgroundCheckPackageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_check_packages/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新背调套餐和附加调查项,更新指定帐号可用的背调套餐和附加调查项信息,更新将影响已发起背调的表单项展示 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_package/batch_update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoBackgroundCheckPackageSample.java ; - */ - public BatchUpdateEcoBackgroundCheckPackageResp batchUpdate(BatchUpdateEcoBackgroundCheckPackageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/hire/v1/eco_background_check_packages/batch_update" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchUpdateEcoBackgroundCheckPackageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUpdateEcoBackgroundCheckPackageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_check_packages/batch_update" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新背调套餐和附加调查项,更新指定帐号可用的背调套餐和附加调查项信息,更新将影响已发起背调的表单项展示 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_package/batch_update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoBackgroundCheckPackageSample.java ; - */ - public BatchUpdateEcoBackgroundCheckPackageResp batchUpdate(BatchUpdateEcoBackgroundCheckPackageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/hire/v1/eco_background_check_packages/batch_update" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchUpdateEcoBackgroundCheckPackageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUpdateEcoBackgroundCheckPackageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_check_packages/batch_update" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 推送背调套餐和附加调查项,定制指定帐号可用的背调套餐和附加调查项信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_package/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoBackgroundCheckPackageSample.java ; - */ - public CreateEcoBackgroundCheckPackageResp create(CreateEcoBackgroundCheckPackageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/eco_background_check_packages" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateEcoBackgroundCheckPackageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEcoBackgroundCheckPackageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_check_packages" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 推送背调套餐和附加调查项,定制指定帐号可用的背调套餐和附加调查项信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_package/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoBackgroundCheckPackageSample.java ; - */ - public CreateEcoBackgroundCheckPackageResp create(CreateEcoBackgroundCheckPackageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/eco_background_check_packages" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateEcoBackgroundCheckPackageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEcoBackgroundCheckPackageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_check_packages" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class EcoExam { - private final Config config; - - public EcoExam(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=login_info&project=hire&resource=eco_exam&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/LoginInfoEcoExamSample.java ; - */ - public LoginInfoEcoExamResp loginInfo(LoginInfoEcoExamReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/eco_exams/:exam_id/login_info" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - LoginInfoEcoExamResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, LoginInfoEcoExamResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_exams/:exam_id/login_info" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=login_info&project=hire&resource=eco_exam&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/LoginInfoEcoExamSample.java ; - */ - public LoginInfoEcoExamResp loginInfo(LoginInfoEcoExamReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/eco_exams/:exam_id/login_info" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - LoginInfoEcoExamResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, LoginInfoEcoExamResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_exams/:exam_id/login_info" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_result&project=hire&resource=eco_exam&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateResultEcoExamSample.java ; - */ - public UpdateResultEcoExamResp updateResult(UpdateResultEcoExamReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/eco_exams/:exam_id/update_result" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateResultEcoExamResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateResultEcoExamResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_exams/:exam_id/update_result" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_result&project=hire&resource=eco_exam&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateResultEcoExamSample.java ; - */ - public UpdateResultEcoExamResp updateResult(UpdateResultEcoExamReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/eco_exams/:exam_id/update_result" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateResultEcoExamResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateResultEcoExamResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_exams/:exam_id/update_result" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class EcoExamPaper { - private final Config config; - - public EcoExamPaper(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=hire&resource=eco_exam_paper&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoExamPaperSample.java ; - */ - public BatchDeleteEcoExamPaperResp batchDelete(BatchDeleteEcoExamPaperReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/eco_exam_papers/batch_delete" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchDeleteEcoExamPaperResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteEcoExamPaperResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_exam_papers/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=hire&resource=eco_exam_paper&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoExamPaperSample.java ; - */ - public BatchDeleteEcoExamPaperResp batchDelete(BatchDeleteEcoExamPaperReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/eco_exam_papers/batch_delete" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchDeleteEcoExamPaperResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteEcoExamPaperResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_exam_papers/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_update&project=hire&resource=eco_exam_paper&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoExamPaperSample.java ; - */ - public BatchUpdateEcoExamPaperResp batchUpdate(BatchUpdateEcoExamPaperReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/hire/v1/eco_exam_papers/batch_update" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchUpdateEcoExamPaperResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUpdateEcoExamPaperResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_exam_papers/batch_update" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_update&project=hire&resource=eco_exam_paper&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoExamPaperSample.java ; - */ - public BatchUpdateEcoExamPaperResp batchUpdate(BatchUpdateEcoExamPaperReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/hire/v1/eco_exam_papers/batch_update" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchUpdateEcoExamPaperResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUpdateEcoExamPaperResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_exam_papers/batch_update" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=hire&resource=eco_exam_paper&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoExamPaperSample.java ; - */ - public CreateEcoExamPaperResp create(CreateEcoExamPaperReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/eco_exam_papers" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateEcoExamPaperResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEcoExamPaperResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_exam_papers" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=hire&resource=eco_exam_paper&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoExamPaperSample.java ; - */ - public CreateEcoExamPaperResp create(CreateEcoExamPaperReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/eco_exam_papers" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateEcoExamPaperResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEcoExamPaperResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_exam_papers" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class EhrImportTask { - private final Config config; - - public EhrImportTask(Config config) { - this.config = config; - } - - /** - * 更新 e-HR 导入任务结果,在处理完导入 e-HR 事件后,可调用该接口,更新 e-HR 导入任务结果 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/ehr_import_task/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PatchEhrImportTaskSample.java ; - */ - public PatchEhrImportTaskResp patch(PatchEhrImportTaskReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/hire/v1/ehr_import_tasks/:ehr_import_task_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchEhrImportTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchEhrImportTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/ehr_import_tasks/:ehr_import_task_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新 e-HR 导入任务结果,在处理完导入 e-HR 事件后,可调用该接口,更新 e-HR 导入任务结果 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/ehr_import_task/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PatchEhrImportTaskSample.java ; - */ - public PatchEhrImportTaskResp patch(PatchEhrImportTaskReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/hire/v1/ehr_import_tasks/:ehr_import_task_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchEhrImportTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchEhrImportTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/ehr_import_tasks/:ehr_import_task_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class EhrImportTaskForInternshipOffer { - private final Config config; - - public EhrImportTaskForInternshipOffer(Config config) { - this.config = config; - } - } - - public static class Employee { - private final Config config; - - public Employee(Config config) { - this.config = config; - } - - /** - * 通过员工 ID 获取入职信息,通过员工 ID 获取入职信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/employee/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetEmployeeSample.java ; - */ - public GetEmployeeResp get(GetEmployeeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/employees/:employee_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetEmployeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetEmployeeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/employees/:employee_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 通过员工 ID 获取入职信息,通过员工 ID 获取入职信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/employee/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetEmployeeSample.java ; - */ - public GetEmployeeResp get(GetEmployeeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/employees/:employee_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetEmployeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetEmployeeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/employees/:employee_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 通过投递 ID 获取入职信息,通过投递 ID 获取入职信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/employee/get_by_application ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetByApplicationEmployeeSample.java ; - */ - public GetByApplicationEmployeeResp getByApplication(GetByApplicationEmployeeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/employees/get_by_application" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetByApplicationEmployeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetByApplicationEmployeeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/employees/get_by_application" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 通过投递 ID 获取入职信息,通过投递 ID 获取入职信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/employee/get_by_application ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetByApplicationEmployeeSample.java ; - */ - public GetByApplicationEmployeeResp getByApplication(GetByApplicationEmployeeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/employees/get_by_application" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetByApplicationEmployeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetByApplicationEmployeeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/employees/get_by_application" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新入职状态,根据员工 ID 更新员工转正、离职状态 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/employee/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PatchEmployeeSample.java ; - */ - public PatchEmployeeResp patch(PatchEmployeeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/hire/v1/employees/:employee_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchEmployeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchEmployeeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/employees/:employee_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新入职状态,根据员工 ID 更新员工转正、离职状态 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/employee/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PatchEmployeeSample.java ; - */ - public PatchEmployeeResp patch(PatchEmployeeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/hire/v1/employees/:employee_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchEmployeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchEmployeeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/employees/:employee_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Evaluation { - private final Config config; - - public Evaluation(Config config) { - this.config = config; - } - - /** - * 获取简历评估信息,获取简历评估信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/evaluation/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListEvaluationSample.java ; - */ - public ListEvaluationResp list(ListEvaluationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/evaluations" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListEvaluationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListEvaluationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/evaluations" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取简历评估信息,获取简历评估信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/evaluation/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListEvaluationSample.java ; - */ - public ListEvaluationResp list(ListEvaluationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/evaluations" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListEvaluationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListEvaluationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/evaluations" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ExternalApplication { - private final Config config; - - public ExternalApplication(Config config) { - this.config = config; - } - - /** - * 创建外部投递,导入来自其他系统的投递信息,创建为外部投递 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/external_application/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalApplicationSample.java ; - */ - public CreateExternalApplicationResp create(CreateExternalApplicationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/external_applications" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateExternalApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExternalApplicationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/external_applications" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建外部投递,导入来自其他系统的投递信息,创建为外部投递 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/external_application/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalApplicationSample.java ; - */ - public CreateExternalApplicationResp create(CreateExternalApplicationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/external_applications" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateExternalApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExternalApplicationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/external_applications" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * ,删除外部投递 - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=hire&resource=external_application&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/DeleteExternalApplicationSample.java ; - */ - public DeleteExternalApplicationResp delete(DeleteExternalApplicationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/hire/v1/external_applications/:external_application_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteExternalApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteExternalApplicationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/external_applications/:external_application_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * ,删除外部投递 - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=hire&resource=external_application&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/DeleteExternalApplicationSample.java ; - */ - public DeleteExternalApplicationResp delete(DeleteExternalApplicationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/hire/v1/external_applications/:external_application_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteExternalApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteExternalApplicationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/external_applications/:external_application_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * ,更新外部投递 - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=hire&resource=external_application&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateExternalApplicationSample.java ; - */ - public UpdateExternalApplicationResp update(UpdateExternalApplicationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/hire/v1/external_applications/:external_application_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateExternalApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateExternalApplicationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/external_applications/:external_application_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * ,更新外部投递 - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=hire&resource=external_application&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateExternalApplicationSample.java ; - */ - public UpdateExternalApplicationResp update(UpdateExternalApplicationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/hire/v1/external_applications/:external_application_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateExternalApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateExternalApplicationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/external_applications/:external_application_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ExternalBackgroundCheck { - private final Config config; - - public ExternalBackgroundCheck(Config config) { - this.config = config; - } - - /** - * 创建外部背调,导入来自其他系统的背调信息,创建为外部背调 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/external_background_check/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalBackgroundCheckSample.java ; - */ - public CreateExternalBackgroundCheckResp create(CreateExternalBackgroundCheckReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/external_background_checks" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateExternalBackgroundCheckResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExternalBackgroundCheckResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/external_background_checks" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建外部背调,导入来自其他系统的背调信息,创建为外部背调 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/external_background_check/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalBackgroundCheckSample.java ; - */ - public CreateExternalBackgroundCheckResp create(CreateExternalBackgroundCheckReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/external_background_checks" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateExternalBackgroundCheckResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExternalBackgroundCheckResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/external_background_checks" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ExternalInterview { - private final Config config; - - public ExternalInterview(Config config) { - this.config = config; - } - - /** - * 创建外部面试,导入来自其他系统的面试信息,创建为外部面试 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/external_interview/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalInterviewSample.java ; - */ - public CreateExternalInterviewResp create(CreateExternalInterviewReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/external_interviews" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateExternalInterviewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExternalInterviewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/external_interviews" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建外部面试,导入来自其他系统的面试信息,创建为外部面试 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/external_interview/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalInterviewSample.java ; - */ - public CreateExternalInterviewResp create(CreateExternalInterviewReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/external_interviews" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateExternalInterviewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExternalInterviewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/external_interviews" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ExternalInterviewAssessment { - private final Config config; - - public ExternalInterviewAssessment(Config config) { - this.config = config; - } - - /** - * 创建外部面评,导入来自其他系统的面评信息,创建为外部面评 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/external_interview_assessment/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalInterviewAssessmentSample.java ; - */ - public CreateExternalInterviewAssessmentResp create(CreateExternalInterviewAssessmentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/external_interview_assessments" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateExternalInterviewAssessmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExternalInterviewAssessmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/external_interview_assessments" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建外部面评,导入来自其他系统的面评信息,创建为外部面评 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/external_interview_assessment/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalInterviewAssessmentSample.java ; - */ - public CreateExternalInterviewAssessmentResp create(CreateExternalInterviewAssessmentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/external_interview_assessments" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateExternalInterviewAssessmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExternalInterviewAssessmentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/external_interview_assessments" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Interview { - private final Config config; - - public Interview(Config config) { - this.config = config; - } - - /** - * 获取面试信息,根据投递 ID 或面试时间获取面试信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/interview/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListInterviewSample.java ; - */ - public ListInterviewResp list(ListInterviewReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/interviews" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListInterviewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListInterviewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/interviews" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取面试信息,根据投递 ID 或面试时间获取面试信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/interview/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListInterviewSample.java ; - */ - public ListInterviewResp list(ListInterviewReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/interviews" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListInterviewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListInterviewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/interviews" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Job { - private final Config config; - - public Job(Config config) { - this.config = config; - } - - /** - * 新建职位,新建职位,字段的是否必填,以系统中的「职位字段管理」中的设置为准。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/combined_create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CombinedCreateJobSample.java ; - */ - public CombinedCreateJobResp combinedCreate(CombinedCreateJobReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/jobs/combined_create" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CombinedCreateJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CombinedCreateJobResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/jobs/combined_create" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 新建职位,新建职位,字段的是否必填,以系统中的「职位字段管理」中的设置为准。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/combined_create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CombinedCreateJobSample.java ; - */ - public CombinedCreateJobResp combinedCreate(CombinedCreateJobReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/jobs/combined_create" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CombinedCreateJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CombinedCreateJobResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/jobs/combined_create" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新职位,更新职位信息,该接口为全量更新,若字段没有返回值,则原有值将会被清空。字段的是否必填,将以系统中的「职位字段管理」中的设置为准。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/combined_update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CombinedUpdateJobSample.java ; - */ - public CombinedUpdateJobResp combinedUpdate(CombinedUpdateJobReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/jobs/:job_id/combined_update" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CombinedUpdateJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CombinedUpdateJobResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/jobs/:job_id/combined_update" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新职位,更新职位信息,该接口为全量更新,若字段没有返回值,则原有值将会被清空。字段的是否必填,将以系统中的「职位字段管理」中的设置为准。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/combined_update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CombinedUpdateJobSample.java ; - */ - public CombinedUpdateJobResp combinedUpdate(CombinedUpdateJobReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/jobs/:job_id/combined_update" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CombinedUpdateJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CombinedUpdateJobResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/jobs/:job_id/combined_update" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取职位设置,获取职位设置 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/config ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ConfigJobSample.java ; - */ - public ConfigJobResp config(ConfigJobReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/jobs/:job_id/config" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ConfigJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ConfigJobResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/jobs/:job_id/config" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取职位设置,获取职位设置 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/config ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ConfigJobSample.java ; - */ - public ConfigJobResp config(ConfigJobReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/jobs/:job_id/config" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ConfigJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ConfigJobResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/jobs/:job_id/config" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取职位信息,根据职位 ID 获取职位信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetJobSample.java ; - */ - public GetJobResp get(GetJobReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/jobs/:job_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/jobs/:job_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取职位信息,根据职位 ID 获取职位信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetJobSample.java ; - */ - public GetJobResp get(GetJobReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/jobs/:job_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/jobs/:job_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新职位设置,更新职位设置,包括面试评价表、Offer 申请表等。接口将按照所选择的「更新选项」进行设置参数校验和更新。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/update_config ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateConfigJobSample.java ; - */ - public UpdateConfigJobResp updateConfig(UpdateConfigJobReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/jobs/:job_id/update_config" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateConfigJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateConfigJobResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/jobs/:job_id/update_config" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新职位设置,更新职位设置,包括面试评价表、Offer 申请表等。接口将按照所选择的「更新选项」进行设置参数校验和更新。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/update_config ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateConfigJobSample.java ; - */ - public UpdateConfigJobResp updateConfig(UpdateConfigJobReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/jobs/:job_id/update_config" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateConfigJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateConfigJobResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/jobs/:job_id/update_config" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class JobManager { - private final Config config; - - public JobManager(Config config) { - this.config = config; - } - - /** - * 获取职位上的招聘人员信息,根据职位 ID 获取职位上的招聘人员信息,如招聘负责人、用人经理 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job-manager/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetJobManagerSample.java ; - */ - public GetJobManagerResp get(GetJobManagerReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/jobs/:job_id/managers/:manager_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetJobManagerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobManagerResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/jobs/:job_id/managers/:manager_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取职位上的招聘人员信息,根据职位 ID 获取职位上的招聘人员信息,如招聘负责人、用人经理 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job-manager/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetJobManagerSample.java ; - */ - public GetJobManagerResp get(GetJobManagerReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/jobs/:job_id/managers/:manager_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetJobManagerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobManagerResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/jobs/:job_id/managers/:manager_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class JobProcess { - private final Config config; - - public JobProcess(Config config) { - this.config = config; - } - - /** - * 获取招聘流程信息,获取全部招聘流程信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_process/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobProcessSample.java ; - */ - public ListJobProcessResp list(ListJobProcessReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/job_processes" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListJobProcessResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobProcessResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_processes" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取招聘流程信息,获取全部招聘流程信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_process/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobProcessSample.java ; - */ - public ListJobProcessResp list(ListJobProcessReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/job_processes" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListJobProcessResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobProcessResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_processes" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class JobRequirement { - private final Config config; - - public JobRequirement(Config config) { - this.config = config; - } - - /** - * 创建招聘需求,创建招聘需求,除招聘需求编号为必填外,其他字段是否必填与飞书招聘「招聘需求字段管理」内设置一致 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateJobRequirementSample.java ; - */ - public CreateJobRequirementResp create(CreateJobRequirementReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/job_requirements" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateJobRequirementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobRequirementResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_requirements" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建招聘需求,创建招聘需求,除招聘需求编号为必填外,其他字段是否必填与飞书招聘「招聘需求字段管理」内设置一致 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateJobRequirementSample.java ; - */ - public CreateJobRequirementResp create(CreateJobRequirementReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/job_requirements" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateJobRequirementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobRequirementResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_requirements" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除招聘需求,删除招聘需求 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/DeleteJobRequirementSample.java ; - */ - public DeleteJobRequirementResp delete(DeleteJobRequirementReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/hire/v1/job_requirements/:job_requirement_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteJobRequirementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobRequirementResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_requirements/:job_requirement_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除招聘需求,删除招聘需求 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/DeleteJobRequirementSample.java ; - */ - public DeleteJobRequirementResp delete(DeleteJobRequirementReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/hire/v1/job_requirements/:job_requirement_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteJobRequirementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobRequirementResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_requirements/:job_requirement_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取招聘需求列表,获取招聘需求列表 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobRequirementSample.java ; - */ - public ListJobRequirementResp list(ListJobRequirementReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/job_requirements" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListJobRequirementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobRequirementResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_requirements" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取招聘需求列表,获取招聘需求列表 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobRequirementSample.java ; - */ - public ListJobRequirementResp list(ListJobRequirementReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/job_requirements" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListJobRequirementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobRequirementResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_requirements" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * ,获取招聘需求信息 - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list_by_id&project=hire&resource=job_requirement&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListByIdJobRequirementSample.java ; - */ - public ListByIdJobRequirementResp listById(ListByIdJobRequirementReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/job_requirements/search" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListByIdJobRequirementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListByIdJobRequirementResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_requirements/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * ,获取招聘需求信息 - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list_by_id&project=hire&resource=job_requirement&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListByIdJobRequirementSample.java ; - */ - public ListByIdJobRequirementResp listById(ListByIdJobRequirementReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/job_requirements/search" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListByIdJobRequirementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListByIdJobRequirementResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_requirements/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新招聘需求,更新招聘需求 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateJobRequirementSample.java ; - */ - public UpdateJobRequirementResp update(UpdateJobRequirementReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/hire/v1/job_requirements/:job_requirement_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateJobRequirementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateJobRequirementResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_requirements/:job_requirement_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新招聘需求,更新招聘需求 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateJobRequirementSample.java ; - */ - public UpdateJobRequirementResp update(UpdateJobRequirementReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/hire/v1/job_requirements/:job_requirement_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateJobRequirementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateJobRequirementResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_requirements/:job_requirement_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class JobRequirementSchema { - private final Config config; - - public JobRequirementSchema(Config config) { - this.config = config; - } - - /** - * 获取招聘需求模板,获取招聘需求模板 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement_schema/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobRequirementSchemaSample.java ; - */ - public ListJobRequirementSchemaResp list(ListJobRequirementSchemaReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/job_requirement_schemas" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListJobRequirementSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobRequirementSchemaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_requirement_schemas" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取招聘需求模板,获取招聘需求模板 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement_schema/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobRequirementSchemaSample.java ; - */ - public ListJobRequirementSchemaResp list(ListJobRequirementSchemaReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/job_requirement_schemas" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListJobRequirementSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobRequirementSchemaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_requirement_schemas" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class JobType { - private final Config config; - - public JobType(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=job_type&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobTypeSample.java ; - */ - public ListJobTypeResp list(ListJobTypeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/job_types" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListJobTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_types" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=job_type&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobTypeSample.java ; - */ - public ListJobTypeResp list(ListJobTypeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/job_types" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListJobTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobTypeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_types" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Note { - private final Config config; - - public Note(Config config) { - this.config = config; - } - - /** - * 创建备注,创建备注信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateNoteSample.java ; - */ - public CreateNoteResp create(CreateNoteReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/notes" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateNoteResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateNoteResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/notes" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建备注,创建备注信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateNoteSample.java ; - */ - public CreateNoteResp create(CreateNoteReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/notes" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateNoteResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateNoteResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/notes" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取备注,根据备注 ID 获取备注信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetNoteSample.java ; - */ - public GetNoteResp get(GetNoteReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/notes/:note_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetNoteResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetNoteResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/notes/:note_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取备注,根据备注 ID 获取备注信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetNoteSample.java ; - */ - public GetNoteResp get(GetNoteReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/notes/:note_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetNoteResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetNoteResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/notes/:note_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取备注列表,获取备注列表 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListNoteSample.java ; - */ - public ListNoteResp list(ListNoteReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/notes" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListNoteResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListNoteResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/notes" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取备注列表,获取备注列表 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListNoteSample.java ; - */ - public ListNoteResp list(ListNoteReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/notes" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListNoteResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListNoteResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/notes" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新备注,根据备注 ID 更新备注信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PatchNoteSample.java ; - */ - public PatchNoteResp patch(PatchNoteReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/hire/v1/notes/:note_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchNoteResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchNoteResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/notes/:note_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新备注,根据备注 ID 更新备注信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PatchNoteSample.java ; - */ - public PatchNoteResp patch(PatchNoteReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/hire/v1/notes/:note_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchNoteResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchNoteResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/notes/:note_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Offer { - private final Config config; - - public Offer(Config config) { - this.config = config; - } - - /** - * 创建 Offer,创建 Offer 时,需传入本文档中标注为必传的参数,其余参数是否必传参考「获取 Offer 申请表模板信息」的参数定义 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateOfferSample.java ; - */ - public CreateOfferResp create(CreateOfferReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/offers" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateOfferResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateOfferResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offers" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建 Offer,创建 Offer 时,需传入本文档中标注为必传的参数,其余参数是否必传参考「获取 Offer 申请表模板信息」的参数定义 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateOfferSample.java ; - */ - public CreateOfferResp create(CreateOfferReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/offers" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateOfferResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateOfferResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offers" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取 Offer 详情,根据 Offer ID 获取 Offer 详细信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetOfferSample.java ; - */ - public GetOfferResp get(GetOfferReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/offers/:offer_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetOfferResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetOfferResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offers/:offer_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取 Offer 详情,根据 Offer ID 获取 Offer 详细信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetOfferSample.java ; - */ - public GetOfferResp get(GetOfferReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/offers/:offer_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetOfferResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetOfferResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offers/:offer_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新实习 Offer 入/离职状态,对「实习待入职」状态的实习 Offer 确认入职、放弃入职,或对「实习已入职」状态的实习 Offer 操作离职 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/intern_offer_status ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/InternOfferStatusOfferSample.java ; - */ - public InternOfferStatusOfferResp internOfferStatus(InternOfferStatusOfferReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/offers/:offer_id/intern_offer_status" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - InternOfferStatusOfferResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, InternOfferStatusOfferResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offers/:offer_id/intern_offer_status" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新实习 Offer 入/离职状态,对「实习待入职」状态的实习 Offer 确认入职、放弃入职,或对「实习已入职」状态的实习 Offer 操作离职 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/intern_offer_status ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/InternOfferStatusOfferSample.java ; - */ - public InternOfferStatusOfferResp internOfferStatus(InternOfferStatusOfferReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/offers/:offer_id/intern_offer_status" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - InternOfferStatusOfferResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, InternOfferStatusOfferResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offers/:offer_id/intern_offer_status" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取 Offer 列表,根据人才 ID 获取 Offer 列表 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListOfferSample.java ; - */ - public ListOfferResp list(ListOfferReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/offers" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListOfferResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListOfferResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offers" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取 Offer 列表,根据人才 ID 获取 Offer 列表 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListOfferSample.java ; - */ - public ListOfferResp list(ListOfferReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/offers" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListOfferResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListOfferResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offers" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=offer_status&project=hire&resource=offer&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/OfferStatusOfferSample.java ; - */ - public OfferStatusOfferResp offerStatus(OfferStatusOfferReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/hire/v1/offers/:offer_id/offer_status" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - OfferStatusOfferResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, OfferStatusOfferResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offers/:offer_id/offer_status" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=offer_status&project=hire&resource=offer&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/OfferStatusOfferSample.java ; - */ - public OfferStatusOfferResp offerStatus(OfferStatusOfferReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/hire/v1/offers/:offer_id/offer_status" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - OfferStatusOfferResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, OfferStatusOfferResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offers/:offer_id/offer_status" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新 Offer 信息,1. 更新 Offer 时,需传入本文档中标注为必传的参数,其余参数是否必传参考「获取 Offer 申请表模板信息」的参数定义;;2. 对系统中已存在的 offer 进行更新的,若更新 offer 中含有「修改需审批」的字段,更新后原 Offer 的审批会自动撤回,需要重新发起审批 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateOfferSample.java ; - */ - public UpdateOfferResp update(UpdateOfferReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/hire/v1/offers/:offer_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateOfferResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateOfferResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offers/:offer_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新 Offer 信息,1. 更新 Offer 时,需传入本文档中标注为必传的参数,其余参数是否必传参考「获取 Offer 申请表模板信息」的参数定义;;2. 对系统中已存在的 offer 进行更新的,若更新 offer 中含有「修改需审批」的字段,更新后原 Offer 的审批会自动撤回,需要重新发起审批 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateOfferSample.java ; - */ - public UpdateOfferResp update(UpdateOfferReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/hire/v1/offers/:offer_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateOfferResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateOfferResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offers/:offer_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class OfferSchema { - private final Config config; - - public OfferSchema(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=hire&resource=offer_schema&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetOfferSchemaSample.java ; - */ - public GetOfferSchemaResp get(GetOfferSchemaReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/offer_schemas/:offer_schema_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetOfferSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetOfferSchemaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offer_schemas/:offer_schema_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=hire&resource=offer_schema&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetOfferSchemaSample.java ; - */ - public GetOfferSchemaResp get(GetOfferSchemaReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/offer_schemas/:offer_schema_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetOfferSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetOfferSchemaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offer_schemas/:offer_schema_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Questionnaire { - private final Config config; - - public Questionnaire(Config config) { - this.config = config; - } - - /** - * 获取面试满意度问卷列表,获取面试满意度问卷列表 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/questionnaire/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListQuestionnaireSample.java ; - */ - public ListQuestionnaireResp list(ListQuestionnaireReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/questionnaires" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListQuestionnaireResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListQuestionnaireResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/questionnaires" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取面试满意度问卷列表,获取面试满意度问卷列表 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/questionnaire/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListQuestionnaireSample.java ; - */ - public ListQuestionnaireResp list(ListQuestionnaireReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/questionnaires" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListQuestionnaireResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListQuestionnaireResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/questionnaires" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Referral { - private final Config config; - - public Referral(Config config) { - this.config = config; - } - - /** - * 获取内推信息,根据投递 ID 获取内推信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/referral/get_by_application ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetByApplicationReferralSample.java ; - */ - public GetByApplicationReferralResp getByApplication(GetByApplicationReferralReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/referrals/get_by_application" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetByApplicationReferralResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetByApplicationReferralResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referrals/get_by_application" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取内推信息,根据投递 ID 获取内推信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/referral/get_by_application ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetByApplicationReferralSample.java ; - */ - public GetByApplicationReferralResp getByApplication(GetByApplicationReferralReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/referrals/get_by_application" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetByApplicationReferralResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetByApplicationReferralResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referrals/get_by_application" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ReferralAccount { - private final Config config; - - public ReferralAccount(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=hire&resource=referral_account&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateReferralAccountSample.java ; - */ - public CreateReferralAccountResp create(CreateReferralAccountReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/referral_account" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateReferralAccountResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateReferralAccountResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referral_account" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=hire&resource=referral_account&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateReferralAccountSample.java ; - */ - public CreateReferralAccountResp create(CreateReferralAccountReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/referral_account" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateReferralAccountResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateReferralAccountResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referral_account" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=deactivate&project=hire&resource=referral_account&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/DeactivateReferralAccountSample.java ; - */ - public DeactivateReferralAccountResp deactivate(DeactivateReferralAccountReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/referral_account/:referral_account_id/deactivate" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeactivateReferralAccountResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeactivateReferralAccountResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referral_account/:referral_account_id/deactivate" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=deactivate&project=hire&resource=referral_account&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/DeactivateReferralAccountSample.java ; - */ - public DeactivateReferralAccountResp deactivate(DeactivateReferralAccountReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/referral_account/:referral_account_id/deactivate" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeactivateReferralAccountResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeactivateReferralAccountResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referral_account/:referral_account_id/deactivate" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=reconciliation&project=hire&resource=referral_account&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ReconciliationReferralAccountSample.java ; - */ - public ReconciliationReferralAccountResp reconciliation(ReconciliationReferralAccountReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/referral_account/reconciliation" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ReconciliationReferralAccountResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ReconciliationReferralAccountResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referral_account/reconciliation" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=reconciliation&project=hire&resource=referral_account&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ReconciliationReferralAccountSample.java ; - */ - public ReconciliationReferralAccountResp reconciliation(ReconciliationReferralAccountReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/referral_account/reconciliation" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ReconciliationReferralAccountResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ReconciliationReferralAccountResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referral_account/reconciliation" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=withdraw&project=hire&resource=referral_account&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/WithdrawReferralAccountSample.java ; - */ - public WithdrawReferralAccountResp withdraw(WithdrawReferralAccountReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/referral_account/:referral_account_id/withdraw" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - WithdrawReferralAccountResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, WithdrawReferralAccountResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referral_account/:referral_account_id/withdraw" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=withdraw&project=hire&resource=referral_account&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/WithdrawReferralAccountSample.java ; - */ - public WithdrawReferralAccountResp withdraw(WithdrawReferralAccountReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/referral_account/:referral_account_id/withdraw" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - WithdrawReferralAccountResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, WithdrawReferralAccountResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referral_account/:referral_account_id/withdraw" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ReferralWebsiteJobPost { - private final Config config; - - public ReferralWebsiteJobPost(Config config) { - this.config = config; - } - - /** - * ,获取内推官网下职位广告详情 - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=hire&resource=referral_website.job_post&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetReferralWebsiteJobPostSample.java ; - */ - public GetReferralWebsiteJobPostResp get(GetReferralWebsiteJobPostReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/referral_websites/job_posts/:job_post_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetReferralWebsiteJobPostResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetReferralWebsiteJobPostResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referral_websites/job_posts/:job_post_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * ,获取内推官网下职位广告详情 - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=hire&resource=referral_website.job_post&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetReferralWebsiteJobPostSample.java ; - */ - public GetReferralWebsiteJobPostResp get(GetReferralWebsiteJobPostReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/referral_websites/job_posts/:job_post_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetReferralWebsiteJobPostResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetReferralWebsiteJobPostResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referral_websites/job_posts/:job_post_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * ,获取内推官网下的职位列表。自定义数据暂不支持列表获取,请从「获取内推官网下职位广告详情」接口获取 - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=referral_website.job_post&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListReferralWebsiteJobPostSample.java ; - */ - public ListReferralWebsiteJobPostResp list(ListReferralWebsiteJobPostReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/referral_websites/job_posts" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListReferralWebsiteJobPostResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListReferralWebsiteJobPostResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referral_websites/job_posts" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * ,获取内推官网下的职位列表。自定义数据暂不支持列表获取,请从「获取内推官网下职位广告详情」接口获取 - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=referral_website.job_post&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListReferralWebsiteJobPostSample.java ; - */ - public ListReferralWebsiteJobPostResp list(ListReferralWebsiteJobPostReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/referral_websites/job_posts" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListReferralWebsiteJobPostResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListReferralWebsiteJobPostResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referral_websites/job_posts" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class RegistrationSchema { - private final Config config; - - public RegistrationSchema(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=registration_schema&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListRegistrationSchemaSample.java ; - */ - public ListRegistrationSchemaResp list(ListRegistrationSchemaReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/registration_schemas" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListRegistrationSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListRegistrationSchemaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/registration_schemas" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=registration_schema&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListRegistrationSchemaSample.java ; - */ - public ListRegistrationSchemaResp list(ListRegistrationSchemaReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/registration_schemas" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListRegistrationSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListRegistrationSchemaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/registration_schemas" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ResumeSource { - private final Config config; - - public ResumeSource(Config config) { - this.config = config; - } - - /** - * 获取简历来源列表,获取简历来源列表 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/resume_source/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListResumeSourceSample.java ; - */ - public ListResumeSourceResp list(ListResumeSourceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/resume_sources" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListResumeSourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListResumeSourceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/resume_sources" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取简历来源列表,获取简历来源列表 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/resume_source/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListResumeSourceSample.java ; - */ - public ListResumeSourceResp list(ListResumeSourceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/resume_sources" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListResumeSourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListResumeSourceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/resume_sources" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Talent { - private final Config config; - - public Talent(Config config) { - this.config = config; - } - - /** - * 将人才加入指定文件夹,将人才加入指定文件夹 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent/add_to_folder ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/AddToFolderTalentSample.java ; - */ - public AddToFolderTalentResp addToFolder(AddToFolderTalentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/talents/add_to_folder" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - AddToFolderTalentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddToFolderTalentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/talents/add_to_folder" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 将人才加入指定文件夹,将人才加入指定文件夹 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent/add_to_folder ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/AddToFolderTalentSample.java ; - */ - public AddToFolderTalentResp addToFolder(AddToFolderTalentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/talents/add_to_folder" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - AddToFolderTalentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddToFolderTalentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/talents/add_to_folder" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 通过人才信息获取人才 ID,通过人才信息获取人才 ID - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent/batch_get_id ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchGetIdTalentSample.java ; - */ - public BatchGetIdTalentResp batchGetId(BatchGetIdTalentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/talents/batch_get_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchGetIdTalentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetIdTalentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/talents/batch_get_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 通过人才信息获取人才 ID,通过人才信息获取人才 ID - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent/batch_get_id ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchGetIdTalentSample.java ; - */ - public BatchGetIdTalentResp batchGetId(BatchGetIdTalentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/hire/v1/talents/batch_get_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchGetIdTalentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetIdTalentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/talents/batch_get_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取人才信息,根据人才 ID 获取人才信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetTalentSample.java ; - */ - public GetTalentResp get(GetTalentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/talents/:talent_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetTalentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTalentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/talents/:talent_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取人才信息,根据人才 ID 获取人才信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetTalentSample.java ; - */ - public GetTalentResp get(GetTalentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/talents/:talent_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetTalentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTalentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/talents/:talent_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class TalentFolder { - private final Config config; - - public TalentFolder(Config config) { - this.config = config; - } - - /** - * 获取人才文件夹信息,用于获取招聘系统中人才文件夹信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent_folder/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListTalentFolderSample.java ; - */ - public ListTalentFolderResp list(ListTalentFolderReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/talent_folders" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListTalentFolderResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTalentFolderResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/talent_folders" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取人才文件夹信息,用于获取招聘系统中人才文件夹信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent_folder/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListTalentFolderSample.java ; - */ - public ListTalentFolderResp list(ListTalentFolderReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/talent_folders" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListTalentFolderResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTalentFolderResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/talent_folders" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class TalentObject { - private final Config config; - - public TalentObject(Config config) { - this.config = config; - } - - /** - * 获取人才字段,获取人才字段 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent_object/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/QueryTalentObjectSample.java ; - */ - public QueryTalentObjectResp query(RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/talent_objects/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , null); - - // 反序列化 - QueryTalentObjectResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryTalentObjectResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/talent_objects/query" - , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - return resp; - } - - /** - * 获取人才字段,获取人才字段 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent_object/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/QueryTalentObjectSample.java ; - */ - public QueryTalentObjectResp query() throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/hire/v1/talent_objects/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , null); - - // 反序列化 - QueryTalentObjectResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryTalentObjectResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/talent_objects/query" - , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - return resp; - } - } - - public abstract static class P2ApplicationStageChangedV1Handler implements IEventHandler { - @Override - public P2ApplicationStageChangedV1 getEvent() { - return new P2ApplicationStageChangedV1(); - } - } - - public abstract static class P2EcoAccountCreatedV1Handler implements IEventHandler { - @Override - public P2EcoAccountCreatedV1 getEvent() { - return new P2EcoAccountCreatedV1(); - } - } - - public abstract static class P2EcoBackgroundCheckCanceledV1Handler implements IEventHandler { - @Override - public P2EcoBackgroundCheckCanceledV1 getEvent() { - return new P2EcoBackgroundCheckCanceledV1(); - } - } - - public abstract static class P2EcoBackgroundCheckCreatedV1Handler implements IEventHandler { - @Override - public P2EcoBackgroundCheckCreatedV1 getEvent() { - return new P2EcoBackgroundCheckCreatedV1(); - } - } - - public abstract static class P2EcoExamCreatedV1Handler implements IEventHandler { - @Override - public P2EcoExamCreatedV1 getEvent() { - return new P2EcoExamCreatedV1(); - } - } - - public abstract static class P2EhrImportTaskImportedV1Handler implements IEventHandler { - @Override - public P2EhrImportTaskImportedV1 getEvent() { - return new P2EhrImportTaskImportedV1(); - } - } - - public abstract static class P2EhrImportTaskForInternshipOfferImportedV1Handler implements IEventHandler { - @Override - public P2EhrImportTaskForInternshipOfferImportedV1 getEvent() { - return new P2EhrImportTaskForInternshipOfferImportedV1(); - } - } - - public abstract static class P2OfferStatusChangedV1Handler implements IEventHandler { - @Override - public P2OfferStatusChangedV1 getEvent() { - return new P2OfferStatusChangedV1(); - } - } - - public abstract static class P2ReferralAccountAssetsUpdateV1Handler implements IEventHandler { - @Override - public P2ReferralAccountAssetsUpdateV1 getEvent() { - return new P2ReferralAccountAssetsUpdateV1(); - } - } -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/V1.java new file mode 100644 index 000000000..570737637 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/V1.java @@ -0,0 +1,245 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.hire.v1.resource.*; + +public class V1 { + private final Application application; // 投递 + private final ApplicationInterview applicationInterview; // application.interview + private final Attachment attachment; // 附件 + private final EcoAccount ecoAccount; // 事件 + private final EcoAccountCustomField ecoAccountCustomField; // 生态对接账号自定义字段 + private final EcoBackgroundCheck ecoBackgroundCheck; // 背调订单 + private final EcoBackgroundCheckCustomField ecoBackgroundCheckCustomField; // 背调自定义字段 + private final EcoBackgroundCheckPackage ecoBackgroundCheckPackage; // 背调套餐和附加调查项 + private final EcoExam ecoExam; // eco_exam + private final EcoExamPaper ecoExamPaper; // eco_exam_paper + private final EhrImportTask ehrImportTask; // 导入 e-HR + private final EhrImportTaskForInternshipOffer ehrImportTaskForInternshipOffer; // ehr_import_task_for_internship_offer + private final Employee employee; // 入职 + private final Evaluation evaluation; // 评估(灰度租户可见) + private final ExternalApplication externalApplication; // 导入外部系统信息(灰度租户可见) + private final ExternalBackgroundCheck externalBackgroundCheck; // 导入外部系统信息(灰度租户可见) + private final ExternalInterview externalInterview; // 导入外部系统信息(灰度租户可见) + private final ExternalInterviewAssessment externalInterviewAssessment; // 导入外部系统信息(灰度租户可见) + private final Interview interview; // 面试 + private final Job job; // 职位 + private final JobManager jobManager; // job.manager + private final JobProcess jobProcess; // 流程 + private final JobRequirement jobRequirement; // 招聘需求(灰度租户可见) + private final JobRequirementSchema jobRequirementSchema; // job_requirement_schema + private final JobType jobType; // job_type + private final Note note; // 备注 + private final Offer offer; // Offer + private final OfferSchema offerSchema; // offer_schema + private final Questionnaire questionnaire; // 问卷(灰度租户可见) + private final Referral referral; // 内推 + private final ReferralAccount referralAccount; // referral_account + private final ReferralWebsiteJobPost referralWebsiteJobPost; // referral_website.job_post + private final RegistrationSchema registrationSchema; // registration_schema + private final ResumeSource resumeSource; // 简历来源 + private final Talent talent; // 人才 + private final TalentFolder talentFolder; // talent_folder + private final TalentObject talentObject; // talent_object + + public V1(Config config) { + this.application = new Application(config); + this.applicationInterview = new ApplicationInterview(config); + this.attachment = new Attachment(config); + this.ecoAccount = new EcoAccount(config); + this.ecoAccountCustomField = new EcoAccountCustomField(config); + this.ecoBackgroundCheck = new EcoBackgroundCheck(config); + this.ecoBackgroundCheckCustomField = new EcoBackgroundCheckCustomField(config); + this.ecoBackgroundCheckPackage = new EcoBackgroundCheckPackage(config); + this.ecoExam = new EcoExam(config); + this.ecoExamPaper = new EcoExamPaper(config); + this.ehrImportTask = new EhrImportTask(config); + this.ehrImportTaskForInternshipOffer = new EhrImportTaskForInternshipOffer(config); + this.employee = new Employee(config); + this.evaluation = new Evaluation(config); + this.externalApplication = new ExternalApplication(config); + this.externalBackgroundCheck = new ExternalBackgroundCheck(config); + this.externalInterview = new ExternalInterview(config); + this.externalInterviewAssessment = new ExternalInterviewAssessment(config); + this.interview = new Interview(config); + this.job = new Job(config); + this.jobManager = new JobManager(config); + this.jobProcess = new JobProcess(config); + this.jobRequirement = new JobRequirement(config); + this.jobRequirementSchema = new JobRequirementSchema(config); + this.jobType = new JobType(config); + this.note = new Note(config); + this.offer = new Offer(config); + this.offerSchema = new OfferSchema(config); + this.questionnaire = new Questionnaire(config); + this.referral = new Referral(config); + this.referralAccount = new ReferralAccount(config); + this.referralWebsiteJobPost = new ReferralWebsiteJobPost(config); + this.registrationSchema = new RegistrationSchema(config); + this.resumeSource = new ResumeSource(config); + this.talent = new Talent(config); + this.talentFolder = new TalentFolder(config); + this.talentObject = new TalentObject(config); + } + + public Application application() { + return application; + } + + public ApplicationInterview applicationInterview() { + return applicationInterview; + } + + public Attachment attachment() { + return attachment; + } + + public EcoAccount ecoAccount() { + return ecoAccount; + } + + public EcoAccountCustomField ecoAccountCustomField() { + return ecoAccountCustomField; + } + + public EcoBackgroundCheck ecoBackgroundCheck() { + return ecoBackgroundCheck; + } + + public EcoBackgroundCheckCustomField ecoBackgroundCheckCustomField() { + return ecoBackgroundCheckCustomField; + } + + public EcoBackgroundCheckPackage ecoBackgroundCheckPackage() { + return ecoBackgroundCheckPackage; + } + + public EcoExam ecoExam() { + return ecoExam; + } + + public EcoExamPaper ecoExamPaper() { + return ecoExamPaper; + } + + public EhrImportTask ehrImportTask() { + return ehrImportTask; + } + + public EhrImportTaskForInternshipOffer ehrImportTaskForInternshipOffer() { + return ehrImportTaskForInternshipOffer; + } + + public Employee employee() { + return employee; + } + + public Evaluation evaluation() { + return evaluation; + } + + public ExternalApplication externalApplication() { + return externalApplication; + } + + public ExternalBackgroundCheck externalBackgroundCheck() { + return externalBackgroundCheck; + } + + public ExternalInterview externalInterview() { + return externalInterview; + } + + public ExternalInterviewAssessment externalInterviewAssessment() { + return externalInterviewAssessment; + } + + public Interview interview() { + return interview; + } + + public Job job() { + return job; + } + + public JobManager jobManager() { + return jobManager; + } + + public JobProcess jobProcess() { + return jobProcess; + } + + public JobRequirement jobRequirement() { + return jobRequirement; + } + + public JobRequirementSchema jobRequirementSchema() { + return jobRequirementSchema; + } + + public JobType jobType() { + return jobType; + } + + public Note note() { + return note; + } + + public Offer offer() { + return offer; + } + + public OfferSchema offerSchema() { + return offerSchema; + } + + public Questionnaire questionnaire() { + return questionnaire; + } + + public Referral referral() { + return referral; + } + + public ReferralAccount referralAccount() { + return referralAccount; + } + + public ReferralWebsiteJobPost referralWebsiteJobPost() { + return referralWebsiteJobPost; + } + + public RegistrationSchema registrationSchema() { + return registrationSchema; + } + + public ResumeSource resumeSource() { + return resumeSource; + } + + public Talent talent() { + return talent; + } + + public TalentFolder talentFolder() { + return talentFolder; + } + + public TalentObject talentObject() { + return talentObject; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/Agency.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/Agency.java index d9c6cc6fd..786f437d6 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/Agency.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/Agency.java @@ -34,6 +34,12 @@ public class Agency { */ @SerializedName("contactor_id") private String contactorId; + /** + * 供应商联系人名称 + *

示例值: + */ + @SerializedName("contactor_name") + private I18n contactorName; // builder 开始 public Agency() { @@ -55,6 +61,11 @@ public Agency(Builder builder) { *

示例值:ou_f476cb099ac9227c9bae09ce46112579 */ this.contactorId = builder.contactorId; + /** + * 供应商联系人名称 + *

示例值: + */ + this.contactorName = builder.contactorName; } public static Builder newBuilder() { @@ -85,6 +96,14 @@ public void setContactorId(String contactorId) { this.contactorId = contactorId; } + public I18n getContactorName() { + return this.contactorName; + } + + public void setContactorName(I18n contactorName) { + this.contactorName = contactorName; + } + public static class Builder { /** * 猎头供应商ID @@ -101,6 +120,11 @@ public static class Builder { *

示例值:ou_f476cb099ac9227c9bae09ce46112579 */ private String contactorId; + /** + * 供应商联系人名称 + *

示例值: + */ + private I18n contactorName; /** * 猎头供应商ID @@ -141,6 +165,19 @@ public Builder contactorId(String contactorId) { } + /** + * 供应商联系人名称 + *

示例值: + * + * @param contactorName + * @return + */ + public Builder contactorName(I18n contactorName) { + this.contactorName = contactorName; + return this; + } + + public Agency build() { return new Agency(this); } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/AgencyProtection.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/AgencyProtection.java new file mode 100644 index 000000000..6b041f362 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/AgencyProtection.java @@ -0,0 +1,333 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class AgencyProtection { + /** + * 保护期类型 + *

示例值:1 + */ + @SerializedName("protection_type") + private Integer protectionType; + /** + * 如保护期类型为职位保护,返回职位保护所在的投递id + *

示例值:6930815272790114323 + */ + @SerializedName("application_id") + private String applicationId; + /** + * 保护期开始时间 + *

示例值:1700023694629 + */ + @SerializedName("start_time") + private String startTime; + /** + * 保护期过期时间 + *

示例值:1700023694630 + */ + @SerializedName("expire_time") + private String expireTime; + /** + * 推荐的猎头供应商 ID + *

示例值:6930815272790114324 + */ + @SerializedName("agency_supplier_id") + private String agencySupplierId; + /** + * 推荐的猎头供应商名称 + *

示例值: + */ + @SerializedName("agency_supplier_name") + private I18n agencySupplierName; + /** + * 推荐的猎头顾问ID,目前仅作为唯一标识,不可查询具体的人员信息 + *

示例值:6930815272790114324 + */ + @SerializedName("agency_supplier_user_id") + private String agencySupplierUserId; + /** + * 推荐的猎头顾问名称 + *

示例值: + */ + @SerializedName("agency_supplier_user_name") + private I18n agencySupplierUserName; + + // builder 开始 + public AgencyProtection() { + } + + public AgencyProtection(Builder builder) { + /** + * 保护期类型 + *

示例值:1 + */ + this.protectionType = builder.protectionType; + /** + * 如保护期类型为职位保护,返回职位保护所在的投递id + *

示例值:6930815272790114323 + */ + this.applicationId = builder.applicationId; + /** + * 保护期开始时间 + *

示例值:1700023694629 + */ + this.startTime = builder.startTime; + /** + * 保护期过期时间 + *

示例值:1700023694630 + */ + this.expireTime = builder.expireTime; + /** + * 推荐的猎头供应商 ID + *

示例值:6930815272790114324 + */ + this.agencySupplierId = builder.agencySupplierId; + /** + * 推荐的猎头供应商名称 + *

示例值: + */ + this.agencySupplierName = builder.agencySupplierName; + /** + * 推荐的猎头顾问ID,目前仅作为唯一标识,不可查询具体的人员信息 + *

示例值:6930815272790114324 + */ + this.agencySupplierUserId = builder.agencySupplierUserId; + /** + * 推荐的猎头顾问名称 + *

示例值: + */ + this.agencySupplierUserName = builder.agencySupplierUserName; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Integer getProtectionType() { + return this.protectionType; + } + + public void setProtectionType(Integer protectionType) { + this.protectionType = protectionType; + } + + public String getApplicationId() { + return this.applicationId; + } + + public void setApplicationId(String applicationId) { + this.applicationId = applicationId; + } + + public String getStartTime() { + return this.startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getExpireTime() { + return this.expireTime; + } + + public void setExpireTime(String expireTime) { + this.expireTime = expireTime; + } + + public String getAgencySupplierId() { + return this.agencySupplierId; + } + + public void setAgencySupplierId(String agencySupplierId) { + this.agencySupplierId = agencySupplierId; + } + + public I18n getAgencySupplierName() { + return this.agencySupplierName; + } + + public void setAgencySupplierName(I18n agencySupplierName) { + this.agencySupplierName = agencySupplierName; + } + + public String getAgencySupplierUserId() { + return this.agencySupplierUserId; + } + + public void setAgencySupplierUserId(String agencySupplierUserId) { + this.agencySupplierUserId = agencySupplierUserId; + } + + public I18n getAgencySupplierUserName() { + return this.agencySupplierUserName; + } + + public void setAgencySupplierUserName(I18n agencySupplierUserName) { + this.agencySupplierUserName = agencySupplierUserName; + } + + public static class Builder { + /** + * 保护期类型 + *

示例值:1 + */ + private Integer protectionType; + /** + * 如保护期类型为职位保护,返回职位保护所在的投递id + *

示例值:6930815272790114323 + */ + private String applicationId; + /** + * 保护期开始时间 + *

示例值:1700023694629 + */ + private String startTime; + /** + * 保护期过期时间 + *

示例值:1700023694630 + */ + private String expireTime; + /** + * 推荐的猎头供应商 ID + *

示例值:6930815272790114324 + */ + private String agencySupplierId; + /** + * 推荐的猎头供应商名称 + *

示例值: + */ + private I18n agencySupplierName; + /** + * 推荐的猎头顾问ID,目前仅作为唯一标识,不可查询具体的人员信息 + *

示例值:6930815272790114324 + */ + private String agencySupplierUserId; + /** + * 推荐的猎头顾问名称 + *

示例值: + */ + private I18n agencySupplierUserName; + + /** + * 保护期类型 + *

示例值:1 + * + * @param protectionType + * @return + */ + public Builder protectionType(Integer protectionType) { + this.protectionType = protectionType; + return this; + } + + + /** + * 如保护期类型为职位保护,返回职位保护所在的投递id + *

示例值:6930815272790114323 + * + * @param applicationId + * @return + */ + public Builder applicationId(String applicationId) { + this.applicationId = applicationId; + return this; + } + + + /** + * 保护期开始时间 + *

示例值:1700023694629 + * + * @param startTime + * @return + */ + public Builder startTime(String startTime) { + this.startTime = startTime; + return this; + } + + + /** + * 保护期过期时间 + *

示例值:1700023694630 + * + * @param expireTime + * @return + */ + public Builder expireTime(String expireTime) { + this.expireTime = expireTime; + return this; + } + + + /** + * 推荐的猎头供应商 ID + *

示例值:6930815272790114324 + * + * @param agencySupplierId + * @return + */ + public Builder agencySupplierId(String agencySupplierId) { + this.agencySupplierId = agencySupplierId; + return this; + } + + + /** + * 推荐的猎头供应商名称 + *

示例值: + * + * @param agencySupplierName + * @return + */ + public Builder agencySupplierName(I18n agencySupplierName) { + this.agencySupplierName = agencySupplierName; + return this; + } + + + /** + * 推荐的猎头顾问ID,目前仅作为唯一标识,不可查询具体的人员信息 + *

示例值:6930815272790114324 + * + * @param agencySupplierUserId + * @return + */ + public Builder agencySupplierUserId(String agencySupplierUserId) { + this.agencySupplierUserId = agencySupplierUserId; + return this; + } + + + /** + * 推荐的猎头顾问名称 + *

示例值: + * + * @param agencySupplierUserName + * @return + */ + public Builder agencySupplierUserName(I18n agencySupplierUserName) { + this.agencySupplierUserName = agencySupplierUserName; + return this; + } + + + public AgencyProtection build() { + return new AgencyProtection(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ApplicationOfferBasicInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ApplicationOfferBasicInfo.java index 97b15a359..94000d15f 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ApplicationOfferBasicInfo.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ApplicationOfferBasicInfo.java @@ -130,6 +130,12 @@ public class ApplicationOfferBasicInfo { */ @SerializedName("customize_info_list") private ApplicationOfferCustomValue[] customizeInfoList; + /** + * 人事侧的办公地点与地址(目前仅字节可用) + *

示例值: + */ + @SerializedName("work_location_address_info") + private MasterLocationAddressInfo workLocationAddressInfo; // builder 开始 public ApplicationOfferBasicInfo() { @@ -231,6 +237,11 @@ public ApplicationOfferBasicInfo(Builder builder) { *

示例值: */ this.customizeInfoList = builder.customizeInfoList; + /** + * 人事侧的办公地点与地址(目前仅字节可用) + *

示例值: + */ + this.workLocationAddressInfo = builder.workLocationAddressInfo; } public static Builder newBuilder() { @@ -389,6 +400,14 @@ public void setCustomizeInfoList(ApplicationOfferCustomValue[] customizeInfoList this.customizeInfoList = customizeInfoList; } + public MasterLocationAddressInfo getWorkLocationAddressInfo() { + return this.workLocationAddressInfo; + } + + public void setWorkLocationAddressInfo(MasterLocationAddressInfo workLocationAddressInfo) { + this.workLocationAddressInfo = workLocationAddressInfo; + } + public static class Builder { /** * Offer 类型 @@ -485,6 +504,11 @@ public static class Builder { *

示例值: */ private ApplicationOfferCustomValue[] customizeInfoList; + /** + * 人事侧的办公地点与地址(目前仅字节可用) + *

示例值: + */ + private MasterLocationAddressInfo workLocationAddressInfo; /** * Offer 类型 @@ -733,6 +757,19 @@ public Builder customizeInfoList(ApplicationOfferCustomValue[] customizeInfoList } + /** + * 人事侧的办公地点与地址(目前仅字节可用) + *

示例值: + * + * @param workLocationAddressInfo + * @return + */ + public Builder workLocationAddressInfo(MasterLocationAddressInfo workLocationAddressInfo) { + this.workLocationAddressInfo = workLocationAddressInfo; + return this; + } + + public ApplicationOfferBasicInfo build() { return new ApplicationOfferBasicInfo(this); } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/CombinedCreateJobReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/CombinedCreateJobReq.java index 9cf73afa0..e6b2ed953 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/CombinedCreateJobReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/CombinedCreateJobReq.java @@ -32,6 +32,20 @@ public class CombinedCreateJobReq { @Query @SerializedName("department_id_type") private String departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_level_id_type") + private String jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_family_id_type") + private String jobFamilyIdType; @Body private CombinedJob body; @@ -50,6 +64,16 @@ public CombinedCreateJobReq(Builder builder) { *

示例值:此次调用中使用的部门 ID 的类型 */ this.departmentIdType = builder.departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + this.jobLevelIdType = builder.jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + this.jobFamilyIdType = builder.jobFamilyIdType; this.body = builder.body; } @@ -73,6 +97,22 @@ public void setDepartmentIdType(String departmentIdType) { this.departmentIdType = departmentIdType; } + public String getJobLevelIdType() { + return this.jobLevelIdType; + } + + public void setJobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + } + + public String getJobFamilyIdType() { + return this.jobFamilyIdType; + } + + public void setJobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + } + public CombinedJob getCombinedJob() { return this.body; } @@ -84,6 +124,8 @@ public void setCombinedJob(CombinedJob body) { public static class Builder { private String userIdType; // 用户 ID 类型 private String departmentIdType; // 此次调用中使用的部门 ID 的类型 + private String jobLevelIdType; // 此次调用中使用的「职级 ID」的类型 + private String jobFamilyIdType; // 此次调用中使用的「序列 ID」的类型 private CombinedJob body; /** @@ -110,6 +152,30 @@ public Builder departmentIdType(String departmentIdType) { return this; } + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + * + * @param jobLevelIdType + * @return + */ + public Builder jobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + return this; + } + + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + * + * @param jobFamilyIdType + * @return + */ + public Builder jobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + return this; + } + public CombinedJob getCombinedJob() { return this.body; } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/CombinedUpdateJobReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/CombinedUpdateJobReq.java index 6bc92c69c..97e1c2d94 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/CombinedUpdateJobReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/CombinedUpdateJobReq.java @@ -33,6 +33,20 @@ public class CombinedUpdateJobReq { @Query @SerializedName("department_id_type") private String departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_level_id_type") + private String jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_family_id_type") + private String jobFamilyIdType; /** * 职位 ID *

示例值:6960663240925956660 @@ -58,6 +72,16 @@ public CombinedUpdateJobReq(Builder builder) { *

示例值: */ this.departmentIdType = builder.departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + this.jobLevelIdType = builder.jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + this.jobFamilyIdType = builder.jobFamilyIdType; /** * 职位 ID *

示例值:6960663240925956660 @@ -86,6 +110,22 @@ public void setDepartmentIdType(String departmentIdType) { this.departmentIdType = departmentIdType; } + public String getJobLevelIdType() { + return this.jobLevelIdType; + } + + public void setJobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + } + + public String getJobFamilyIdType() { + return this.jobFamilyIdType; + } + + public void setJobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + } + public String getJobId() { return this.jobId; } @@ -105,6 +145,8 @@ public void setCombinedJob(CombinedJob body) { public static class Builder { private String userIdType; // 用户 ID 类型 private String departmentIdType; // 此次调用中使用的部门 ID 的类型 + private String jobLevelIdType; // 此次调用中使用的「职级 ID」的类型 + private String jobFamilyIdType; // 此次调用中使用的「序列 ID」的类型 private String jobId; // 职位 ID private CombinedJob body; @@ -132,6 +174,30 @@ public Builder departmentIdType(String departmentIdType) { return this; } + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + * + * @param jobLevelIdType + * @return + */ + public Builder jobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + return this; + } + + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + * + * @param jobFamilyIdType + * @return + */ + public Builder jobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + return this; + } + /** * 职位 ID *

示例值:6960663240925956660 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/CreateJobRequirementReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/CreateJobRequirementReq.java index 2eecd29fa..5f1ea49e9 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/CreateJobRequirementReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/CreateJobRequirementReq.java @@ -32,6 +32,27 @@ public class CreateJobRequirementReq { @Query @SerializedName("department_id_type") private String departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_level_id_type") + private String jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_family_id_type") + private String jobFamilyIdType; + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("employee_type_id_type") + private String employeeTypeIdType; @Body private JobRequirement body; @@ -50,6 +71,21 @@ public CreateJobRequirementReq(Builder builder) { *

示例值:open_department_id */ this.departmentIdType = builder.departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + this.jobLevelIdType = builder.jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + this.jobFamilyIdType = builder.jobFamilyIdType; + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + */ + this.employeeTypeIdType = builder.employeeTypeIdType; this.body = builder.body; } @@ -73,6 +109,30 @@ public void setDepartmentIdType(String departmentIdType) { this.departmentIdType = departmentIdType; } + public String getJobLevelIdType() { + return this.jobLevelIdType; + } + + public void setJobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + } + + public String getJobFamilyIdType() { + return this.jobFamilyIdType; + } + + public void setJobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + } + + public String getEmployeeTypeIdType() { + return this.employeeTypeIdType; + } + + public void setEmployeeTypeIdType(String employeeTypeIdType) { + this.employeeTypeIdType = employeeTypeIdType; + } + public JobRequirement getJobRequirement() { return this.body; } @@ -84,6 +144,9 @@ public void setJobRequirement(JobRequirement body) { public static class Builder { private String userIdType; // 此次调用中使用的用户ID的类型 private String departmentIdType; // 此次调用中使用的部门 ID 的类型 + private String jobLevelIdType; // 此次调用中使用的「职级 ID」的类型 + private String jobFamilyIdType; // 此次调用中使用的「序列 ID」的类型 + private String employeeTypeIdType; // 此次调用中使用的「人员类型 ID」的类型 private JobRequirement body; /** @@ -110,6 +173,42 @@ public Builder departmentIdType(String departmentIdType) { return this; } + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + * + * @param jobLevelIdType + * @return + */ + public Builder jobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + return this; + } + + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + * + * @param jobFamilyIdType + * @return + */ + public Builder jobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + return this; + } + + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + * + * @param employeeTypeIdType + * @return + */ + public Builder employeeTypeIdType(String employeeTypeIdType) { + this.employeeTypeIdType = employeeTypeIdType; + return this; + } + public JobRequirement getJobRequirement() { return this.body; } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/CreateOfferReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/CreateOfferReq.java index 107c19064..7b2bf8cbb 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/CreateOfferReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/CreateOfferReq.java @@ -32,6 +32,27 @@ public class CreateOfferReq { @Query @SerializedName("department_id_type") private String departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_level_id_type") + private String jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_family_id_type") + private String jobFamilyIdType; + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("employee_type_id_type") + private String employeeTypeIdType; @Body private OfferInfo body; @@ -50,6 +71,21 @@ public CreateOfferReq(Builder builder) { *

示例值: */ this.departmentIdType = builder.departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + this.jobLevelIdType = builder.jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + this.jobFamilyIdType = builder.jobFamilyIdType; + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + */ + this.employeeTypeIdType = builder.employeeTypeIdType; this.body = builder.body; } @@ -73,6 +109,30 @@ public void setDepartmentIdType(String departmentIdType) { this.departmentIdType = departmentIdType; } + public String getJobLevelIdType() { + return this.jobLevelIdType; + } + + public void setJobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + } + + public String getJobFamilyIdType() { + return this.jobFamilyIdType; + } + + public void setJobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + } + + public String getEmployeeTypeIdType() { + return this.employeeTypeIdType; + } + + public void setEmployeeTypeIdType(String employeeTypeIdType) { + this.employeeTypeIdType = employeeTypeIdType; + } + public OfferInfo getOfferInfo() { return this.body; } @@ -84,6 +144,9 @@ public void setOfferInfo(OfferInfo body) { public static class Builder { private String userIdType; // 此次调用中使用的用户ID的类型 private String departmentIdType; // 此次调用中使用的部门 ID 的类型 + private String jobLevelIdType; // 此次调用中使用的「职级 ID」的类型 + private String jobFamilyIdType; // 此次调用中使用的「序列 ID」的类型 + private String employeeTypeIdType; // 此次调用中使用的「人员类型 ID」的类型 private OfferInfo body; /** @@ -110,6 +173,42 @@ public Builder departmentIdType(String departmentIdType) { return this; } + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + * + * @param jobLevelIdType + * @return + */ + public Builder jobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + return this; + } + + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + * + * @param jobFamilyIdType + * @return + */ + public Builder jobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + return this; + } + + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + * + * @param employeeTypeIdType + * @return + */ + public Builder employeeTypeIdType(String employeeTypeIdType) { + this.employeeTypeIdType = employeeTypeIdType; + return this; + } + public OfferInfo getOfferInfo() { return this.body; } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetApplicationReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetApplicationReq.java index 72380cf55..c9c2ffcf1 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetApplicationReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetApplicationReq.java @@ -15,8 +15,16 @@ import com.google.gson.annotations.SerializedName; import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; public class GetApplicationReq { + /** + * 请求控制参数,用于控制接口响应逻辑。如需一次查询多个用户ID,可通过将同一参数名多次传递,并且每次传递不同的参数值。 + *

示例值: + */ + @Query + @SerializedName("options") + private String[] options; /** * 投递 ID *

示例值:6949805467799537964 @@ -30,6 +38,11 @@ public GetApplicationReq() { } public GetApplicationReq(Builder builder) { + /** + * 请求控制参数,用于控制接口响应逻辑。如需一次查询多个用户ID,可通过将同一参数名多次传递,并且每次传递不同的参数值。 + *

示例值: + */ + this.options = builder.options; /** * 投递 ID *

示例值:6949805467799537964 @@ -41,6 +54,14 @@ public static Builder newBuilder() { return new Builder(); } + public String[] getOptions() { + return this.options; + } + + public void setOptions(String[] options) { + this.options = options; + } + public String getApplicationId() { return this.applicationId; } @@ -50,9 +71,21 @@ public void setApplicationId(String applicationId) { } public static class Builder { - + private String[] options; // 请求控制参数,用于控制接口响应逻辑。如需一次查询多个用户ID,可通过将同一参数名多次传递,并且每次传递不同的参数值。 private String applicationId; // 投递 ID + /** + * 请求控制参数,用于控制接口响应逻辑。如需一次查询多个用户ID,可通过将同一参数名多次传递,并且每次传递不同的参数值。 + *

示例值: + * + * @param options + * @return + */ + public Builder options(String[] options) { + this.options = options; + return this; + } + /** * 投递 ID *

示例值:6949805467799537964 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetByApplicationEmployeeReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetByApplicationEmployeeReq.java index bd7a6278f..2f844cc1c 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetByApplicationEmployeeReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetByApplicationEmployeeReq.java @@ -38,6 +38,27 @@ public class GetByApplicationEmployeeReq { @Query @SerializedName("department_id_type") private String departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_level_id_type") + private String jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_family_id_type") + private String jobFamilyIdType; + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("employee_type_id_type") + private String employeeTypeIdType; // builder 开始 public GetByApplicationEmployeeReq() { @@ -59,6 +80,21 @@ public GetByApplicationEmployeeReq(Builder builder) { *

示例值: */ this.departmentIdType = builder.departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + this.jobLevelIdType = builder.jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + this.jobFamilyIdType = builder.jobFamilyIdType; + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + */ + this.employeeTypeIdType = builder.employeeTypeIdType; } public static Builder newBuilder() { @@ -89,10 +125,37 @@ public void setDepartmentIdType(String departmentIdType) { this.departmentIdType = departmentIdType; } + public String getJobLevelIdType() { + return this.jobLevelIdType; + } + + public void setJobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + } + + public String getJobFamilyIdType() { + return this.jobFamilyIdType; + } + + public void setJobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + } + + public String getEmployeeTypeIdType() { + return this.employeeTypeIdType; + } + + public void setEmployeeTypeIdType(String employeeTypeIdType) { + this.employeeTypeIdType = employeeTypeIdType; + } + public static class Builder { private String applicationId; // 投递ID private String userIdType; // 用户 ID 类型 private String departmentIdType; // 此次调用中使用的部门 ID 的类型 + private String jobLevelIdType; // 此次调用中使用的「职级 ID」的类型 + private String jobFamilyIdType; // 此次调用中使用的「序列 ID」的类型 + private String employeeTypeIdType; // 此次调用中使用的「人员类型 ID」的类型 /** @@ -133,6 +196,45 @@ public Builder departmentIdType(String departmentIdType) { return this; } + + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + * + * @param jobLevelIdType + * @return + */ + public Builder jobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + return this; + } + + + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + * + * @param jobFamilyIdType + * @return + */ + public Builder jobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + return this; + } + + + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + * + * @param employeeTypeIdType + * @return + */ + public Builder employeeTypeIdType(String employeeTypeIdType) { + this.employeeTypeIdType = employeeTypeIdType; + return this; + } + public GetByApplicationEmployeeReq build() { return new GetByApplicationEmployeeReq(this); } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetEmployeeReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetEmployeeReq.java index 363f34cc0..154244f0f 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetEmployeeReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetEmployeeReq.java @@ -32,6 +32,27 @@ public class GetEmployeeReq { @Query @SerializedName("department_id_type") private String departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_level_id_type") + private String jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_family_id_type") + private String jobFamilyIdType; + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("employee_type_id_type") + private String employeeTypeIdType; /** * 员工ID *

示例值:123 @@ -55,6 +76,21 @@ public GetEmployeeReq(Builder builder) { *

示例值: */ this.departmentIdType = builder.departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + this.jobLevelIdType = builder.jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + this.jobFamilyIdType = builder.jobFamilyIdType; + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + */ + this.employeeTypeIdType = builder.employeeTypeIdType; /** * 员工ID *

示例值:123 @@ -82,6 +118,30 @@ public void setDepartmentIdType(String departmentIdType) { this.departmentIdType = departmentIdType; } + public String getJobLevelIdType() { + return this.jobLevelIdType; + } + + public void setJobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + } + + public String getJobFamilyIdType() { + return this.jobFamilyIdType; + } + + public void setJobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + } + + public String getEmployeeTypeIdType() { + return this.employeeTypeIdType; + } + + public void setEmployeeTypeIdType(String employeeTypeIdType) { + this.employeeTypeIdType = employeeTypeIdType; + } + public String getEmployeeId() { return this.employeeId; } @@ -93,6 +153,9 @@ public void setEmployeeId(String employeeId) { public static class Builder { private String userIdType; // 用户 ID 类型 private String departmentIdType; // 此次调用中使用的部门 ID 的类型 + private String jobLevelIdType; // 此次调用中使用的「职级 ID」的类型 + private String jobFamilyIdType; // 此次调用中使用的「序列 ID」的类型 + private String employeeTypeIdType; // 此次调用中使用的「人员类型 ID」的类型 private String employeeId; // 员工ID /** @@ -119,6 +182,42 @@ public Builder departmentIdType(String departmentIdType) { return this; } + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + * + * @param jobLevelIdType + * @return + */ + public Builder jobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + return this; + } + + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + * + * @param jobFamilyIdType + * @return + */ + public Builder jobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + return this; + } + + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + * + * @param employeeTypeIdType + * @return + */ + public Builder employeeTypeIdType(String employeeTypeIdType) { + this.employeeTypeIdType = employeeTypeIdType; + return this; + } + /** * 员工ID *

示例值:123 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetJobManagerReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetJobManagerReq.java index b60651efa..b0e334511 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetJobManagerReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetJobManagerReq.java @@ -43,6 +43,7 @@ public class GetJobManagerReq { // builder 开始 public GetJobManagerReq() { } + public GetJobManagerReq(Builder builder) { /** * 此次调用中使用的用户ID的类型 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetJobReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetJobReq.java index b23171ba6..fa6de823d 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetJobReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetJobReq.java @@ -32,6 +32,20 @@ public class GetJobReq { @Query @SerializedName("department_id_type") private String departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_level_id_type") + private String jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_family_id_type") + private String jobFamilyIdType; /** * 职位 ID,请求Path中 *

示例值:6001 @@ -55,6 +69,16 @@ public GetJobReq(Builder builder) { *

示例值: */ this.departmentIdType = builder.departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + this.jobLevelIdType = builder.jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + this.jobFamilyIdType = builder.jobFamilyIdType; /** * 职位 ID,请求Path中 *

示例值:6001 @@ -82,6 +106,22 @@ public void setDepartmentIdType(String departmentIdType) { this.departmentIdType = departmentIdType; } + public String getJobLevelIdType() { + return this.jobLevelIdType; + } + + public void setJobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + } + + public String getJobFamilyIdType() { + return this.jobFamilyIdType; + } + + public void setJobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + } + public String getJobId() { return this.jobId; } @@ -93,6 +133,8 @@ public void setJobId(String jobId) { public static class Builder { private String userIdType; // 此次调用中使用的用户ID的类型 private String departmentIdType; // 此次调用中使用的部门 ID 的类型 + private String jobLevelIdType; // 此次调用中使用的「职级 ID」的类型 + private String jobFamilyIdType; // 此次调用中使用的「序列 ID」的类型 private String jobId; // 职位 ID,请求Path中 /** @@ -119,6 +161,30 @@ public Builder departmentIdType(String departmentIdType) { return this; } + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + * + * @param jobLevelIdType + * @return + */ + public Builder jobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + return this; + } + + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + * + * @param jobFamilyIdType + * @return + */ + public Builder jobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + return this; + } + /** * 职位 ID,请求Path中 *

示例值:6001 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetOfferReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetOfferReq.java index 069e7b557..94e0e49e5 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetOfferReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetOfferReq.java @@ -32,6 +32,27 @@ public class GetOfferReq { @Query @SerializedName("department_id_type") private String departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_level_id_type") + private String jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_family_id_type") + private String jobFamilyIdType; + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("employee_type_id_type") + private String employeeTypeIdType; /** * Offer ID *

示例值:1111111 @@ -55,6 +76,21 @@ public GetOfferReq(Builder builder) { *

示例值: */ this.departmentIdType = builder.departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + this.jobLevelIdType = builder.jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + this.jobFamilyIdType = builder.jobFamilyIdType; + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + */ + this.employeeTypeIdType = builder.employeeTypeIdType; /** * Offer ID *

示例值:1111111 @@ -82,6 +118,30 @@ public void setDepartmentIdType(String departmentIdType) { this.departmentIdType = departmentIdType; } + public String getJobLevelIdType() { + return this.jobLevelIdType; + } + + public void setJobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + } + + public String getJobFamilyIdType() { + return this.jobFamilyIdType; + } + + public void setJobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + } + + public String getEmployeeTypeIdType() { + return this.employeeTypeIdType; + } + + public void setEmployeeTypeIdType(String employeeTypeIdType) { + this.employeeTypeIdType = employeeTypeIdType; + } + public String getOfferId() { return this.offerId; } @@ -93,6 +153,9 @@ public void setOfferId(String offerId) { public static class Builder { private String userIdType; // 此次调用中使用的用户ID的类型 private String departmentIdType; // 此次调用中使用的部门 ID 的类型 + private String jobLevelIdType; // 此次调用中使用的「职级 ID」的类型 + private String jobFamilyIdType; // 此次调用中使用的「序列 ID」的类型 + private String employeeTypeIdType; // 此次调用中使用的「人员类型 ID」的类型 private String offerId; // Offer ID /** @@ -119,6 +182,42 @@ public Builder departmentIdType(String departmentIdType) { return this; } + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + * + * @param jobLevelIdType + * @return + */ + public Builder jobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + return this; + } + + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + * + * @param jobFamilyIdType + * @return + */ + public Builder jobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + return this; + } + + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + * + * @param employeeTypeIdType + * @return + */ + public Builder employeeTypeIdType(String employeeTypeIdType) { + this.employeeTypeIdType = employeeTypeIdType; + return this; + } + /** * Offer ID *

示例值:1111111 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetReferralWebsiteJobPostReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetReferralWebsiteJobPostReq.java index b8ede573e..a4ddc3859 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetReferralWebsiteJobPostReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/GetReferralWebsiteJobPostReq.java @@ -32,6 +32,13 @@ public class GetReferralWebsiteJobPostReq { @Query @SerializedName("department_id_type") private String departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_level_id_type") + private String jobLevelIdType; /** * 职位广告 ID *

示例值:6701528341100366094 @@ -55,6 +62,11 @@ public GetReferralWebsiteJobPostReq(Builder builder) { *

示例值: */ this.departmentIdType = builder.departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + this.jobLevelIdType = builder.jobLevelIdType; /** * 职位广告 ID *

示例值:6701528341100366094 @@ -82,6 +94,14 @@ public void setDepartmentIdType(String departmentIdType) { this.departmentIdType = departmentIdType; } + public String getJobLevelIdType() { + return this.jobLevelIdType; + } + + public void setJobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + } + public String getJobPostId() { return this.jobPostId; } @@ -93,6 +113,7 @@ public void setJobPostId(String jobPostId) { public static class Builder { private String userIdType; // 用户 ID 类型 private String departmentIdType; // 此次调用中使用的部门 ID 的类型 + private String jobLevelIdType; // 此次调用中使用的「职级 ID」的类型 private String jobPostId; // 职位广告 ID /** @@ -119,6 +140,18 @@ public Builder departmentIdType(String departmentIdType) { return this; } + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + * + * @param jobLevelIdType + * @return + */ + public Builder jobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + return this; + } + /** * 职位广告 ID *

示例值:6701528341100366094 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ListApplicationInterviewReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ListApplicationInterviewReq.java index bd7246901..b1dc7b00c 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ListApplicationInterviewReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ListApplicationInterviewReq.java @@ -39,6 +39,13 @@ public class ListApplicationInterviewReq { @Query @SerializedName("user_id_type") private String userIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_level_id_type") + private String jobLevelIdType; /** * 投递 ID *

示例值:6960663240925956555 @@ -67,6 +74,11 @@ public ListApplicationInterviewReq(Builder builder) { *

示例值:open_id */ this.userIdType = builder.userIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + this.jobLevelIdType = builder.jobLevelIdType; /** * 投递 ID *

示例值:6960663240925956555 @@ -102,6 +114,14 @@ public void setUserIdType(String userIdType) { this.userIdType = userIdType; } + public String getJobLevelIdType() { + return this.jobLevelIdType; + } + + public void setJobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + } + public String getApplicationId() { return this.applicationId; } @@ -114,6 +134,7 @@ public static class Builder { private Integer pageSize; // 分页大小,不能超过 50 private String pageToken; // 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 private String userIdType; // 此次调用中使用的用户ID的类型 + private String jobLevelIdType; // 此次调用中使用的「职级 ID」的类型 private String applicationId; // 投递 ID /** @@ -152,6 +173,18 @@ public Builder userIdType(String userIdType) { return this; } + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + * + * @param jobLevelIdType + * @return + */ + public Builder jobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + return this; + } + /** * 投递 ID *

示例值:6960663240925956555 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ListByIdJobRequirementReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ListByIdJobRequirementReq.java index 78ace9500..2ef299bd1 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ListByIdJobRequirementReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ListByIdJobRequirementReq.java @@ -32,6 +32,27 @@ public class ListByIdJobRequirementReq { @Query @SerializedName("department_id_type") private String departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_level_id_type") + private String jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_family_id_type") + private String jobFamilyIdType; + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("employee_type_id_type") + private String employeeTypeIdType; @Body private ListByIdJobRequirementReqBody body; @@ -50,6 +71,21 @@ public ListByIdJobRequirementReq(Builder builder) { *

示例值: */ this.departmentIdType = builder.departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + this.jobLevelIdType = builder.jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + this.jobFamilyIdType = builder.jobFamilyIdType; + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + */ + this.employeeTypeIdType = builder.employeeTypeIdType; this.body = builder.body; } @@ -73,6 +109,30 @@ public void setDepartmentIdType(String departmentIdType) { this.departmentIdType = departmentIdType; } + public String getJobLevelIdType() { + return this.jobLevelIdType; + } + + public void setJobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + } + + public String getJobFamilyIdType() { + return this.jobFamilyIdType; + } + + public void setJobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + } + + public String getEmployeeTypeIdType() { + return this.employeeTypeIdType; + } + + public void setEmployeeTypeIdType(String employeeTypeIdType) { + this.employeeTypeIdType = employeeTypeIdType; + } + public ListByIdJobRequirementReqBody getListByIdJobRequirementReqBody() { return this.body; } @@ -84,6 +144,9 @@ public void setListByIdJobRequirementReqBody(ListByIdJobRequirementReqBody body) public static class Builder { private String userIdType; // 此次调用中使用的用户ID的类型 private String departmentIdType; // 此次调用中使用的部门 ID 的类型 + private String jobLevelIdType; // 此次调用中使用的「职级 ID」的类型 + private String jobFamilyIdType; // 此次调用中使用的「序列 ID」的类型 + private String employeeTypeIdType; // 此次调用中使用的「人员类型 ID」的类型 private ListByIdJobRequirementReqBody body; /** @@ -110,6 +173,42 @@ public Builder departmentIdType(String departmentIdType) { return this; } + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + * + * @param jobLevelIdType + * @return + */ + public Builder jobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + return this; + } + + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + * + * @param jobFamilyIdType + * @return + */ + public Builder jobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + return this; + } + + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + * + * @param employeeTypeIdType + * @return + */ + public Builder employeeTypeIdType(String employeeTypeIdType) { + this.employeeTypeIdType = employeeTypeIdType; + return this; + } + public ListByIdJobRequirementReqBody getListByIdJobRequirementReqBody() { return this.body; } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ListInterviewReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ListInterviewReq.java index a86a33a23..353b1e80f 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ListInterviewReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ListInterviewReq.java @@ -59,6 +59,13 @@ public class ListInterviewReq { @Query @SerializedName("end_time") private String endTime; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_level_id_type") + private String jobLevelIdType; /** * 此次调用中使用的用户ID的类型 *

示例值: @@ -102,6 +109,11 @@ public ListInterviewReq(Builder builder) { *

示例值:1610489908000 */ this.endTime = builder.endTime; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + this.jobLevelIdType = builder.jobLevelIdType; /** * 此次调用中使用的用户ID的类型 *

示例值: @@ -161,6 +173,14 @@ public void setEndTime(String endTime) { this.endTime = endTime; } + public String getJobLevelIdType() { + return this.jobLevelIdType; + } + + public void setJobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + } + public String getUserIdType() { return this.userIdType; } @@ -176,6 +196,7 @@ public static class Builder { private String interviewId; // 面试 ID private String startTime; // 最早开始时间,格式为时间戳 private String endTime; // 最晚开始时间,格式为时间戳 + private String jobLevelIdType; // 此次调用中使用的「职级 ID」的类型 private String userIdType; // 此次调用中使用的用户ID的类型 @@ -257,6 +278,19 @@ public Builder endTime(String endTime) { } + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + * + * @param jobLevelIdType + * @return + */ + public Builder jobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + return this; + } + + /** * 此次调用中使用的用户ID的类型 *

示例值: diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ListJobRequirementReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ListJobRequirementReq.java index 4e302003d..0d741394f 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ListJobRequirementReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ListJobRequirementReq.java @@ -80,6 +80,27 @@ public class ListJobRequirementReq { @Query @SerializedName("department_id_type") private String departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_level_id_type") + private String jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_family_id_type") + private String jobFamilyIdType; + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("employee_type_id_type") + private String employeeTypeIdType; // builder 开始 public ListJobRequirementReq() { @@ -131,6 +152,21 @@ public ListJobRequirementReq(Builder builder) { *

示例值: */ this.departmentIdType = builder.departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + this.jobLevelIdType = builder.jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + this.jobFamilyIdType = builder.jobFamilyIdType; + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + */ + this.employeeTypeIdType = builder.employeeTypeIdType; } public static Builder newBuilder() { @@ -209,6 +245,30 @@ public void setDepartmentIdType(String departmentIdType) { this.departmentIdType = departmentIdType; } + public String getJobLevelIdType() { + return this.jobLevelIdType; + } + + public void setJobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + } + + public String getJobFamilyIdType() { + return this.jobFamilyIdType; + } + + public void setJobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + } + + public String getEmployeeTypeIdType() { + return this.employeeTypeIdType; + } + + public void setEmployeeTypeIdType(String employeeTypeIdType) { + this.employeeTypeIdType = employeeTypeIdType; + } + public static class Builder { private String pageToken; // 页码标识,获取第一页传空,每次查询会返回下一页的page_token private Integer pageSize; // 每页获取记录数量,最大100 @@ -219,6 +279,9 @@ public static class Builder { private String updateTimeEnd; // 截止更新时间,传入毫秒级时间戳 private String userIdType; // 此次调用中使用的用户ID的类型 private String departmentIdType; // 此次调用中使用的部门 ID 的类型 + private String jobLevelIdType; // 此次调用中使用的「职级 ID」的类型 + private String jobFamilyIdType; // 此次调用中使用的「序列 ID」的类型 + private String employeeTypeIdType; // 此次调用中使用的「人员类型 ID」的类型 /** @@ -337,6 +400,45 @@ public Builder departmentIdType(String departmentIdType) { return this; } + + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + * + * @param jobLevelIdType + * @return + */ + public Builder jobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + return this; + } + + + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + * + * @param jobFamilyIdType + * @return + */ + public Builder jobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + return this; + } + + + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + * + * @param employeeTypeIdType + * @return + */ + public Builder employeeTypeIdType(String employeeTypeIdType) { + this.employeeTypeIdType = employeeTypeIdType; + return this; + } + public ListJobRequirementReq build() { return new ListJobRequirementReq(this); } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ListOfferReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ListOfferReq.java index 8aadf0817..5f8a5075d 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ListOfferReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ListOfferReq.java @@ -45,6 +45,13 @@ public class ListOfferReq { @Query @SerializedName("user_id_type") private String userIdType; + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("employee_type_id_type") + private String employeeTypeIdType; // builder 开始 public ListOfferReq() { @@ -71,6 +78,11 @@ public ListOfferReq(Builder builder) { *

示例值: */ this.userIdType = builder.userIdType; + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + */ + this.employeeTypeIdType = builder.employeeTypeIdType; } public static Builder newBuilder() { @@ -109,11 +121,20 @@ public void setUserIdType(String userIdType) { this.userIdType = userIdType; } + public String getEmployeeTypeIdType() { + return this.employeeTypeIdType; + } + + public void setEmployeeTypeIdType(String employeeTypeIdType) { + this.employeeTypeIdType = employeeTypeIdType; + } + public static class Builder { private String pageToken; // 页码标识,获取第一页传空,每次查询会返回下一页的page_token private Integer pageSize; // 每页获取记录数量,最大100 private String talentId; // 人才 ID private String userIdType; // 此次调用中使用的用户ID的类型 + private String employeeTypeIdType; // 此次调用中使用的「人员类型 ID」的类型 /** @@ -167,6 +188,19 @@ public Builder userIdType(String userIdType) { return this; } + + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + * + * @param employeeTypeIdType + * @return + */ + public Builder employeeTypeIdType(String employeeTypeIdType) { + this.employeeTypeIdType = employeeTypeIdType; + return this; + } + public ListOfferReq build() { return new ListOfferReq(this); } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ListReferralWebsiteJobPostReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ListReferralWebsiteJobPostReq.java index 4ae15c423..c86f4f4fb 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ListReferralWebsiteJobPostReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ListReferralWebsiteJobPostReq.java @@ -52,6 +52,13 @@ public class ListReferralWebsiteJobPostReq { @Query @SerializedName("department_id_type") private String departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_level_id_type") + private String jobLevelIdType; // builder 开始 public ListReferralWebsiteJobPostReq() { @@ -83,6 +90,11 @@ public ListReferralWebsiteJobPostReq(Builder builder) { *

示例值: */ this.departmentIdType = builder.departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + this.jobLevelIdType = builder.jobLevelIdType; } public static Builder newBuilder() { @@ -129,12 +141,21 @@ public void setDepartmentIdType(String departmentIdType) { this.departmentIdType = departmentIdType; } + public String getJobLevelIdType() { + return this.jobLevelIdType; + } + + public void setJobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + } + public static class Builder { private Integer processType; // 招聘流程类型 private String pageToken; // 下一页页码 private Integer pageSize; // 每页获取记录数量,最大10 private String userIdType; // 用户 ID 类型 private String departmentIdType; // 此次调用中使用的部门 ID 的类型 + private String jobLevelIdType; // 此次调用中使用的「职级 ID」的类型 /** @@ -201,6 +222,19 @@ public Builder departmentIdType(String departmentIdType) { return this; } + + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + * + * @param jobLevelIdType + * @return + */ + public Builder jobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + return this; + } + public ListReferralWebsiteJobPostReq build() { return new ListReferralWebsiteJobPostReq(this); } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/MasterLocationAddressInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/MasterLocationAddressInfo.java new file mode 100644 index 000000000..49e96be6e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/MasterLocationAddressInfo.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class MasterLocationAddressInfo { + /** + * 办公地点 + *

示例值: + */ + @SerializedName("location_info") + private MasterLocationInfo locationInfo; + /** + * 办公地址 + *

示例值: + */ + @SerializedName("address_info") + private MasterLocationInfo addressInfo; + + // builder 开始 + public MasterLocationAddressInfo() { + } + + public MasterLocationAddressInfo(Builder builder) { + /** + * 办公地点 + *

示例值: + */ + this.locationInfo = builder.locationInfo; + /** + * 办公地址 + *

示例值: + */ + this.addressInfo = builder.addressInfo; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public MasterLocationInfo getLocationInfo() { + return this.locationInfo; + } + + public void setLocationInfo(MasterLocationInfo locationInfo) { + this.locationInfo = locationInfo; + } + + public MasterLocationInfo getAddressInfo() { + return this.addressInfo; + } + + public void setAddressInfo(MasterLocationInfo addressInfo) { + this.addressInfo = addressInfo; + } + + public static class Builder { + /** + * 办公地点 + *

示例值: + */ + private MasterLocationInfo locationInfo; + /** + * 办公地址 + *

示例值: + */ + private MasterLocationInfo addressInfo; + + /** + * 办公地点 + *

示例值: + * + * @param locationInfo + * @return + */ + public Builder locationInfo(MasterLocationInfo locationInfo) { + this.locationInfo = locationInfo; + return this; + } + + + /** + * 办公地址 + *

示例值: + * + * @param addressInfo + * @return + */ + public Builder addressInfo(MasterLocationInfo addressInfo) { + this.addressInfo = addressInfo; + return this; + } + + + public MasterLocationAddressInfo build() { + return new MasterLocationAddressInfo(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/MasterLocationInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/MasterLocationInfo.java new file mode 100644 index 000000000..bdad25e48 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/MasterLocationInfo.java @@ -0,0 +1,148 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class MasterLocationInfo { + /** + * ID + *

示例值:6930815272790114324 + */ + @SerializedName("id") + private String id; + /** + * 中文名称 + *

示例值:北京 + */ + @SerializedName("zh_name") + private String zhName; + /** + * 英文名称 + *

示例值:Beijing + */ + @SerializedName("en_name") + private String enName; + + // builder 开始 + public MasterLocationInfo() { + } + + public MasterLocationInfo(Builder builder) { + /** + * ID + *

示例值:6930815272790114324 + */ + this.id = builder.id; + /** + * 中文名称 + *

示例值:北京 + */ + this.zhName = builder.zhName; + /** + * 英文名称 + *

示例值:Beijing + */ + this.enName = builder.enName; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public String getZhName() { + return this.zhName; + } + + public void setZhName(String zhName) { + this.zhName = zhName; + } + + public String getEnName() { + return this.enName; + } + + public void setEnName(String enName) { + this.enName = enName; + } + + public static class Builder { + /** + * ID + *

示例值:6930815272790114324 + */ + private String id; + /** + * 中文名称 + *

示例值:北京 + */ + private String zhName; + /** + * 英文名称 + *

示例值:Beijing + */ + private String enName; + + /** + * ID + *

示例值:6930815272790114324 + * + * @param id + * @return + */ + public Builder id(String id) { + this.id = id; + return this; + } + + + /** + * 中文名称 + *

示例值:北京 + * + * @param zhName + * @return + */ + public Builder zhName(String zhName) { + this.zhName = zhName; + return this; + } + + + /** + * 英文名称 + *

示例值:Beijing + * + * @param enName + * @return + */ + public Builder enName(String enName) { + this.enName = enName; + return this; + } + + + public MasterLocationInfo build() { + return new MasterLocationInfo(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/OfferApplicationReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/OfferApplicationReq.java index 2109c75fd..747270491 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/OfferApplicationReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/OfferApplicationReq.java @@ -32,6 +32,27 @@ public class OfferApplicationReq { @Query @SerializedName("department_id_type") private String departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_level_id_type") + private String jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_family_id_type") + private String jobFamilyIdType; + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("employee_type_id_type") + private String employeeTypeIdType; /** * 投递ID *

示例值:6949805467799537964 @@ -55,6 +76,21 @@ public OfferApplicationReq(Builder builder) { *

示例值:open_department_id */ this.departmentIdType = builder.departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + this.jobLevelIdType = builder.jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + this.jobFamilyIdType = builder.jobFamilyIdType; + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + */ + this.employeeTypeIdType = builder.employeeTypeIdType; /** * 投递ID *

示例值:6949805467799537964 @@ -82,6 +118,30 @@ public void setDepartmentIdType(String departmentIdType) { this.departmentIdType = departmentIdType; } + public String getJobLevelIdType() { + return this.jobLevelIdType; + } + + public void setJobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + } + + public String getJobFamilyIdType() { + return this.jobFamilyIdType; + } + + public void setJobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + } + + public String getEmployeeTypeIdType() { + return this.employeeTypeIdType; + } + + public void setEmployeeTypeIdType(String employeeTypeIdType) { + this.employeeTypeIdType = employeeTypeIdType; + } + public String getApplicationId() { return this.applicationId; } @@ -93,6 +153,9 @@ public void setApplicationId(String applicationId) { public static class Builder { private String userIdType; // 用户 ID 类型 private String departmentIdType; // 此次调用中使用的部门 ID 的类型 + private String jobLevelIdType; // 此次调用中使用的「职级 ID」的类型 + private String jobFamilyIdType; // 此次调用中使用的「序列 ID」的类型 + private String employeeTypeIdType; // 此次调用中使用的「人员类型 ID」的类型 private String applicationId; // 投递ID /** @@ -119,6 +182,42 @@ public Builder departmentIdType(String departmentIdType) { return this; } + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + * + * @param jobLevelIdType + * @return + */ + public Builder jobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + return this; + } + + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + * + * @param jobFamilyIdType + * @return + */ + public Builder jobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + return this; + } + + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + * + * @param employeeTypeIdType + * @return + */ + public Builder employeeTypeIdType(String employeeTypeIdType) { + this.employeeTypeIdType = employeeTypeIdType; + return this; + } + /** * 投递ID *

示例值:6949805467799537964 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/PatchEmployeeReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/PatchEmployeeReq.java index ddbab5976..a1af5b758 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/PatchEmployeeReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/PatchEmployeeReq.java @@ -33,6 +33,27 @@ public class PatchEmployeeReq { @Query @SerializedName("department_id_type") private String departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_level_id_type") + private String jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_family_id_type") + private String jobFamilyIdType; + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("employee_type_id_type") + private String employeeTypeIdType; /** * 员工ID *

示例值:123 @@ -58,6 +79,21 @@ public PatchEmployeeReq(Builder builder) { *

示例值:department_id */ this.departmentIdType = builder.departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + this.jobLevelIdType = builder.jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + this.jobFamilyIdType = builder.jobFamilyIdType; + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + */ + this.employeeTypeIdType = builder.employeeTypeIdType; /** * 员工ID *

示例值:123 @@ -86,6 +122,30 @@ public void setDepartmentIdType(String departmentIdType) { this.departmentIdType = departmentIdType; } + public String getJobLevelIdType() { + return this.jobLevelIdType; + } + + public void setJobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + } + + public String getJobFamilyIdType() { + return this.jobFamilyIdType; + } + + public void setJobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + } + + public String getEmployeeTypeIdType() { + return this.employeeTypeIdType; + } + + public void setEmployeeTypeIdType(String employeeTypeIdType) { + this.employeeTypeIdType = employeeTypeIdType; + } + public String getEmployeeId() { return this.employeeId; } @@ -105,6 +165,9 @@ public void setChangeEmployeeStage(ChangeEmployeeStage body) { public static class Builder { private String userIdType; // 用户 ID 类型 private String departmentIdType; // 此次调用中使用的部门 ID 的类型 + private String jobLevelIdType; // 此次调用中使用的「职级 ID」的类型 + private String jobFamilyIdType; // 此次调用中使用的「序列 ID」的类型 + private String employeeTypeIdType; // 此次调用中使用的「人员类型 ID」的类型 private String employeeId; // 员工ID private ChangeEmployeeStage body; @@ -132,6 +195,42 @@ public Builder departmentIdType(String departmentIdType) { return this; } + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + * + * @param jobLevelIdType + * @return + */ + public Builder jobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + return this; + } + + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + * + * @param jobFamilyIdType + * @return + */ + public Builder jobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + return this; + } + + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + * + * @param employeeTypeIdType + * @return + */ + public Builder employeeTypeIdType(String employeeTypeIdType) { + this.employeeTypeIdType = employeeTypeIdType; + return this; + } + /** * 员工ID *

示例值:123 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ReferralInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ReferralInfo.java new file mode 100644 index 000000000..f60995b7c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/ReferralInfo.java @@ -0,0 +1,185 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class ReferralInfo { + /** + * 内推的 ID + *

示例值:6930815272790114322 + */ + @SerializedName("id") + private String id; + /** + * 投递 ID 列表,包含:原始内推的投递 ID、转移到其他职位后的投递 ID、不包含被HR复捞(加入职位)的投递 ID,第一个投递就是原始投递ID + *

示例值: + */ + @SerializedName("application_ids") + private String[] applicationIds; + /** + * 创建时间(ms) + *

示例值:1618899376474 + */ + @SerializedName("create_time") + private String createTime; + /** + * 内推人信息 + *

示例值: + */ + @SerializedName("referral_user") + private IdNameObject referralUser; + + // builder 开始 + public ReferralInfo() { + } + + public ReferralInfo(Builder builder) { + /** + * 内推的 ID + *

示例值:6930815272790114322 + */ + this.id = builder.id; + /** + * 投递 ID 列表,包含:原始内推的投递 ID、转移到其他职位后的投递 ID、不包含被HR复捞(加入职位)的投递 ID,第一个投递就是原始投递ID + *

示例值: + */ + this.applicationIds = builder.applicationIds; + /** + * 创建时间(ms) + *

示例值:1618899376474 + */ + this.createTime = builder.createTime; + /** + * 内推人信息 + *

示例值: + */ + this.referralUser = builder.referralUser; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public String[] getApplicationIds() { + return this.applicationIds; + } + + public void setApplicationIds(String[] applicationIds) { + this.applicationIds = applicationIds; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public IdNameObject getReferralUser() { + return this.referralUser; + } + + public void setReferralUser(IdNameObject referralUser) { + this.referralUser = referralUser; + } + + public static class Builder { + /** + * 内推的 ID + *

示例值:6930815272790114322 + */ + private String id; + /** + * 投递 ID 列表,包含:原始内推的投递 ID、转移到其他职位后的投递 ID、不包含被HR复捞(加入职位)的投递 ID,第一个投递就是原始投递ID + *

示例值: + */ + private String[] applicationIds; + /** + * 创建时间(ms) + *

示例值:1618899376474 + */ + private String createTime; + /** + * 内推人信息 + *

示例值: + */ + private IdNameObject referralUser; + + /** + * 内推的 ID + *

示例值:6930815272790114322 + * + * @param id + * @return + */ + public Builder id(String id) { + this.id = id; + return this; + } + + + /** + * 投递 ID 列表,包含:原始内推的投递 ID、转移到其他职位后的投递 ID、不包含被HR复捞(加入职位)的投递 ID,第一个投递就是原始投递ID + *

示例值: + * + * @param applicationIds + * @return + */ + public Builder applicationIds(String[] applicationIds) { + this.applicationIds = applicationIds; + return this; + } + + + /** + * 创建时间(ms) + *

示例值:1618899376474 + * + * @param createTime + * @return + */ + public Builder createTime(String createTime) { + this.createTime = createTime; + return this; + } + + + /** + * 内推人信息 + *

示例值: + * + * @param referralUser + * @return + */ + public Builder referralUser(IdNameObject referralUser) { + this.referralUser = referralUser; + return this; + } + + + public ReferralInfo build() { + return new ReferralInfo(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/TransferOnboardApplicationReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/TransferOnboardApplicationReq.java index 892f3bb07..fdac67c07 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/TransferOnboardApplicationReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/TransferOnboardApplicationReq.java @@ -33,6 +33,27 @@ public class TransferOnboardApplicationReq { @Query @SerializedName("department_id_type") private String departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_level_id_type") + private String jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_family_id_type") + private String jobFamilyIdType; + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("employee_type_id_type") + private String employeeTypeIdType; /** * 投递ID *

示例值:7073372582620416300 @@ -58,6 +79,21 @@ public TransferOnboardApplicationReq(Builder builder) { *

示例值: */ this.departmentIdType = builder.departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + this.jobLevelIdType = builder.jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + this.jobFamilyIdType = builder.jobFamilyIdType; + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + */ + this.employeeTypeIdType = builder.employeeTypeIdType; /** * 投递ID *

示例值:7073372582620416300 @@ -86,6 +122,30 @@ public void setDepartmentIdType(String departmentIdType) { this.departmentIdType = departmentIdType; } + public String getJobLevelIdType() { + return this.jobLevelIdType; + } + + public void setJobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + } + + public String getJobFamilyIdType() { + return this.jobFamilyIdType; + } + + public void setJobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + } + + public String getEmployeeTypeIdType() { + return this.employeeTypeIdType; + } + + public void setEmployeeTypeIdType(String employeeTypeIdType) { + this.employeeTypeIdType = employeeTypeIdType; + } + public String getApplicationId() { return this.applicationId; } @@ -105,6 +165,9 @@ public void setTransferOnboardApplicationReqBody(TransferOnboardApplicationReqBo public static class Builder { private String userIdType; // 用户 ID 类型 private String departmentIdType; // 此次调用中使用的部门 ID 的类型 + private String jobLevelIdType; // 此次调用中使用的「职级 ID」的类型 + private String jobFamilyIdType; // 此次调用中使用的「序列 ID」的类型 + private String employeeTypeIdType; // 此次调用中使用的「人员类型 ID」的类型 private String applicationId; // 投递ID private TransferOnboardApplicationReqBody body; @@ -132,6 +195,42 @@ public Builder departmentIdType(String departmentIdType) { return this; } + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + * + * @param jobLevelIdType + * @return + */ + public Builder jobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + return this; + } + + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + * + * @param jobFamilyIdType + * @return + */ + public Builder jobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + return this; + } + + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + * + * @param employeeTypeIdType + * @return + */ + public Builder employeeTypeIdType(String employeeTypeIdType) { + this.employeeTypeIdType = employeeTypeIdType; + return this; + } + /** * 投递ID *

示例值:7073372582620416300 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/TripartiteAgreementInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/TripartiteAgreementInfo.java new file mode 100644 index 000000000..0448f4fd9 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/TripartiteAgreementInfo.java @@ -0,0 +1,222 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class TripartiteAgreementInfo { + /** + * 三方协议 ID + *

示例值:6930815272790114324 + */ + @SerializedName("id") + private String id; + /** + * 投递ID + *

示例值:6930815272790114325 + */ + @SerializedName("application_id") + private String applicationId; + /** + * 三方协议状态 + *

示例值:1 + */ + @SerializedName("state") + private Integer state; + /** + * 三方协议创建时间,毫秒时间戳 + *

示例值:1698292282660 + */ + @SerializedName("create_time") + private String createTime; + /** + * 三方协议修改时间,毫秒时间戳 + *

示例值:1698292282661 + */ + @SerializedName("modify_time") + private String modifyTime; + + // builder 开始 + public TripartiteAgreementInfo() { + } + + public TripartiteAgreementInfo(Builder builder) { + /** + * 三方协议 ID + *

示例值:6930815272790114324 + */ + this.id = builder.id; + /** + * 投递ID + *

示例值:6930815272790114325 + */ + this.applicationId = builder.applicationId; + /** + * 三方协议状态 + *

示例值:1 + */ + this.state = builder.state; + /** + * 三方协议创建时间,毫秒时间戳 + *

示例值:1698292282660 + */ + this.createTime = builder.createTime; + /** + * 三方协议修改时间,毫秒时间戳 + *

示例值:1698292282661 + */ + this.modifyTime = builder.modifyTime; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public String getApplicationId() { + return this.applicationId; + } + + public void setApplicationId(String applicationId) { + this.applicationId = applicationId; + } + + public Integer getState() { + return this.state; + } + + public void setState(Integer state) { + this.state = state; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getModifyTime() { + return this.modifyTime; + } + + public void setModifyTime(String modifyTime) { + this.modifyTime = modifyTime; + } + + public static class Builder { + /** + * 三方协议 ID + *

示例值:6930815272790114324 + */ + private String id; + /** + * 投递ID + *

示例值:6930815272790114325 + */ + private String applicationId; + /** + * 三方协议状态 + *

示例值:1 + */ + private Integer state; + /** + * 三方协议创建时间,毫秒时间戳 + *

示例值:1698292282660 + */ + private String createTime; + /** + * 三方协议修改时间,毫秒时间戳 + *

示例值:1698292282661 + */ + private String modifyTime; + + /** + * 三方协议 ID + *

示例值:6930815272790114324 + * + * @param id + * @return + */ + public Builder id(String id) { + this.id = id; + return this; + } + + + /** + * 投递ID + *

示例值:6930815272790114325 + * + * @param applicationId + * @return + */ + public Builder applicationId(String applicationId) { + this.applicationId = applicationId; + return this; + } + + + /** + * 三方协议状态 + *

示例值:1 + * + * @param state + * @return + */ + public Builder state(Integer state) { + this.state = state; + return this; + } + + + /** + * 三方协议创建时间,毫秒时间戳 + *

示例值:1698292282660 + * + * @param createTime + * @return + */ + public Builder createTime(String createTime) { + this.createTime = createTime; + return this; + } + + + /** + * 三方协议修改时间,毫秒时间戳 + *

示例值:1698292282661 + * + * @param modifyTime + * @return + */ + public Builder modifyTime(String modifyTime) { + this.modifyTime = modifyTime; + return this; + } + + + public TripartiteAgreementInfo build() { + return new TripartiteAgreementInfo(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/UpdateJobRequirementReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/UpdateJobRequirementReq.java index 81bf2d1ab..cb376657d 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/UpdateJobRequirementReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/UpdateJobRequirementReq.java @@ -33,6 +33,27 @@ public class UpdateJobRequirementReq { @Query @SerializedName("department_id_type") private String departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_level_id_type") + private String jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_family_id_type") + private String jobFamilyIdType; + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("employee_type_id_type") + private String employeeTypeIdType; /** * 招聘需求ID *

示例值:623455234 @@ -58,6 +79,21 @@ public UpdateJobRequirementReq(Builder builder) { *

示例值: */ this.departmentIdType = builder.departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + this.jobLevelIdType = builder.jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + this.jobFamilyIdType = builder.jobFamilyIdType; + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + */ + this.employeeTypeIdType = builder.employeeTypeIdType; /** * 招聘需求ID *

示例值:623455234 @@ -86,6 +122,30 @@ public void setDepartmentIdType(String departmentIdType) { this.departmentIdType = departmentIdType; } + public String getJobLevelIdType() { + return this.jobLevelIdType; + } + + public void setJobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + } + + public String getJobFamilyIdType() { + return this.jobFamilyIdType; + } + + public void setJobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + } + + public String getEmployeeTypeIdType() { + return this.employeeTypeIdType; + } + + public void setEmployeeTypeIdType(String employeeTypeIdType) { + this.employeeTypeIdType = employeeTypeIdType; + } + public String getJobRequirementId() { return this.jobRequirementId; } @@ -105,6 +165,9 @@ public void setJobRequirement(JobRequirement body) { public static class Builder { private String userIdType; // 此次调用中使用的用户ID的类型 private String departmentIdType; // 此次调用中使用的部门 ID 的类型 + private String jobLevelIdType; // 此次调用中使用的「职级 ID」的类型 + private String jobFamilyIdType; // 此次调用中使用的「序列 ID」的类型 + private String employeeTypeIdType; // 此次调用中使用的「人员类型 ID」的类型 private String jobRequirementId; // 招聘需求ID private JobRequirement body; @@ -132,6 +195,42 @@ public Builder departmentIdType(String departmentIdType) { return this; } + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + * + * @param jobLevelIdType + * @return + */ + public Builder jobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + return this; + } + + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + * + * @param jobFamilyIdType + * @return + */ + public Builder jobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + return this; + } + + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + * + * @param employeeTypeIdType + * @return + */ + public Builder employeeTypeIdType(String employeeTypeIdType) { + this.employeeTypeIdType = employeeTypeIdType; + return this; + } + /** * 招聘需求ID *

示例值:623455234 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/UpdateOfferReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/UpdateOfferReq.java index 85e16236c..5bead4a7a 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/UpdateOfferReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/model/UpdateOfferReq.java @@ -33,6 +33,27 @@ public class UpdateOfferReq { @Query @SerializedName("department_id_type") private String departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_level_id_type") + private String jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("job_family_id_type") + private String jobFamilyIdType; + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + */ + @Query + @SerializedName("employee_type_id_type") + private String employeeTypeIdType; /** * Offer ID *

示例值:7016605170635213100 @@ -58,6 +79,21 @@ public UpdateOfferReq(Builder builder) { *

示例值: */ this.departmentIdType = builder.departmentIdType; + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + */ + this.jobLevelIdType = builder.jobLevelIdType; + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + */ + this.jobFamilyIdType = builder.jobFamilyIdType; + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + */ + this.employeeTypeIdType = builder.employeeTypeIdType; /** * Offer ID *

示例值:7016605170635213100 @@ -86,6 +122,30 @@ public void setDepartmentIdType(String departmentIdType) { this.departmentIdType = departmentIdType; } + public String getJobLevelIdType() { + return this.jobLevelIdType; + } + + public void setJobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + } + + public String getJobFamilyIdType() { + return this.jobFamilyIdType; + } + + public void setJobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + } + + public String getEmployeeTypeIdType() { + return this.employeeTypeIdType; + } + + public void setEmployeeTypeIdType(String employeeTypeIdType) { + this.employeeTypeIdType = employeeTypeIdType; + } + public String getOfferId() { return this.offerId; } @@ -105,6 +165,9 @@ public void setOfferInfo(OfferInfo body) { public static class Builder { private String userIdType; // 此次调用中使用的用户ID的类型 private String departmentIdType; // 此次调用中使用的部门 ID 的类型 + private String jobLevelIdType; // 此次调用中使用的「职级 ID」的类型 + private String jobFamilyIdType; // 此次调用中使用的「序列 ID」的类型 + private String employeeTypeIdType; // 此次调用中使用的「人员类型 ID」的类型 private String offerId; // Offer ID private OfferInfo body; @@ -132,6 +195,42 @@ public Builder departmentIdType(String departmentIdType) { return this; } + /** + * 此次调用中使用的「职级 ID」的类型 + *

示例值: + * + * @param jobLevelIdType + * @return + */ + public Builder jobLevelIdType(String jobLevelIdType) { + this.jobLevelIdType = jobLevelIdType; + return this; + } + + /** + * 此次调用中使用的「序列 ID」的类型 + *

示例值: + * + * @param jobFamilyIdType + * @return + */ + public Builder jobFamilyIdType(String jobFamilyIdType) { + this.jobFamilyIdType = jobFamilyIdType; + return this; + } + + /** + * 此次调用中使用的「人员类型 ID」的类型 + *

示例值: + * + * @param employeeTypeIdType + * @return + */ + public Builder employeeTypeIdType(String employeeTypeIdType) { + this.employeeTypeIdType = employeeTypeIdType; + return this; + } + /** * Offer ID *

示例值:7016605170635213100 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Application.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Application.java new file mode 100644 index 000000000..acef577a9 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Application.java @@ -0,0 +1,434 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Application { + private static final Logger log = LoggerFactory.getLogger(Application.class); + private final Config config; + + public Application(Config config) { + this.config = config; + } + + + /** + * 创建投递,根据人才 ID 和职位 ID 创建投递 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateApplicationSample.java ; + */ + public CreateApplicationResp create(CreateApplicationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/applications" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateApplicationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建投递,根据人才 ID 和职位 ID 创建投递 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateApplicationSample.java ; + */ + public CreateApplicationResp create(CreateApplicationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/applications" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateApplicationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取投递信息,根据投递 ID 获取单个投递信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetApplicationSample.java ; + */ + public GetApplicationResp get(GetApplicationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/applications/:application_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetApplicationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications/:application_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取投递信息,根据投递 ID 获取单个投递信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetApplicationSample.java ; + */ + public GetApplicationResp get(GetApplicationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/applications/:application_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetApplicationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications/:application_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取投递列表,根据限定条件获取投递列表信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListApplicationSample.java ; + */ + public ListApplicationResp list(ListApplicationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/applications" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListApplicationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取投递列表,根据限定条件获取投递列表信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListApplicationSample.java ; + */ + public ListApplicationResp list(ListApplicationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/applications" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListApplicationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取 Offer 信息,根据投递 ID 获取 Offer 信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/offer ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/OfferApplicationSample.java ; + */ + public OfferApplicationResp offer(OfferApplicationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/applications/:application_id/offer" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + OfferApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, OfferApplicationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications/:application_id/offer" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取 Offer 信息,根据投递 ID 获取 Offer 信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/offer ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/OfferApplicationSample.java ; + */ + public OfferApplicationResp offer(OfferApplicationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/applications/:application_id/offer" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + OfferApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, OfferApplicationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications/:application_id/offer" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 终止投递,根据投递 ID 修改投递状态为「已终止」 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/terminate ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/TerminateApplicationSample.java ; + */ + public TerminateApplicationResp terminate(TerminateApplicationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/applications/:application_id/terminate" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + TerminateApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TerminateApplicationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications/:application_id/terminate" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 终止投递,根据投递 ID 修改投递状态为「已终止」 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/terminate ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/TerminateApplicationSample.java ; + */ + public TerminateApplicationResp terminate(TerminateApplicationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/applications/:application_id/terminate" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + TerminateApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TerminateApplicationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications/:application_id/terminate" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 操作候选人入职,根据投递 ID 操作候选人入职并创建员工。投递须处于「待入职」阶段,可通过「转移阶段」接口变更投递状态 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/transfer_onboard ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/TransferOnboardApplicationSample.java ; + */ + public TransferOnboardApplicationResp transferOnboard(TransferOnboardApplicationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/applications/:application_id/transfer_onboard" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + TransferOnboardApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TransferOnboardApplicationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications/:application_id/transfer_onboard" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 操作候选人入职,根据投递 ID 操作候选人入职并创建员工。投递须处于「待入职」阶段,可通过「转移阶段」接口变更投递状态 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/transfer_onboard ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/TransferOnboardApplicationSample.java ; + */ + public TransferOnboardApplicationResp transferOnboard(TransferOnboardApplicationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/applications/:application_id/transfer_onboard" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + TransferOnboardApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TransferOnboardApplicationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications/:application_id/transfer_onboard" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ApplicationInterview.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ApplicationInterview.java new file mode 100644 index 000000000..19fe13943 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ApplicationInterview.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.ListApplicationInterviewReq; +import com.lark.oapi.service.hire.v1.model.ListApplicationInterviewResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ApplicationInterview { + private static final Logger log = LoggerFactory.getLogger(ApplicationInterview.class); + private final Config config; + + public ApplicationInterview(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=application.interview&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListApplicationInterviewSample.java ; + */ + public ListApplicationInterviewResp list(ListApplicationInterviewReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/applications/:application_id/interviews" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListApplicationInterviewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListApplicationInterviewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications/:application_id/interviews" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=application.interview&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListApplicationInterviewSample.java ; + */ + public ListApplicationInterviewResp list(ListApplicationInterviewReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/applications/:application_id/interviews" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListApplicationInterviewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListApplicationInterviewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/applications/:application_id/interviews" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Attachment.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Attachment.java new file mode 100644 index 000000000..8b7bdecf4 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Attachment.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.GetAttachmentReq; +import com.lark.oapi.service.hire.v1.model.GetAttachmentResp; +import com.lark.oapi.service.hire.v1.model.PreviewAttachmentReq; +import com.lark.oapi.service.hire.v1.model.PreviewAttachmentResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Attachment { + private static final Logger log = LoggerFactory.getLogger(Attachment.class); + private final Config config; + + public Attachment(Config config) { + this.config = config; + } + + + /** + * 获取附件信息,获取招聘系统中附件的元信息,比如文件名、创建时间、文件url等 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/attachment/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetAttachmentSample.java ; + */ + public GetAttachmentResp get(GetAttachmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/attachments/:attachment_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetAttachmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAttachmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/attachments/:attachment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取附件信息,获取招聘系统中附件的元信息,比如文件名、创建时间、文件url等 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/attachment/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetAttachmentSample.java ; + */ + public GetAttachmentResp get(GetAttachmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/attachments/:attachment_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetAttachmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAttachmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/attachments/:attachment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取附件预览信息,根据附件 ID 获取附件预览信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/attachment/preview ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PreviewAttachmentSample.java ; + */ + public PreviewAttachmentResp preview(PreviewAttachmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/attachments/:attachment_id/preview" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PreviewAttachmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PreviewAttachmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/attachments/:attachment_id/preview" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取附件预览信息,根据附件 ID 获取附件预览信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/attachment/preview ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PreviewAttachmentSample.java ; + */ + public PreviewAttachmentResp preview(PreviewAttachmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/attachments/:attachment_id/preview" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PreviewAttachmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PreviewAttachmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/attachments/:attachment_id/preview" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoAccount.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoAccount.java new file mode 100644 index 000000000..c514a70ea --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoAccount.java @@ -0,0 +1,29 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class EcoAccount { + private static final Logger log = LoggerFactory.getLogger(EcoAccount.class); + private final Config config; + + public EcoAccount(Config config) { + this.config = config; + } + + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoAccountCustomField.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoAccountCustomField.java new file mode 100644 index 000000000..7845cf529 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoAccountCustomField.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class EcoAccountCustomField { + private static final Logger log = LoggerFactory.getLogger(EcoAccountCustomField.class); + private final Config config; + + public EcoAccountCustomField(Config config) { + this.config = config; + } + + + /** + * 删除帐号自定义字段,删除用户在服务商处的身份标示字段(如用户在服务商处的租户 ID)。删除后,不影响已添加帐号对应的自定义字段的值。但在添加新帐号时,将不能再使用此自定义字段。删除不支持撤销,对应的 key 将无法再次复用。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_account_custom_field/batch_delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoAccountCustomFieldSample.java ; + */ + public BatchDeleteEcoAccountCustomFieldResp batchDelete(BatchDeleteEcoAccountCustomFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/eco_account_custom_fields/batch_delete" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchDeleteEcoAccountCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteEcoAccountCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_account_custom_fields/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除帐号自定义字段,删除用户在服务商处的身份标示字段(如用户在服务商处的租户 ID)。删除后,不影响已添加帐号对应的自定义字段的值。但在添加新帐号时,将不能再使用此自定义字段。删除不支持撤销,对应的 key 将无法再次复用。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_account_custom_field/batch_delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoAccountCustomFieldSample.java ; + */ + public BatchDeleteEcoAccountCustomFieldResp batchDelete(BatchDeleteEcoAccountCustomFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/eco_account_custom_fields/batch_delete" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchDeleteEcoAccountCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteEcoAccountCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_account_custom_fields/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新帐号自定义字段,更新用户在服务商处的身份标示字段(如用户在服务商处的租户 ID),此方法只会更新同一 scope 内 key 一致的自定义字段。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_account_custom_field/batch_update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoAccountCustomFieldSample.java ; + */ + public BatchUpdateEcoAccountCustomFieldResp batchUpdate(BatchUpdateEcoAccountCustomFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/hire/v1/eco_account_custom_fields/batch_update" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchUpdateEcoAccountCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUpdateEcoAccountCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_account_custom_fields/batch_update" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新帐号自定义字段,更新用户在服务商处的身份标示字段(如用户在服务商处的租户 ID),此方法只会更新同一 scope 内 key 一致的自定义字段。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_account_custom_field/batch_update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoAccountCustomFieldSample.java ; + */ + public BatchUpdateEcoAccountCustomFieldResp batchUpdate(BatchUpdateEcoAccountCustomFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/hire/v1/eco_account_custom_fields/batch_update" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchUpdateEcoAccountCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUpdateEcoAccountCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_account_custom_fields/batch_update" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建帐号自定义字段,定制用户在服务商处的身份标示字段(如用户在服务商处的租户 ID)。用户在飞书招聘后台添加帐号后,系统会推送「帐号绑定」事件给开发者,事件将携带用户填写的自定义字段信息,开发者可根据此信息识别飞书招聘用户在服务商处的身份信息,完成飞书招聘用户和服务商帐号的绑定,并以此来推送对应的套餐或试卷列表等。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_account_custom_field/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoAccountCustomFieldSample.java ; + */ + public CreateEcoAccountCustomFieldResp create(CreateEcoAccountCustomFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/eco_account_custom_fields" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateEcoAccountCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEcoAccountCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_account_custom_fields" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建帐号自定义字段,定制用户在服务商处的身份标示字段(如用户在服务商处的租户 ID)。用户在飞书招聘后台添加帐号后,系统会推送「帐号绑定」事件给开发者,事件将携带用户填写的自定义字段信息,开发者可根据此信息识别飞书招聘用户在服务商处的身份信息,完成飞书招聘用户和服务商帐号的绑定,并以此来推送对应的套餐或试卷列表等。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_account_custom_field/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoAccountCustomFieldSample.java ; + */ + public CreateEcoAccountCustomFieldResp create(CreateEcoAccountCustomFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/eco_account_custom_fields" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateEcoAccountCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEcoAccountCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_account_custom_fields" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoBackgroundCheck.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoBackgroundCheck.java new file mode 100644 index 000000000..08cad9547 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoBackgroundCheck.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class EcoBackgroundCheck { + private static final Logger log = LoggerFactory.getLogger(EcoBackgroundCheck.class); + private final Config config; + + public EcoBackgroundCheck(Config config) { + this.config = config; + } + + + /** + * 终止背调订单,终止背调订单 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check/cancel ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CancelEcoBackgroundCheckSample.java ; + */ + public CancelEcoBackgroundCheckResp cancel(CancelEcoBackgroundCheckReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/eco_background_checks/cancel" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CancelEcoBackgroundCheckResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CancelEcoBackgroundCheckResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_checks/cancel" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 终止背调订单,终止背调订单 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check/cancel ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CancelEcoBackgroundCheckSample.java ; + */ + public CancelEcoBackgroundCheckResp cancel(CancelEcoBackgroundCheckReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/eco_background_checks/cancel" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CancelEcoBackgroundCheckResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CancelEcoBackgroundCheckResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_checks/cancel" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新背调进度,更新指定背调的进度信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check/update_progress ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateProgressEcoBackgroundCheckSample.java ; + */ + public UpdateProgressEcoBackgroundCheckResp updateProgress(UpdateProgressEcoBackgroundCheckReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/eco_background_checks/update_progress" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateProgressEcoBackgroundCheckResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateProgressEcoBackgroundCheckResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_checks/update_progress" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新背调进度,更新指定背调的进度信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check/update_progress ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateProgressEcoBackgroundCheckSample.java ; + */ + public UpdateProgressEcoBackgroundCheckResp updateProgress(UpdateProgressEcoBackgroundCheckReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/eco_background_checks/update_progress" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateProgressEcoBackgroundCheckResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateProgressEcoBackgroundCheckResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_checks/update_progress" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 回传背调的最终结果,回传背调的最终结果 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check/update_result ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateResultEcoBackgroundCheckSample.java ; + */ + public UpdateResultEcoBackgroundCheckResp updateResult(UpdateResultEcoBackgroundCheckReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/eco_background_checks/update_result" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateResultEcoBackgroundCheckResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateResultEcoBackgroundCheckResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_checks/update_result" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 回传背调的最终结果,回传背调的最终结果 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check/update_result ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateResultEcoBackgroundCheckSample.java ; + */ + public UpdateResultEcoBackgroundCheckResp updateResult(UpdateResultEcoBackgroundCheckReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/eco_background_checks/update_result" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateResultEcoBackgroundCheckResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateResultEcoBackgroundCheckResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_checks/update_result" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoBackgroundCheckCustomField.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoBackgroundCheckCustomField.java new file mode 100644 index 000000000..8c5288213 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoBackgroundCheckCustomField.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class EcoBackgroundCheckCustomField { + private static final Logger log = LoggerFactory.getLogger(EcoBackgroundCheckCustomField.class); + private final Config config; + + public EcoBackgroundCheckCustomField(Config config) { + this.config = config; + } + + + /** + * 删除背调自定义字段,删除用户在发起背调时的自定义字段,删除不影响已创建的背调,删除后对应的自定义字段的 key 不能再复用。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_custom_field/batch_delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoBackgroundCheckCustomFieldSample.java ; + */ + public BatchDeleteEcoBackgroundCheckCustomFieldResp batchDelete(BatchDeleteEcoBackgroundCheckCustomFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/eco_background_check_custom_fields/batch_delete" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchDeleteEcoBackgroundCheckCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteEcoBackgroundCheckCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_check_custom_fields/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除背调自定义字段,删除用户在发起背调时的自定义字段,删除不影响已创建的背调,删除后对应的自定义字段的 key 不能再复用。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_custom_field/batch_delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoBackgroundCheckCustomFieldSample.java ; + */ + public BatchDeleteEcoBackgroundCheckCustomFieldResp batchDelete(BatchDeleteEcoBackgroundCheckCustomFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/eco_background_check_custom_fields/batch_delete" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchDeleteEcoBackgroundCheckCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteEcoBackgroundCheckCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_check_custom_fields/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新背调自定义字段,更新用户在发起背调时的自定义字段。更新操作不支持更新自定义字段类型,且将影响已发起的背调表单展示。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_custom_field/batch_update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoBackgroundCheckCustomFieldSample.java ; + */ + public BatchUpdateEcoBackgroundCheckCustomFieldResp batchUpdate(BatchUpdateEcoBackgroundCheckCustomFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/hire/v1/eco_background_check_custom_fields/batch_update" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchUpdateEcoBackgroundCheckCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUpdateEcoBackgroundCheckCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_check_custom_fields/batch_update" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新背调自定义字段,更新用户在发起背调时的自定义字段。更新操作不支持更新自定义字段类型,且将影响已发起的背调表单展示。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_custom_field/batch_update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoBackgroundCheckCustomFieldSample.java ; + */ + public BatchUpdateEcoBackgroundCheckCustomFieldResp batchUpdate(BatchUpdateEcoBackgroundCheckCustomFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/hire/v1/eco_background_check_custom_fields/batch_update" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchUpdateEcoBackgroundCheckCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUpdateEcoBackgroundCheckCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_check_custom_fields/batch_update" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建背调自定义字段,定制用户在发起背调时的自定义字段 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_custom_field/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoBackgroundCheckCustomFieldSample.java ; + */ + public CreateEcoBackgroundCheckCustomFieldResp create(CreateEcoBackgroundCheckCustomFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/eco_background_check_custom_fields" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateEcoBackgroundCheckCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEcoBackgroundCheckCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_check_custom_fields" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建背调自定义字段,定制用户在发起背调时的自定义字段 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_custom_field/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoBackgroundCheckCustomFieldSample.java ; + */ + public CreateEcoBackgroundCheckCustomFieldResp create(CreateEcoBackgroundCheckCustomFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/eco_background_check_custom_fields" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateEcoBackgroundCheckCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEcoBackgroundCheckCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_check_custom_fields" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoBackgroundCheckPackage.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoBackgroundCheckPackage.java new file mode 100644 index 000000000..436cd0e6f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoBackgroundCheckPackage.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class EcoBackgroundCheckPackage { + private static final Logger log = LoggerFactory.getLogger(EcoBackgroundCheckPackage.class); + private final Config config; + + public EcoBackgroundCheckPackage(Config config) { + this.config = config; + } + + + /** + * 删除背调套餐和附加调查项,删除指定帐号的指定背调套餐和附加调查项信息,删除不会影响已创建的背调。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_package/batch_delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoBackgroundCheckPackageSample.java ; + */ + public BatchDeleteEcoBackgroundCheckPackageResp batchDelete(BatchDeleteEcoBackgroundCheckPackageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/eco_background_check_packages/batch_delete" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchDeleteEcoBackgroundCheckPackageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteEcoBackgroundCheckPackageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_check_packages/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除背调套餐和附加调查项,删除指定帐号的指定背调套餐和附加调查项信息,删除不会影响已创建的背调。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_package/batch_delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoBackgroundCheckPackageSample.java ; + */ + public BatchDeleteEcoBackgroundCheckPackageResp batchDelete(BatchDeleteEcoBackgroundCheckPackageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/eco_background_check_packages/batch_delete" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchDeleteEcoBackgroundCheckPackageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteEcoBackgroundCheckPackageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_check_packages/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新背调套餐和附加调查项,更新指定帐号可用的背调套餐和附加调查项信息,更新将影响已发起背调的表单项展示 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_package/batch_update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoBackgroundCheckPackageSample.java ; + */ + public BatchUpdateEcoBackgroundCheckPackageResp batchUpdate(BatchUpdateEcoBackgroundCheckPackageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/hire/v1/eco_background_check_packages/batch_update" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchUpdateEcoBackgroundCheckPackageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUpdateEcoBackgroundCheckPackageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_check_packages/batch_update" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新背调套餐和附加调查项,更新指定帐号可用的背调套餐和附加调查项信息,更新将影响已发起背调的表单项展示 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_package/batch_update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoBackgroundCheckPackageSample.java ; + */ + public BatchUpdateEcoBackgroundCheckPackageResp batchUpdate(BatchUpdateEcoBackgroundCheckPackageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/hire/v1/eco_background_check_packages/batch_update" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchUpdateEcoBackgroundCheckPackageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUpdateEcoBackgroundCheckPackageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_check_packages/batch_update" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 推送背调套餐和附加调查项,定制指定帐号可用的背调套餐和附加调查项信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_package/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoBackgroundCheckPackageSample.java ; + */ + public CreateEcoBackgroundCheckPackageResp create(CreateEcoBackgroundCheckPackageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/eco_background_check_packages" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateEcoBackgroundCheckPackageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEcoBackgroundCheckPackageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_check_packages" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 推送背调套餐和附加调查项,定制指定帐号可用的背调套餐和附加调查项信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_package/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoBackgroundCheckPackageSample.java ; + */ + public CreateEcoBackgroundCheckPackageResp create(CreateEcoBackgroundCheckPackageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/eco_background_check_packages" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateEcoBackgroundCheckPackageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEcoBackgroundCheckPackageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_background_check_packages" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoExam.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoExam.java new file mode 100644 index 000000000..6dd88209a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoExam.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.LoginInfoEcoExamReq; +import com.lark.oapi.service.hire.v1.model.LoginInfoEcoExamResp; +import com.lark.oapi.service.hire.v1.model.UpdateResultEcoExamReq; +import com.lark.oapi.service.hire.v1.model.UpdateResultEcoExamResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class EcoExam { + private static final Logger log = LoggerFactory.getLogger(EcoExam.class); + private final Config config; + + public EcoExam(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=login_info&project=hire&resource=eco_exam&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/LoginInfoEcoExamSample.java ; + */ + public LoginInfoEcoExamResp loginInfo(LoginInfoEcoExamReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/eco_exams/:exam_id/login_info" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + LoginInfoEcoExamResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, LoginInfoEcoExamResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_exams/:exam_id/login_info" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=login_info&project=hire&resource=eco_exam&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/LoginInfoEcoExamSample.java ; + */ + public LoginInfoEcoExamResp loginInfo(LoginInfoEcoExamReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/eco_exams/:exam_id/login_info" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + LoginInfoEcoExamResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, LoginInfoEcoExamResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_exams/:exam_id/login_info" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_result&project=hire&resource=eco_exam&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateResultEcoExamSample.java ; + */ + public UpdateResultEcoExamResp updateResult(UpdateResultEcoExamReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/eco_exams/:exam_id/update_result" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateResultEcoExamResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateResultEcoExamResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_exams/:exam_id/update_result" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_result&project=hire&resource=eco_exam&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateResultEcoExamSample.java ; + */ + public UpdateResultEcoExamResp updateResult(UpdateResultEcoExamReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/eco_exams/:exam_id/update_result" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateResultEcoExamResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateResultEcoExamResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_exams/:exam_id/update_result" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoExamPaper.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoExamPaper.java new file mode 100644 index 000000000..a9a2ebe27 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EcoExamPaper.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class EcoExamPaper { + private static final Logger log = LoggerFactory.getLogger(EcoExamPaper.class); + private final Config config; + + public EcoExamPaper(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=hire&resource=eco_exam_paper&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoExamPaperSample.java ; + */ + public BatchDeleteEcoExamPaperResp batchDelete(BatchDeleteEcoExamPaperReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/eco_exam_papers/batch_delete" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchDeleteEcoExamPaperResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteEcoExamPaperResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_exam_papers/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=hire&resource=eco_exam_paper&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoExamPaperSample.java ; + */ + public BatchDeleteEcoExamPaperResp batchDelete(BatchDeleteEcoExamPaperReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/eco_exam_papers/batch_delete" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchDeleteEcoExamPaperResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteEcoExamPaperResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_exam_papers/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_update&project=hire&resource=eco_exam_paper&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoExamPaperSample.java ; + */ + public BatchUpdateEcoExamPaperResp batchUpdate(BatchUpdateEcoExamPaperReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/hire/v1/eco_exam_papers/batch_update" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchUpdateEcoExamPaperResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUpdateEcoExamPaperResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_exam_papers/batch_update" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_update&project=hire&resource=eco_exam_paper&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoExamPaperSample.java ; + */ + public BatchUpdateEcoExamPaperResp batchUpdate(BatchUpdateEcoExamPaperReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/hire/v1/eco_exam_papers/batch_update" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchUpdateEcoExamPaperResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUpdateEcoExamPaperResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_exam_papers/batch_update" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=hire&resource=eco_exam_paper&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoExamPaperSample.java ; + */ + public CreateEcoExamPaperResp create(CreateEcoExamPaperReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/eco_exam_papers" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateEcoExamPaperResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEcoExamPaperResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_exam_papers" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=hire&resource=eco_exam_paper&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoExamPaperSample.java ; + */ + public CreateEcoExamPaperResp create(CreateEcoExamPaperReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/eco_exam_papers" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateEcoExamPaperResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEcoExamPaperResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_exam_papers" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EhrImportTask.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EhrImportTask.java new file mode 100644 index 000000000..9f0123df6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EhrImportTask.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.PatchEhrImportTaskReq; +import com.lark.oapi.service.hire.v1.model.PatchEhrImportTaskResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class EhrImportTask { + private static final Logger log = LoggerFactory.getLogger(EhrImportTask.class); + private final Config config; + + public EhrImportTask(Config config) { + this.config = config; + } + + + /** + * 更新 e-HR 导入任务结果,在处理完导入 e-HR 事件后,可调用该接口,更新 e-HR 导入任务结果 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/ehr_import_task/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PatchEhrImportTaskSample.java ; + */ + public PatchEhrImportTaskResp patch(PatchEhrImportTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/hire/v1/ehr_import_tasks/:ehr_import_task_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchEhrImportTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchEhrImportTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/ehr_import_tasks/:ehr_import_task_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新 e-HR 导入任务结果,在处理完导入 e-HR 事件后,可调用该接口,更新 e-HR 导入任务结果 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/ehr_import_task/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PatchEhrImportTaskSample.java ; + */ + public PatchEhrImportTaskResp patch(PatchEhrImportTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/hire/v1/ehr_import_tasks/:ehr_import_task_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchEhrImportTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchEhrImportTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/ehr_import_tasks/:ehr_import_task_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EhrImportTaskForInternshipOffer.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EhrImportTaskForInternshipOffer.java new file mode 100644 index 000000000..d75cdfeec --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/EhrImportTaskForInternshipOffer.java @@ -0,0 +1,29 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class EhrImportTaskForInternshipOffer { + private static final Logger log = LoggerFactory.getLogger(EhrImportTaskForInternshipOffer.class); + private final Config config; + + public EhrImportTaskForInternshipOffer(Config config) { + this.config = config; + } + + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Employee.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Employee.java new file mode 100644 index 000000000..a053d020a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Employee.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Employee { + private static final Logger log = LoggerFactory.getLogger(Employee.class); + private final Config config; + + public Employee(Config config) { + this.config = config; + } + + + /** + * 通过员工 ID 获取入职信息,通过员工 ID 获取入职信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/employee/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetEmployeeSample.java ; + */ + public GetEmployeeResp get(GetEmployeeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/employees/:employee_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetEmployeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetEmployeeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/employees/:employee_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 通过员工 ID 获取入职信息,通过员工 ID 获取入职信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/employee/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetEmployeeSample.java ; + */ + public GetEmployeeResp get(GetEmployeeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/employees/:employee_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetEmployeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetEmployeeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/employees/:employee_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 通过投递 ID 获取入职信息,通过投递 ID 获取入职信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/employee/get_by_application ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetByApplicationEmployeeSample.java ; + */ + public GetByApplicationEmployeeResp getByApplication(GetByApplicationEmployeeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/employees/get_by_application" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetByApplicationEmployeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetByApplicationEmployeeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/employees/get_by_application" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 通过投递 ID 获取入职信息,通过投递 ID 获取入职信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/employee/get_by_application ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetByApplicationEmployeeSample.java ; + */ + public GetByApplicationEmployeeResp getByApplication(GetByApplicationEmployeeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/employees/get_by_application" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetByApplicationEmployeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetByApplicationEmployeeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/employees/get_by_application" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新入职状态,根据员工 ID 更新员工转正、离职状态 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/employee/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PatchEmployeeSample.java ; + */ + public PatchEmployeeResp patch(PatchEmployeeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/hire/v1/employees/:employee_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchEmployeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchEmployeeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/employees/:employee_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新入职状态,根据员工 ID 更新员工转正、离职状态 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/employee/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PatchEmployeeSample.java ; + */ + public PatchEmployeeResp patch(PatchEmployeeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/hire/v1/employees/:employee_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchEmployeeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchEmployeeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/employees/:employee_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Evaluation.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Evaluation.java new file mode 100644 index 000000000..f88316299 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Evaluation.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.ListEvaluationReq; +import com.lark.oapi.service.hire.v1.model.ListEvaluationResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Evaluation { + private static final Logger log = LoggerFactory.getLogger(Evaluation.class); + private final Config config; + + public Evaluation(Config config) { + this.config = config; + } + + + /** + * 获取简历评估信息,获取简历评估信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/evaluation/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListEvaluationSample.java ; + */ + public ListEvaluationResp list(ListEvaluationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/evaluations" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListEvaluationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListEvaluationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/evaluations" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取简历评估信息,获取简历评估信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/evaluation/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListEvaluationSample.java ; + */ + public ListEvaluationResp list(ListEvaluationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/evaluations" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListEvaluationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListEvaluationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/evaluations" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ExternalApplication.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ExternalApplication.java new file mode 100644 index 000000000..d560b049b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ExternalApplication.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ExternalApplication { + private static final Logger log = LoggerFactory.getLogger(ExternalApplication.class); + private final Config config; + + public ExternalApplication(Config config) { + this.config = config; + } + + + /** + * 创建外部投递,导入来自其他系统的投递信息,创建为外部投递 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/external_application/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalApplicationSample.java ; + */ + public CreateExternalApplicationResp create(CreateExternalApplicationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/external_applications" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateExternalApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExternalApplicationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/external_applications" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建外部投递,导入来自其他系统的投递信息,创建为外部投递 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/external_application/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalApplicationSample.java ; + */ + public CreateExternalApplicationResp create(CreateExternalApplicationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/external_applications" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateExternalApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExternalApplicationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/external_applications" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,删除外部投递 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=hire&resource=external_application&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/DeleteExternalApplicationSample.java ; + */ + public DeleteExternalApplicationResp delete(DeleteExternalApplicationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/hire/v1/external_applications/:external_application_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteExternalApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteExternalApplicationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/external_applications/:external_application_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,删除外部投递 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=hire&resource=external_application&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/DeleteExternalApplicationSample.java ; + */ + public DeleteExternalApplicationResp delete(DeleteExternalApplicationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/hire/v1/external_applications/:external_application_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteExternalApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteExternalApplicationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/external_applications/:external_application_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,更新外部投递 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=hire&resource=external_application&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateExternalApplicationSample.java ; + */ + public UpdateExternalApplicationResp update(UpdateExternalApplicationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/hire/v1/external_applications/:external_application_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateExternalApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateExternalApplicationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/external_applications/:external_application_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,更新外部投递 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=hire&resource=external_application&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateExternalApplicationSample.java ; + */ + public UpdateExternalApplicationResp update(UpdateExternalApplicationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/hire/v1/external_applications/:external_application_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateExternalApplicationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateExternalApplicationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/external_applications/:external_application_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ExternalBackgroundCheck.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ExternalBackgroundCheck.java new file mode 100644 index 000000000..3ec9f601e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ExternalBackgroundCheck.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.CreateExternalBackgroundCheckReq; +import com.lark.oapi.service.hire.v1.model.CreateExternalBackgroundCheckResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ExternalBackgroundCheck { + private static final Logger log = LoggerFactory.getLogger(ExternalBackgroundCheck.class); + private final Config config; + + public ExternalBackgroundCheck(Config config) { + this.config = config; + } + + + /** + * 创建外部背调,导入来自其他系统的背调信息,创建为外部背调 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/external_background_check/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalBackgroundCheckSample.java ; + */ + public CreateExternalBackgroundCheckResp create(CreateExternalBackgroundCheckReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/external_background_checks" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateExternalBackgroundCheckResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExternalBackgroundCheckResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/external_background_checks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建外部背调,导入来自其他系统的背调信息,创建为外部背调 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/external_background_check/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalBackgroundCheckSample.java ; + */ + public CreateExternalBackgroundCheckResp create(CreateExternalBackgroundCheckReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/external_background_checks" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateExternalBackgroundCheckResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExternalBackgroundCheckResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/external_background_checks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ExternalInterview.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ExternalInterview.java new file mode 100644 index 000000000..1aab4f95f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ExternalInterview.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.CreateExternalInterviewReq; +import com.lark.oapi.service.hire.v1.model.CreateExternalInterviewResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ExternalInterview { + private static final Logger log = LoggerFactory.getLogger(ExternalInterview.class); + private final Config config; + + public ExternalInterview(Config config) { + this.config = config; + } + + + /** + * 创建外部面试,导入来自其他系统的面试信息,创建为外部面试 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/external_interview/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalInterviewSample.java ; + */ + public CreateExternalInterviewResp create(CreateExternalInterviewReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/external_interviews" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateExternalInterviewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExternalInterviewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/external_interviews" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建外部面试,导入来自其他系统的面试信息,创建为外部面试 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/external_interview/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalInterviewSample.java ; + */ + public CreateExternalInterviewResp create(CreateExternalInterviewReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/external_interviews" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateExternalInterviewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExternalInterviewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/external_interviews" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ExternalInterviewAssessment.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ExternalInterviewAssessment.java new file mode 100644 index 000000000..f5a34d3c7 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ExternalInterviewAssessment.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.CreateExternalInterviewAssessmentReq; +import com.lark.oapi.service.hire.v1.model.CreateExternalInterviewAssessmentResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ExternalInterviewAssessment { + private static final Logger log = LoggerFactory.getLogger(ExternalInterviewAssessment.class); + private final Config config; + + public ExternalInterviewAssessment(Config config) { + this.config = config; + } + + + /** + * 创建外部面评,导入来自其他系统的面评信息,创建为外部面评 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/external_interview_assessment/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalInterviewAssessmentSample.java ; + */ + public CreateExternalInterviewAssessmentResp create(CreateExternalInterviewAssessmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/external_interview_assessments" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateExternalInterviewAssessmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExternalInterviewAssessmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/external_interview_assessments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建外部面评,导入来自其他系统的面评信息,创建为外部面评 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/external_interview_assessment/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalInterviewAssessmentSample.java ; + */ + public CreateExternalInterviewAssessmentResp create(CreateExternalInterviewAssessmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/external_interview_assessments" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateExternalInterviewAssessmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateExternalInterviewAssessmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/external_interview_assessments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Interview.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Interview.java new file mode 100644 index 000000000..829200d37 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Interview.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.ListInterviewReq; +import com.lark.oapi.service.hire.v1.model.ListInterviewResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Interview { + private static final Logger log = LoggerFactory.getLogger(Interview.class); + private final Config config; + + public Interview(Config config) { + this.config = config; + } + + + /** + * 获取面试信息,根据投递 ID 或面试时间获取面试信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/interview/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListInterviewSample.java ; + */ + public ListInterviewResp list(ListInterviewReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/interviews" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListInterviewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListInterviewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/interviews" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取面试信息,根据投递 ID 或面试时间获取面试信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/interview/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListInterviewSample.java ; + */ + public ListInterviewResp list(ListInterviewReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/interviews" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListInterviewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListInterviewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/interviews" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Job.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Job.java new file mode 100644 index 000000000..5fbfc77d6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Job.java @@ -0,0 +1,368 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Job { + private static final Logger log = LoggerFactory.getLogger(Job.class); + private final Config config; + + public Job(Config config) { + this.config = config; + } + + + /** + * 新建职位,新建职位,字段的是否必填,以系统中的「职位字段管理」中的设置为准。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/combined_create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CombinedCreateJobSample.java ; + */ + public CombinedCreateJobResp combinedCreate(CombinedCreateJobReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/jobs/combined_create" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CombinedCreateJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CombinedCreateJobResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/jobs/combined_create" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 新建职位,新建职位,字段的是否必填,以系统中的「职位字段管理」中的设置为准。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/combined_create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CombinedCreateJobSample.java ; + */ + public CombinedCreateJobResp combinedCreate(CombinedCreateJobReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/jobs/combined_create" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CombinedCreateJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CombinedCreateJobResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/jobs/combined_create" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新职位,更新职位信息,该接口为全量更新,若字段没有返回值,则原有值将会被清空。字段的是否必填,将以系统中的「职位字段管理」中的设置为准。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/combined_update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CombinedUpdateJobSample.java ; + */ + public CombinedUpdateJobResp combinedUpdate(CombinedUpdateJobReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/jobs/:job_id/combined_update" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CombinedUpdateJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CombinedUpdateJobResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/jobs/:job_id/combined_update" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新职位,更新职位信息,该接口为全量更新,若字段没有返回值,则原有值将会被清空。字段的是否必填,将以系统中的「职位字段管理」中的设置为准。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/combined_update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CombinedUpdateJobSample.java ; + */ + public CombinedUpdateJobResp combinedUpdate(CombinedUpdateJobReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/jobs/:job_id/combined_update" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CombinedUpdateJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CombinedUpdateJobResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/jobs/:job_id/combined_update" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取职位设置,获取职位设置 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/config ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ConfigJobSample.java ; + */ + public ConfigJobResp config(ConfigJobReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/jobs/:job_id/config" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ConfigJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ConfigJobResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/jobs/:job_id/config" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取职位设置,获取职位设置 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/config ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ConfigJobSample.java ; + */ + public ConfigJobResp config(ConfigJobReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/jobs/:job_id/config" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ConfigJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ConfigJobResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/jobs/:job_id/config" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取职位信息,根据职位 ID 获取职位信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetJobSample.java ; + */ + public GetJobResp get(GetJobReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/jobs/:job_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/jobs/:job_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取职位信息,根据职位 ID 获取职位信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetJobSample.java ; + */ + public GetJobResp get(GetJobReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/jobs/:job_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/jobs/:job_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新职位设置,更新职位设置,包括面试评价表、Offer 申请表等。接口将按照所选择的「更新选项」进行设置参数校验和更新。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/update_config ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateConfigJobSample.java ; + */ + public UpdateConfigJobResp updateConfig(UpdateConfigJobReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/jobs/:job_id/update_config" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateConfigJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateConfigJobResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/jobs/:job_id/update_config" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新职位设置,更新职位设置,包括面试评价表、Offer 申请表等。接口将按照所选择的「更新选项」进行设置参数校验和更新。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/update_config ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateConfigJobSample.java ; + */ + public UpdateConfigJobResp updateConfig(UpdateConfigJobReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/jobs/:job_id/update_config" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateConfigJobResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateConfigJobResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/jobs/:job_id/update_config" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/JobManager.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/JobManager.java new file mode 100644 index 000000000..0a2ae6f98 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/JobManager.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.GetJobManagerReq; +import com.lark.oapi.service.hire.v1.model.GetJobManagerResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class JobManager { + private static final Logger log = LoggerFactory.getLogger(JobManager.class); + private final Config config; + + public JobManager(Config config) { + this.config = config; + } + + + /** + * 获取职位上的招聘人员信息,根据职位 ID 获取职位上的招聘人员信息,如招聘负责人、用人经理 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job-manager/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetJobManagerSample.java ; + */ + public GetJobManagerResp get(GetJobManagerReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/jobs/:job_id/managers/:manager_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetJobManagerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobManagerResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/jobs/:job_id/managers/:manager_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取职位上的招聘人员信息,根据职位 ID 获取职位上的招聘人员信息,如招聘负责人、用人经理 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job-manager/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetJobManagerSample.java ; + */ + public GetJobManagerResp get(GetJobManagerReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/jobs/:job_id/managers/:manager_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetJobManagerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetJobManagerResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/jobs/:job_id/managers/:manager_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/JobProcess.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/JobProcess.java new file mode 100644 index 000000000..d982bb6b6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/JobProcess.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.ListJobProcessReq; +import com.lark.oapi.service.hire.v1.model.ListJobProcessResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class JobProcess { + private static final Logger log = LoggerFactory.getLogger(JobProcess.class); + private final Config config; + + public JobProcess(Config config) { + this.config = config; + } + + + /** + * 获取招聘流程信息,获取全部招聘流程信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_process/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobProcessSample.java ; + */ + public ListJobProcessResp list(ListJobProcessReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/job_processes" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListJobProcessResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobProcessResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_processes" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取招聘流程信息,获取全部招聘流程信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_process/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobProcessSample.java ; + */ + public ListJobProcessResp list(ListJobProcessReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/job_processes" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListJobProcessResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobProcessResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_processes" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/JobRequirement.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/JobRequirement.java new file mode 100644 index 000000000..e38fd71e5 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/JobRequirement.java @@ -0,0 +1,368 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class JobRequirement { + private static final Logger log = LoggerFactory.getLogger(JobRequirement.class); + private final Config config; + + public JobRequirement(Config config) { + this.config = config; + } + + + /** + * 创建招聘需求,创建招聘需求,除招聘需求编号为必填外,其他字段是否必填与飞书招聘「招聘需求字段管理」内设置一致 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateJobRequirementSample.java ; + */ + public CreateJobRequirementResp create(CreateJobRequirementReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/job_requirements" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateJobRequirementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobRequirementResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_requirements" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建招聘需求,创建招聘需求,除招聘需求编号为必填外,其他字段是否必填与飞书招聘「招聘需求字段管理」内设置一致 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateJobRequirementSample.java ; + */ + public CreateJobRequirementResp create(CreateJobRequirementReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/job_requirements" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateJobRequirementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateJobRequirementResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_requirements" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除招聘需求,删除招聘需求 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/DeleteJobRequirementSample.java ; + */ + public DeleteJobRequirementResp delete(DeleteJobRequirementReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/hire/v1/job_requirements/:job_requirement_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteJobRequirementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobRequirementResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_requirements/:job_requirement_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除招聘需求,删除招聘需求 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/DeleteJobRequirementSample.java ; + */ + public DeleteJobRequirementResp delete(DeleteJobRequirementReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/hire/v1/job_requirements/:job_requirement_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteJobRequirementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteJobRequirementResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_requirements/:job_requirement_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取招聘需求列表,获取招聘需求列表 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobRequirementSample.java ; + */ + public ListJobRequirementResp list(ListJobRequirementReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/job_requirements" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListJobRequirementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobRequirementResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_requirements" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取招聘需求列表,获取招聘需求列表 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobRequirementSample.java ; + */ + public ListJobRequirementResp list(ListJobRequirementReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/job_requirements" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListJobRequirementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobRequirementResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_requirements" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,获取招聘需求信息 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list_by_id&project=hire&resource=job_requirement&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListByIdJobRequirementSample.java ; + */ + public ListByIdJobRequirementResp listById(ListByIdJobRequirementReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/job_requirements/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListByIdJobRequirementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListByIdJobRequirementResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_requirements/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,获取招聘需求信息 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list_by_id&project=hire&resource=job_requirement&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListByIdJobRequirementSample.java ; + */ + public ListByIdJobRequirementResp listById(ListByIdJobRequirementReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/job_requirements/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListByIdJobRequirementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListByIdJobRequirementResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_requirements/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新招聘需求,更新招聘需求 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateJobRequirementSample.java ; + */ + public UpdateJobRequirementResp update(UpdateJobRequirementReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/hire/v1/job_requirements/:job_requirement_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateJobRequirementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateJobRequirementResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_requirements/:job_requirement_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新招聘需求,更新招聘需求 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateJobRequirementSample.java ; + */ + public UpdateJobRequirementResp update(UpdateJobRequirementReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/hire/v1/job_requirements/:job_requirement_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateJobRequirementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateJobRequirementResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_requirements/:job_requirement_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/JobRequirementSchema.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/JobRequirementSchema.java new file mode 100644 index 000000000..9cefe520d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/JobRequirementSchema.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.ListJobRequirementSchemaReq; +import com.lark.oapi.service.hire.v1.model.ListJobRequirementSchemaResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class JobRequirementSchema { + private static final Logger log = LoggerFactory.getLogger(JobRequirementSchema.class); + private final Config config; + + public JobRequirementSchema(Config config) { + this.config = config; + } + + + /** + * 获取招聘需求模板,获取招聘需求模板 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement_schema/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobRequirementSchemaSample.java ; + */ + public ListJobRequirementSchemaResp list(ListJobRequirementSchemaReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/job_requirement_schemas" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListJobRequirementSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobRequirementSchemaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_requirement_schemas" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取招聘需求模板,获取招聘需求模板 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement_schema/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobRequirementSchemaSample.java ; + */ + public ListJobRequirementSchemaResp list(ListJobRequirementSchemaReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/job_requirement_schemas" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListJobRequirementSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobRequirementSchemaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_requirement_schemas" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/JobType.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/JobType.java new file mode 100644 index 000000000..a3d73ae22 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/JobType.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.ListJobTypeReq; +import com.lark.oapi.service.hire.v1.model.ListJobTypeResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class JobType { + private static final Logger log = LoggerFactory.getLogger(JobType.class); + private final Config config; + + public JobType(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=job_type&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobTypeSample.java ; + */ + public ListJobTypeResp list(ListJobTypeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/job_types" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListJobTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_types" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=job_type&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobTypeSample.java ; + */ + public ListJobTypeResp list(ListJobTypeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/job_types" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListJobTypeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListJobTypeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/job_types" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Note.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Note.java new file mode 100644 index 000000000..cca61f20e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Note.java @@ -0,0 +1,302 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Note { + private static final Logger log = LoggerFactory.getLogger(Note.class); + private final Config config; + + public Note(Config config) { + this.config = config; + } + + + /** + * 创建备注,创建备注信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateNoteSample.java ; + */ + public CreateNoteResp create(CreateNoteReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/notes" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateNoteResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateNoteResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/notes" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建备注,创建备注信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateNoteSample.java ; + */ + public CreateNoteResp create(CreateNoteReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/notes" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateNoteResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateNoteResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/notes" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取备注,根据备注 ID 获取备注信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetNoteSample.java ; + */ + public GetNoteResp get(GetNoteReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/notes/:note_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetNoteResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetNoteResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/notes/:note_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取备注,根据备注 ID 获取备注信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetNoteSample.java ; + */ + public GetNoteResp get(GetNoteReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/notes/:note_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetNoteResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetNoteResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/notes/:note_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取备注列表,获取备注列表 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListNoteSample.java ; + */ + public ListNoteResp list(ListNoteReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/notes" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListNoteResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListNoteResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/notes" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取备注列表,获取备注列表 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListNoteSample.java ; + */ + public ListNoteResp list(ListNoteReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/notes" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListNoteResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListNoteResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/notes" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新备注,根据备注 ID 更新备注信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PatchNoteSample.java ; + */ + public PatchNoteResp patch(PatchNoteReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/hire/v1/notes/:note_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchNoteResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchNoteResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/notes/:note_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新备注,根据备注 ID 更新备注信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PatchNoteSample.java ; + */ + public PatchNoteResp patch(PatchNoteReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/hire/v1/notes/:note_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchNoteResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchNoteResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/notes/:note_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Offer.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Offer.java new file mode 100644 index 000000000..5dfe9263c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Offer.java @@ -0,0 +1,434 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Offer { + private static final Logger log = LoggerFactory.getLogger(Offer.class); + private final Config config; + + public Offer(Config config) { + this.config = config; + } + + + /** + * 创建 Offer,创建 Offer 时,需传入本文档中标注为必传的参数,其余参数是否必传参考「获取 Offer 申请表模板信息」的参数定义 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateOfferSample.java ; + */ + public CreateOfferResp create(CreateOfferReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/offers" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateOfferResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateOfferResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offers" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建 Offer,创建 Offer 时,需传入本文档中标注为必传的参数,其余参数是否必传参考「获取 Offer 申请表模板信息」的参数定义 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateOfferSample.java ; + */ + public CreateOfferResp create(CreateOfferReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/offers" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateOfferResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateOfferResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offers" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取 Offer 详情,根据 Offer ID 获取 Offer 详细信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetOfferSample.java ; + */ + public GetOfferResp get(GetOfferReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/offers/:offer_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetOfferResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetOfferResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offers/:offer_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取 Offer 详情,根据 Offer ID 获取 Offer 详细信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetOfferSample.java ; + */ + public GetOfferResp get(GetOfferReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/offers/:offer_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetOfferResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetOfferResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offers/:offer_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新实习 Offer 入/离职状态,对「实习待入职」状态的实习 Offer 确认入职、放弃入职,或对「实习已入职」状态的实习 Offer 操作离职 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/intern_offer_status ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/InternOfferStatusOfferSample.java ; + */ + public InternOfferStatusOfferResp internOfferStatus(InternOfferStatusOfferReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/offers/:offer_id/intern_offer_status" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + InternOfferStatusOfferResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, InternOfferStatusOfferResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offers/:offer_id/intern_offer_status" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新实习 Offer 入/离职状态,对「实习待入职」状态的实习 Offer 确认入职、放弃入职,或对「实习已入职」状态的实习 Offer 操作离职 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/intern_offer_status ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/InternOfferStatusOfferSample.java ; + */ + public InternOfferStatusOfferResp internOfferStatus(InternOfferStatusOfferReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/offers/:offer_id/intern_offer_status" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + InternOfferStatusOfferResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, InternOfferStatusOfferResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offers/:offer_id/intern_offer_status" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取 Offer 列表,根据人才 ID 获取 Offer 列表 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListOfferSample.java ; + */ + public ListOfferResp list(ListOfferReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/offers" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListOfferResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListOfferResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offers" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取 Offer 列表,根据人才 ID 获取 Offer 列表 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListOfferSample.java ; + */ + public ListOfferResp list(ListOfferReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/offers" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListOfferResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListOfferResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offers" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=offer_status&project=hire&resource=offer&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/OfferStatusOfferSample.java ; + */ + public OfferStatusOfferResp offerStatus(OfferStatusOfferReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/hire/v1/offers/:offer_id/offer_status" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + OfferStatusOfferResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, OfferStatusOfferResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offers/:offer_id/offer_status" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=offer_status&project=hire&resource=offer&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/OfferStatusOfferSample.java ; + */ + public OfferStatusOfferResp offerStatus(OfferStatusOfferReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/hire/v1/offers/:offer_id/offer_status" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + OfferStatusOfferResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, OfferStatusOfferResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offers/:offer_id/offer_status" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新 Offer 信息,1. 更新 Offer 时,需传入本文档中标注为必传的参数,其余参数是否必传参考「获取 Offer 申请表模板信息」的参数定义;;2. 对系统中已存在的 offer 进行更新的,若更新 offer 中含有「修改需审批」的字段,更新后原 Offer 的审批会自动撤回,需要重新发起审批 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateOfferSample.java ; + */ + public UpdateOfferResp update(UpdateOfferReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/hire/v1/offers/:offer_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateOfferResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateOfferResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offers/:offer_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新 Offer 信息,1. 更新 Offer 时,需传入本文档中标注为必传的参数,其余参数是否必传参考「获取 Offer 申请表模板信息」的参数定义;;2. 对系统中已存在的 offer 进行更新的,若更新 offer 中含有「修改需审批」的字段,更新后原 Offer 的审批会自动撤回,需要重新发起审批 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateOfferSample.java ; + */ + public UpdateOfferResp update(UpdateOfferReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/hire/v1/offers/:offer_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateOfferResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateOfferResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offers/:offer_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/OfferSchema.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/OfferSchema.java new file mode 100644 index 000000000..1e8b3a109 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/OfferSchema.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.GetOfferSchemaReq; +import com.lark.oapi.service.hire.v1.model.GetOfferSchemaResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class OfferSchema { + private static final Logger log = LoggerFactory.getLogger(OfferSchema.class); + private final Config config; + + public OfferSchema(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=hire&resource=offer_schema&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetOfferSchemaSample.java ; + */ + public GetOfferSchemaResp get(GetOfferSchemaReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/offer_schemas/:offer_schema_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetOfferSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetOfferSchemaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offer_schemas/:offer_schema_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=hire&resource=offer_schema&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetOfferSchemaSample.java ; + */ + public GetOfferSchemaResp get(GetOfferSchemaReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/offer_schemas/:offer_schema_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetOfferSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetOfferSchemaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/offer_schemas/:offer_schema_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Questionnaire.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Questionnaire.java new file mode 100644 index 000000000..d4ac7915a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Questionnaire.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.ListQuestionnaireReq; +import com.lark.oapi.service.hire.v1.model.ListQuestionnaireResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Questionnaire { + private static final Logger log = LoggerFactory.getLogger(Questionnaire.class); + private final Config config; + + public Questionnaire(Config config) { + this.config = config; + } + + + /** + * 获取面试满意度问卷列表,获取面试满意度问卷列表 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/questionnaire/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListQuestionnaireSample.java ; + */ + public ListQuestionnaireResp list(ListQuestionnaireReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/questionnaires" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListQuestionnaireResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListQuestionnaireResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/questionnaires" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取面试满意度问卷列表,获取面试满意度问卷列表 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/questionnaire/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListQuestionnaireSample.java ; + */ + public ListQuestionnaireResp list(ListQuestionnaireReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/questionnaires" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListQuestionnaireResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListQuestionnaireResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/questionnaires" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Referral.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Referral.java new file mode 100644 index 000000000..dcb269f9b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Referral.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.GetByApplicationReferralReq; +import com.lark.oapi.service.hire.v1.model.GetByApplicationReferralResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Referral { + private static final Logger log = LoggerFactory.getLogger(Referral.class); + private final Config config; + + public Referral(Config config) { + this.config = config; + } + + + /** + * 获取内推信息,根据投递 ID 获取内推信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/referral/get_by_application ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetByApplicationReferralSample.java ; + */ + public GetByApplicationReferralResp getByApplication(GetByApplicationReferralReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/referrals/get_by_application" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetByApplicationReferralResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetByApplicationReferralResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referrals/get_by_application" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取内推信息,根据投递 ID 获取内推信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/referral/get_by_application ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetByApplicationReferralSample.java ; + */ + public GetByApplicationReferralResp getByApplication(GetByApplicationReferralReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/referrals/get_by_application" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetByApplicationReferralResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetByApplicationReferralResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referrals/get_by_application" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ReferralAccount.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ReferralAccount.java new file mode 100644 index 000000000..ab1128368 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ReferralAccount.java @@ -0,0 +1,302 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ReferralAccount { + private static final Logger log = LoggerFactory.getLogger(ReferralAccount.class); + private final Config config; + + public ReferralAccount(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=hire&resource=referral_account&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateReferralAccountSample.java ; + */ + public CreateReferralAccountResp create(CreateReferralAccountReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/referral_account" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateReferralAccountResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateReferralAccountResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referral_account" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=hire&resource=referral_account&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateReferralAccountSample.java ; + */ + public CreateReferralAccountResp create(CreateReferralAccountReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/referral_account" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateReferralAccountResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateReferralAccountResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referral_account" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=deactivate&project=hire&resource=referral_account&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/DeactivateReferralAccountSample.java ; + */ + public DeactivateReferralAccountResp deactivate(DeactivateReferralAccountReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/referral_account/:referral_account_id/deactivate" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeactivateReferralAccountResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeactivateReferralAccountResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referral_account/:referral_account_id/deactivate" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=deactivate&project=hire&resource=referral_account&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/DeactivateReferralAccountSample.java ; + */ + public DeactivateReferralAccountResp deactivate(DeactivateReferralAccountReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/referral_account/:referral_account_id/deactivate" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeactivateReferralAccountResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeactivateReferralAccountResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referral_account/:referral_account_id/deactivate" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=reconciliation&project=hire&resource=referral_account&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ReconciliationReferralAccountSample.java ; + */ + public ReconciliationReferralAccountResp reconciliation(ReconciliationReferralAccountReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/referral_account/reconciliation" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ReconciliationReferralAccountResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ReconciliationReferralAccountResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referral_account/reconciliation" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=reconciliation&project=hire&resource=referral_account&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ReconciliationReferralAccountSample.java ; + */ + public ReconciliationReferralAccountResp reconciliation(ReconciliationReferralAccountReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/referral_account/reconciliation" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ReconciliationReferralAccountResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ReconciliationReferralAccountResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referral_account/reconciliation" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=withdraw&project=hire&resource=referral_account&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/WithdrawReferralAccountSample.java ; + */ + public WithdrawReferralAccountResp withdraw(WithdrawReferralAccountReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/referral_account/:referral_account_id/withdraw" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + WithdrawReferralAccountResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, WithdrawReferralAccountResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referral_account/:referral_account_id/withdraw" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=withdraw&project=hire&resource=referral_account&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/WithdrawReferralAccountSample.java ; + */ + public WithdrawReferralAccountResp withdraw(WithdrawReferralAccountReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/referral_account/:referral_account_id/withdraw" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + WithdrawReferralAccountResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, WithdrawReferralAccountResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referral_account/:referral_account_id/withdraw" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ReferralWebsiteJobPost.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ReferralWebsiteJobPost.java new file mode 100644 index 000000000..ada537ebc --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ReferralWebsiteJobPost.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.GetReferralWebsiteJobPostReq; +import com.lark.oapi.service.hire.v1.model.GetReferralWebsiteJobPostResp; +import com.lark.oapi.service.hire.v1.model.ListReferralWebsiteJobPostReq; +import com.lark.oapi.service.hire.v1.model.ListReferralWebsiteJobPostResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ReferralWebsiteJobPost { + private static final Logger log = LoggerFactory.getLogger(ReferralWebsiteJobPost.class); + private final Config config; + + public ReferralWebsiteJobPost(Config config) { + this.config = config; + } + + + /** + * ,获取内推官网下职位广告详情 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=hire&resource=referral_website.job_post&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetReferralWebsiteJobPostSample.java ; + */ + public GetReferralWebsiteJobPostResp get(GetReferralWebsiteJobPostReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/referral_websites/job_posts/:job_post_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetReferralWebsiteJobPostResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetReferralWebsiteJobPostResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referral_websites/job_posts/:job_post_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,获取内推官网下职位广告详情 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=hire&resource=referral_website.job_post&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetReferralWebsiteJobPostSample.java ; + */ + public GetReferralWebsiteJobPostResp get(GetReferralWebsiteJobPostReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/referral_websites/job_posts/:job_post_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetReferralWebsiteJobPostResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetReferralWebsiteJobPostResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referral_websites/job_posts/:job_post_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,获取内推官网下的职位列表。自定义数据暂不支持列表获取,请从「获取内推官网下职位广告详情」接口获取 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=referral_website.job_post&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListReferralWebsiteJobPostSample.java ; + */ + public ListReferralWebsiteJobPostResp list(ListReferralWebsiteJobPostReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/referral_websites/job_posts" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListReferralWebsiteJobPostResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListReferralWebsiteJobPostResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referral_websites/job_posts" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,获取内推官网下的职位列表。自定义数据暂不支持列表获取,请从「获取内推官网下职位广告详情」接口获取 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=referral_website.job_post&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListReferralWebsiteJobPostSample.java ; + */ + public ListReferralWebsiteJobPostResp list(ListReferralWebsiteJobPostReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/referral_websites/job_posts" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListReferralWebsiteJobPostResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListReferralWebsiteJobPostResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/referral_websites/job_posts" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/RegistrationSchema.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/RegistrationSchema.java new file mode 100644 index 000000000..05445fa7f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/RegistrationSchema.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.ListRegistrationSchemaReq; +import com.lark.oapi.service.hire.v1.model.ListRegistrationSchemaResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class RegistrationSchema { + private static final Logger log = LoggerFactory.getLogger(RegistrationSchema.class); + private final Config config; + + public RegistrationSchema(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=registration_schema&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListRegistrationSchemaSample.java ; + */ + public ListRegistrationSchemaResp list(ListRegistrationSchemaReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/registration_schemas" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListRegistrationSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListRegistrationSchemaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/registration_schemas" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=registration_schema&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListRegistrationSchemaSample.java ; + */ + public ListRegistrationSchemaResp list(ListRegistrationSchemaReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/registration_schemas" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListRegistrationSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListRegistrationSchemaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/registration_schemas" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ResumeSource.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ResumeSource.java new file mode 100644 index 000000000..802311242 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/ResumeSource.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.ListResumeSourceReq; +import com.lark.oapi.service.hire.v1.model.ListResumeSourceResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ResumeSource { + private static final Logger log = LoggerFactory.getLogger(ResumeSource.class); + private final Config config; + + public ResumeSource(Config config) { + this.config = config; + } + + + /** + * 获取简历来源列表,获取简历来源列表 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/resume_source/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListResumeSourceSample.java ; + */ + public ListResumeSourceResp list(ListResumeSourceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/resume_sources" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListResumeSourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListResumeSourceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/resume_sources" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取简历来源列表,获取简历来源列表 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/resume_source/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListResumeSourceSample.java ; + */ + public ListResumeSourceResp list(ListResumeSourceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/resume_sources" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListResumeSourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListResumeSourceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/resume_sources" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Talent.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Talent.java new file mode 100644 index 000000000..c86ae6c55 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/Talent.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Talent { + private static final Logger log = LoggerFactory.getLogger(Talent.class); + private final Config config; + + public Talent(Config config) { + this.config = config; + } + + + /** + * 将人才加入指定文件夹,将人才加入指定文件夹 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent/add_to_folder ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/AddToFolderTalentSample.java ; + */ + public AddToFolderTalentResp addToFolder(AddToFolderTalentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/talents/add_to_folder" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + AddToFolderTalentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddToFolderTalentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/talents/add_to_folder" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 将人才加入指定文件夹,将人才加入指定文件夹 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent/add_to_folder ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/AddToFolderTalentSample.java ; + */ + public AddToFolderTalentResp addToFolder(AddToFolderTalentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/talents/add_to_folder" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + AddToFolderTalentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddToFolderTalentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/talents/add_to_folder" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 通过人才信息获取人才 ID,通过人才信息获取人才 ID + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent/batch_get_id ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchGetIdTalentSample.java ; + */ + public BatchGetIdTalentResp batchGetId(BatchGetIdTalentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/talents/batch_get_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchGetIdTalentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetIdTalentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/talents/batch_get_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 通过人才信息获取人才 ID,通过人才信息获取人才 ID + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent/batch_get_id ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchGetIdTalentSample.java ; + */ + public BatchGetIdTalentResp batchGetId(BatchGetIdTalentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/hire/v1/talents/batch_get_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchGetIdTalentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetIdTalentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/talents/batch_get_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取人才信息,根据人才 ID 获取人才信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetTalentSample.java ; + */ + public GetTalentResp get(GetTalentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/talents/:talent_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetTalentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTalentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/talents/:talent_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取人才信息,根据人才 ID 获取人才信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetTalentSample.java ; + */ + public GetTalentResp get(GetTalentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/talents/:talent_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetTalentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTalentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/talents/:talent_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/TalentFolder.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/TalentFolder.java new file mode 100644 index 000000000..4ef0d609e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/TalentFolder.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.ListTalentFolderReq; +import com.lark.oapi.service.hire.v1.model.ListTalentFolderResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class TalentFolder { + private static final Logger log = LoggerFactory.getLogger(TalentFolder.class); + private final Config config; + + public TalentFolder(Config config) { + this.config = config; + } + + + /** + * 获取人才文件夹信息,用于获取招聘系统中人才文件夹信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent_folder/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListTalentFolderSample.java ; + */ + public ListTalentFolderResp list(ListTalentFolderReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/talent_folders" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListTalentFolderResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTalentFolderResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/talent_folders" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取人才文件夹信息,用于获取招聘系统中人才文件夹信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent_folder/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListTalentFolderSample.java ; + */ + public ListTalentFolderResp list(ListTalentFolderReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/talent_folders" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListTalentFolderResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTalentFolderResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/talent_folders" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/TalentObject.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/TalentObject.java new file mode 100644 index 000000000..ab317e4e7 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/hire/v1/resource/TalentObject.java @@ -0,0 +1,102 @@ +// Code generated by lark suite 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 com.lark.oapi.service.hire.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.hire.v1.model.QueryTalentObjectResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class TalentObject { + private static final Logger log = LoggerFactory.getLogger(TalentObject.class); + private final Config config; + + public TalentObject(Config config) { + this.config = config; + } + + + /** + * 获取人才字段,获取人才字段 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent_object/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/QueryTalentObjectSample.java ; + */ + public QueryTalentObjectResp query(RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/talent_objects/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , null); + + // 反序列化 + QueryTalentObjectResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryTalentObjectResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/talent_objects/query" + , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + return resp; + } + + /** + * 获取人才字段,获取人才字段 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent_object/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/QueryTalentObjectSample.java ; + */ + public QueryTalentObjectResp query() throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/hire/v1/talent_objects/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , null); + + // 反序列化 + QueryTalentObjectResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryTalentObjectResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/talent_objects/query" + , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/human_authentication/HumanAuthenticationService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/human_authentication/HumanAuthenticationService.java new file mode 100644 index 000000000..e5360b696 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/human_authentication/HumanAuthenticationService.java @@ -0,0 +1,35 @@ +// Code generated by lark suite 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 com.lark.oapi.service.human_authentication; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.human_authentication.v1.V1; +import com.lark.oapi.service.human_authentication.v1.resource.Identity; + +public class HumanAuthenticationService { + private final V1 v1; + private final Identity identity; // 实名认证 + + public HumanAuthenticationService(Config config) { + this.v1 = new V1(config); + this.identity = new Identity(config); + } + + public V1 v1() { + return v1; + } + + public Identity identity() { + return identity; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/human_authentication/v1/HumanAuthenticationService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/human_authentication/v1/HumanAuthenticationService.java deleted file mode 100644 index 0cf902e72..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/human_authentication/v1/HumanAuthenticationService.java +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.human_authentication.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.human_authentication.v1.model.CreateIdentityReq; -import com.lark.oapi.service.human_authentication.v1.model.CreateIdentityResp; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class HumanAuthenticationService { - private static final Logger log = LoggerFactory.getLogger(HumanAuthenticationService.class); - private final Identity identity; // 实名认证 - - public HumanAuthenticationService(Config config) { - this.identity = new Identity(config); - } - - /** - * 实名认证 - * - * @return - */ - public Identity identity() { - return identity; - } - - public static class Identity { - private final Config config; - - public Identity(Config config) { - this.config = config; - } - - /** - * 录入身份信息,该接口用于录入实名认证的身份信息,在唤起有源活体认证前,需要使用该接口进行实名认证。 - *

实名认证接口会有计费管理,接入前请联系飞书开放平台工作人员,邮箱:openplatform@bytedance.com。;;仅通过计费申请的应用,才能在[开发者后台](https://open.feishu.cn/app)查找并申请该接口的权限。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/human_authentication-v1/identity/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/human_authenticationv1/CreateIdentitySample.java ; - */ - public CreateIdentityResp create(CreateIdentityReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/human_authentication/v1/identities" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateIdentityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateIdentityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/human_authentication/v1/identities" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 录入身份信息,该接口用于录入实名认证的身份信息,在唤起有源活体认证前,需要使用该接口进行实名认证。 - *

实名认证接口会有计费管理,接入前请联系飞书开放平台工作人员,邮箱:openplatform@bytedance.com。;;仅通过计费申请的应用,才能在[开发者后台](https://open.feishu.cn/app)查找并申请该接口的权限。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/human_authentication-v1/identity/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/human_authenticationv1/CreateIdentitySample.java ; - */ - public CreateIdentityResp create(CreateIdentityReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/human_authentication/v1/identities" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateIdentityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateIdentityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/human_authentication/v1/identities" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/human_authentication/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/human_authentication/v1/V1.java new file mode 100644 index 000000000..4258105be --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/human_authentication/v1/V1.java @@ -0,0 +1,29 @@ +// Code generated by lark suite 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 com.lark.oapi.service.human_authentication.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.human_authentication.v1.resource.Identity; + +public class V1 { + private final Identity identity; // 实名认证 + + public V1(Config config) { + this.identity = new Identity(config); + } + + public Identity identity() { + return identity; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/human_authentication/v1/resource/Identity.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/human_authentication/v1/resource/Identity.java new file mode 100644 index 000000000..0c57117f0 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/human_authentication/v1/resource/Identity.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.human_authentication.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.human_authentication.v1.model.CreateIdentityReq; +import com.lark.oapi.service.human_authentication.v1.model.CreateIdentityResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Identity { + private static final Logger log = LoggerFactory.getLogger(Identity.class); + private final Config config; + + public Identity(Config config) { + this.config = config; + } + + + /** + * 录入身份信息,该接口用于录入实名认证的身份信息,在唤起有源活体认证前,需要使用该接口进行实名认证。 + *

实名认证接口会有计费管理,接入前请联系飞书开放平台工作人员,邮箱:openplatform@bytedance.com。;;仅通过计费申请的应用,才能在[开发者后台](https://open.feishu.cn/app)查找并申请该接口的权限。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/human_authentication-v1/identity/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/human_authenticationv1/CreateIdentitySample.java ; + */ + public CreateIdentityResp create(CreateIdentityReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/human_authentication/v1/identities" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateIdentityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateIdentityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/human_authentication/v1/identities" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 录入身份信息,该接口用于录入实名认证的身份信息,在唤起有源活体认证前,需要使用该接口进行实名认证。 + *

实名认证接口会有计费管理,接入前请联系飞书开放平台工作人员,邮箱:openplatform@bytedance.com。;;仅通过计费申请的应用,才能在[开发者后台](https://open.feishu.cn/app)查找并申请该接口的权限。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/human_authentication-v1/identity/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/human_authenticationv1/CreateIdentitySample.java ; + */ + public CreateIdentityResp create(CreateIdentityReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/human_authentication/v1/identities" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateIdentityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateIdentityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/human_authentication/v1/identities" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/im/ImService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/ImService.java new file mode 100644 index 000000000..6f213be00 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/ImService.java @@ -0,0 +1,263 @@ +// Code generated by lark suite 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 com.lark.oapi.service.im; + +import com.lark.oapi.core.Config; +import com.lark.oapi.event.IEventHandler; +import com.lark.oapi.service.im.v1.V1; +import com.lark.oapi.service.im.v1.model.*; +import com.lark.oapi.service.im.v1.resource.BatchMessage; +import com.lark.oapi.service.im.v1.resource.Chat; +import com.lark.oapi.service.im.v1.resource.ChatAnnouncement; +import com.lark.oapi.service.im.v1.resource.ChatManagers; +import com.lark.oapi.service.im.v1.resource.ChatMemberBot; +import com.lark.oapi.service.im.v1.resource.ChatMemberUser; +import com.lark.oapi.service.im.v1.resource.ChatMembers; +import com.lark.oapi.service.im.v1.resource.ChatMenuItem; +import com.lark.oapi.service.im.v1.resource.ChatMenuTree; +import com.lark.oapi.service.im.v1.resource.ChatTab; +import com.lark.oapi.service.im.v1.resource.ChatTopNotice; +import com.lark.oapi.service.im.v1.resource.File; +import com.lark.oapi.service.im.v1.resource.Image; +import com.lark.oapi.service.im.v1.resource.Message; +import com.lark.oapi.service.im.v1.resource.MessageReaction; +import com.lark.oapi.service.im.v1.resource.MessageResource; +import com.lark.oapi.service.im.v1.resource.Pin; +import com.lark.oapi.service.im.v1.resource.*; + +public class ImService { + private final V1 v1; + private final BatchMessage batchMessage; // 消息 - 批量消息 + private final Chat chat; // 群组 + private final ChatAnnouncement chatAnnouncement; // 群组 - 群公告 + private final ChatManagers chatManagers; // 群组 - 群成员 + private final ChatMemberBot chatMemberBot; // 事件 + private final ChatMemberUser chatMemberUser; // 事件 + private final ChatMembers chatMembers; // 群组 - 群成员 + private final ChatMenuItem chatMenuItem; // chat.menu_item + private final ChatMenuTree chatMenuTree; // 群组 - 群菜单 + private final ChatModeration chatModeration; // chat.moderation + private final ChatTab chatTab; // 群组 - 会话标签页 + private final ChatTopNotice chatTopNotice; // chat.top_notice + private final File file; // 消息 - 文件信息 + private final Image image; // 消息 - 图片信息 + private final Message message; // 消息加急 + private final MessageReaction messageReaction; // 消息 - 表情回复 + private final MessageResource messageResource; // message.resource + private final Pin pin; // 消息 - Pin + + public ImService(Config config) { + this.v1 = new V1(config); + this.batchMessage = new BatchMessage(config); + this.chat = new Chat(config); + this.chatAnnouncement = new ChatAnnouncement(config); + this.chatManagers = new ChatManagers(config); + this.chatMemberBot = new ChatMemberBot(config); + this.chatMemberUser = new ChatMemberUser(config); + this.chatMembers = new ChatMembers(config); + this.chatMenuItem = new ChatMenuItem(config); + this.chatMenuTree = new ChatMenuTree(config); + this.chatModeration = new ChatModeration(config); + this.chatTab = new ChatTab(config); + this.chatTopNotice = new ChatTopNotice(config); + this.file = new File(config); + this.image = new Image(config); + this.message = new Message(config); + this.messageReaction = new MessageReaction(config); + this.messageResource = new MessageResource(config); + this.pin = new Pin(config); + } + + public V1 v1() { + return v1; + } + + public BatchMessage batchMessage() { + return batchMessage; + } + + public Chat chat() { + return chat; + } + + public ChatAnnouncement chatAnnouncement() { + return chatAnnouncement; + } + + public ChatManagers chatManagers() { + return chatManagers; + } + + public ChatMemberBot chatMemberBot() { + return chatMemberBot; + } + + public ChatMemberUser chatMemberUser() { + return chatMemberUser; + } + + public ChatMembers chatMembers() { + return chatMembers; + } + + public ChatMenuItem chatMenuItem() { + return chatMenuItem; + } + + public ChatMenuTree chatMenuTree() { + return chatMenuTree; + } + + public ChatModeration chatModeration() { + return chatModeration; + } + + public ChatTab chatTab() { + return chatTab; + } + + public ChatTopNotice chatTopNotice() { + return chatTopNotice; + } + + public File file() { + return file; + } + + public Image image() { + return image; + } + + public Message message() { + return message; + } + + public MessageReaction messageReaction() { + return messageReaction; + } + + public MessageResource messageResource() { + return messageResource; + } + + public Pin pin() { + return pin; + } + + public abstract static class P2ChatDisbandedV1Handler implements IEventHandler { + @Override + public P2ChatDisbandedV1 getEvent() { + return new P2ChatDisbandedV1(); + } + } + + public abstract static class P2ChatUpdatedV1Handler implements IEventHandler { + @Override + public P2ChatUpdatedV1 getEvent() { + return new P2ChatUpdatedV1(); + } + } + + public abstract static class P2ChatMemberBotAddedV1Handler implements IEventHandler { + @Override + public P2ChatMemberBotAddedV1 getEvent() { + return new P2ChatMemberBotAddedV1(); + } + } + + public abstract static class P2ChatMemberBotDeletedV1Handler implements IEventHandler { + @Override + public P2ChatMemberBotDeletedV1 getEvent() { + return new P2ChatMemberBotDeletedV1(); + } + } + + public abstract static class P2ChatMemberUserAddedV1Handler implements IEventHandler { + @Override + public P2ChatMemberUserAddedV1 getEvent() { + return new P2ChatMemberUserAddedV1(); + } + } + + public abstract static class P2ChatMemberUserDeletedV1Handler implements IEventHandler { + @Override + public P2ChatMemberUserDeletedV1 getEvent() { + return new P2ChatMemberUserDeletedV1(); + } + } + + public abstract static class P2ChatMemberUserWithdrawnV1Handler implements IEventHandler { + @Override + public P2ChatMemberUserWithdrawnV1 getEvent() { + return new P2ChatMemberUserWithdrawnV1(); + } + } + + public abstract static class P2MessageReadV1Handler implements IEventHandler { + @Override + public P2MessageReadV1 getEvent() { + return new P2MessageReadV1(); + } + } + + public abstract static class P2MessageRecalledV1Handler implements IEventHandler { + @Override + public P2MessageRecalledV1 getEvent() { + return new P2MessageRecalledV1(); + } + } + + public abstract static class P2MessageReceiveV1Handler implements IEventHandler { + @Override + public P2MessageReceiveV1 getEvent() { + return new P2MessageReceiveV1(); + } + } + + public abstract static class P2MessageReactionCreatedV1Handler implements IEventHandler { + @Override + public P2MessageReactionCreatedV1 getEvent() { + return new P2MessageReactionCreatedV1(); + } + } + + public abstract static class P2MessageReactionDeletedV1Handler implements IEventHandler { + @Override + public P2MessageReactionDeletedV1 getEvent() { + return new P2MessageReactionDeletedV1(); + } + } + + public abstract static class P1MessageReadV1Handler implements IEventHandler { + + @Override + public P1MessageReadV1 getEvent() { + return new P1MessageReadV1(); + } + } + + + public abstract static class P1MessageReceivedV1Handler implements IEventHandler { + @Override + public P1MessageReceivedV1 getEvent() { + return new P1MessageReceivedV1(); + } + } + + public abstract static class P1P2PChatCreatedV1Handler implements IEventHandler { + @Override + public P1P2PChatCreatedV1 getEvent() { + return new P1P2PChatCreatedV1(); + } + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/ImService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/ImService.java deleted file mode 100644 index 52eb83822..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/ImService.java +++ /dev/null @@ -1,4432 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.im.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.event.IEventHandler; -import com.lark.oapi.service.im.v1.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.ByteArrayOutputStream; -import java.nio.charset.StandardCharsets; - -public class ImService { - private static final Logger log = LoggerFactory.getLogger(ImService.class); - private final BatchMessage batchMessage; // 消息 - 批量消息 - private final Chat chat; // 群组 - private final ChatAnnouncement chatAnnouncement; // 群组 - 群公告 - private final ChatManagers chatManagers; // 群组 - 群成员 - private final ChatMemberBot chatMemberBot; // 事件 - private final ChatMemberUser chatMemberUser; // 事件 - private final ChatMembers chatMembers; // 群组 - 群成员 - private final ChatMenuItem chatMenuItem; // chat.menu_item - private final ChatMenuTree chatMenuTree; // 群组 - 群菜单 - private final ChatModeration chatModeration; // chat.moderation - private final ChatTab chatTab; // 群组 - 会话标签页 - private final ChatTopNotice chatTopNotice; // chat.top_notice - private final File file; // 消息 - 文件信息 - private final Image image; // 消息 - 图片信息 - private final Message message; // 消息 - private final MessageReaction messageReaction; // 消息 - 表情回复 - private final MessageResource messageResource; // message.resource - private final Pin pin; // 消息 - Pin - - public ImService(Config config) { - this.batchMessage = new BatchMessage(config); - this.chat = new Chat(config); - this.chatAnnouncement = new ChatAnnouncement(config); - this.chatManagers = new ChatManagers(config); - this.chatMemberBot = new ChatMemberBot(config); - this.chatMemberUser = new ChatMemberUser(config); - this.chatMembers = new ChatMembers(config); - this.chatMenuItem = new ChatMenuItem(config); - this.chatMenuTree = new ChatMenuTree(config); - this.chatModeration = new ChatModeration(config); - this.chatTab = new ChatTab(config); - this.chatTopNotice = new ChatTopNotice(config); - this.file = new File(config); - this.image = new Image(config); - this.message = new Message(config); - this.messageReaction = new MessageReaction(config); - this.messageResource = new MessageResource(config); - this.pin = new Pin(config); - } - - /** - * 消息 - 批量消息 - * - * @return - */ - public BatchMessage batchMessage() { - return batchMessage; - } - - /** - * 群组 - * - * @return - */ - public Chat chat() { - return chat; - } - - /** - * 群组 - 群公告 - * - * @return - */ - public ChatAnnouncement chatAnnouncement() { - return chatAnnouncement; - } - - /** - * 群组 - 群成员 - * - * @return - */ - public ChatManagers chatManagers() { - return chatManagers; - } - - /** - * 事件 - * - * @return - */ - public ChatMemberBot chatMemberBot() { - return chatMemberBot; - } - - /** - * 事件 - * - * @return - */ - public ChatMemberUser chatMemberUser() { - return chatMemberUser; - } - - /** - * 群组 - 群成员 - * - * @return - */ - public ChatMembers chatMembers() { - return chatMembers; - } - - /** - * chat.menu_item - * - * @return - */ - public ChatMenuItem chatMenuItem() { - return chatMenuItem; - } - - /** - * 群组 - 群菜单 - * - * @return - */ - public ChatMenuTree chatMenuTree() { - return chatMenuTree; - } - - /** - * chat.moderation - * - * @return - */ - public ChatModeration chatModeration() { - return chatModeration; - } - - /** - * 群组 - 会话标签页 - * - * @return - */ - public ChatTab chatTab() { - return chatTab; - } - - /** - * chat.top_notice - * - * @return - */ - public ChatTopNotice chatTopNotice() { - return chatTopNotice; - } - - /** - * 消息 - 文件信息 - * - * @return - */ - public File file() { - return file; - } - - /** - * 消息 - 图片信息 - * - * @return - */ - public Image image() { - return image; - } - - /** - * 消息 - * - * @return - */ - public Message message() { - return message; - } - - /** - * 消息 - 表情回复 - * - * @return - */ - public MessageReaction messageReaction() { - return messageReaction; - } - - /** - * message.resource - * - * @return - */ - public MessageResource messageResource() { - return messageResource; - } - - /** - * 消息 - Pin - * - * @return - */ - public Pin pin() { - return pin; - } - - public static class BatchMessage { - private final Config config; - - public BatchMessage(Config config) { - this.config = config; - } - - /** - * 批量撤回消息,批量撤回通过[批量发送消息](https://open.feishu.cn/document/ukTMukTMukTM/ucDO1EjL3gTNx4yN4UTM)接口发送的消息。 - *

注意事项:;- 应用需要启用[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 撤回单条发送的消息请使用[撤回消息](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/delete)接口;- 不支持撤回发出时间超过1天的消息;- 一次调用涉及大量消息,所以为异步接口,会有一定延迟。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/batch_message/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteBatchMessageSample.java ; - */ - public DeleteBatchMessageResp delete(DeleteBatchMessageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/im/v1/batch_messages/:batch_message_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteBatchMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteBatchMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/batch_messages/:batch_message_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量撤回消息,批量撤回通过[批量发送消息](https://open.feishu.cn/document/ukTMukTMukTM/ucDO1EjL3gTNx4yN4UTM)接口发送的消息。 - *

注意事项:;- 应用需要启用[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 撤回单条发送的消息请使用[撤回消息](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/delete)接口;- 不支持撤回发出时间超过1天的消息;- 一次调用涉及大量消息,所以为异步接口,会有一定延迟。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/batch_message/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteBatchMessageSample.java ; - */ - public DeleteBatchMessageResp delete(DeleteBatchMessageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/im/v1/batch_messages/:batch_message_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteBatchMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteBatchMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/batch_messages/:batch_message_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询批量消息整体进度,该接口在[查询批量消息推送和阅读人数](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/batch_message/read_user)查询结果的基础上,增加了批量请求中有效的userid数量以及消息撤回进度数据。 - *

注意事项:;* 该接口返回的数据为查询时刻的快照数据 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/batch_message/get_progress ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetProgressBatchMessageSample.java ; - */ - public GetProgressBatchMessageResp getProgress(GetProgressBatchMessageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/batch_messages/:batch_message_id/get_progress" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetProgressBatchMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetProgressBatchMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/batch_messages/:batch_message_id/get_progress" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询批量消息整体进度,该接口在[查询批量消息推送和阅读人数](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/batch_message/read_user)查询结果的基础上,增加了批量请求中有效的userid数量以及消息撤回进度数据。 - *

注意事项:;* 该接口返回的数据为查询时刻的快照数据 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/batch_message/get_progress ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetProgressBatchMessageSample.java ; - */ - public GetProgressBatchMessageResp getProgress(GetProgressBatchMessageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/batch_messages/:batch_message_id/get_progress" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetProgressBatchMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetProgressBatchMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/batch_messages/:batch_message_id/get_progress" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询批量消息推送和阅读人数,批量发送消息后,可以通过该接口查询批量消息推送的总人数和阅读人数。 - *

注意事项:;- 只能查询通过[批量发送消息](https://open.feishu.cn/document/ukTMukTMukTM/ucDO1EjL3gTNx4yN4UTM)接口产生的消息;- 该接口返回的数据为查询时刻的快照数据 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/batch_message/read_user ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ReadUserBatchMessageSample.java ; - */ - public ReadUserBatchMessageResp readUser(ReadUserBatchMessageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/batch_messages/:batch_message_id/read_user" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ReadUserBatchMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ReadUserBatchMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/batch_messages/:batch_message_id/read_user" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询批量消息推送和阅读人数,批量发送消息后,可以通过该接口查询批量消息推送的总人数和阅读人数。 - *

注意事项:;- 只能查询通过[批量发送消息](https://open.feishu.cn/document/ukTMukTMukTM/ucDO1EjL3gTNx4yN4UTM)接口产生的消息;- 该接口返回的数据为查询时刻的快照数据 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/batch_message/read_user ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ReadUserBatchMessageSample.java ; - */ - public ReadUserBatchMessageResp readUser(ReadUserBatchMessageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/batch_messages/:batch_message_id/read_user" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ReadUserBatchMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ReadUserBatchMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/batch_messages/:batch_message_id/read_user" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Chat { - private final Config config; - - public Chat(Config config) { - this.config = config; - } - - /** - * 创建群,创建群并设置群头像、群名、群描述等。 - *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 本接口支持在创建群的同时拉用户或机器人进群;如果仅需要拉用户或者机器人入群参考 [将用户或机器人拉入群聊](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/create)接口 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatSample.java ; - */ - public CreateChatResp create(CreateChatReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/chats" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateChatResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建群,创建群并设置群头像、群名、群描述等。 - *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 本接口支持在创建群的同时拉用户或机器人进群;如果仅需要拉用户或者机器人入群参考 [将用户或机器人拉入群聊](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/create)接口 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatSample.java ; - */ - public CreateChatResp create(CreateChatReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/chats" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateChatResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 解散群,解散群组。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 如果使用tenant_access_token,需要机器人符合以下任一情况才可解散群:; - 机器人是群主; - 机器人是群的创建者且具备==更新应用所创建群的群信息==权限;- 如果使用user_access_token,需要对应的用户是群主才可解散群 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteChatSample.java ; - */ - public DeleteChatResp delete(DeleteChatReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/im/v1/chats/:chat_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteChatResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 解散群,解散群组。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 如果使用tenant_access_token,需要机器人符合以下任一情况才可解散群:; - 机器人是群主; - 机器人是群的创建者且具备==更新应用所创建群的群信息==权限;- 如果使用user_access_token,需要对应的用户是群主才可解散群 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteChatSample.java ; - */ - public DeleteChatResp delete(DeleteChatReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/im/v1/chats/:chat_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteChatResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取群信息,获取群名称、群描述、群头像、群主 ID 等群基本信息。 - *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人或授权用户必须在群里(否则只会返回群名称、群头像等基本信息);- 获取内部群信息时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatSample.java ; - */ - public GetChatResp get(GetChatReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/chats/:chat_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetChatResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取群信息,获取群名称、群描述、群头像、群主 ID 等群基本信息。 - *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人或授权用户必须在群里(否则只会返回群名称、群头像等基本信息);- 获取内部群信息时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatSample.java ; - */ - public GetChatResp get(GetChatReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/chats/:chat_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetChatResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取群分享链接,获取指定群的分享链接。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - access_token所对应的 **机器人** 或 **授权用户** 必须在`chat_id`参数指定的群组中;- 单聊、密聊、团队群不支持分享群链接;- 当Bot被停用或Bot退出群组时,Bot生成的群链接也将停用;- 当群聊开启了 ==仅群主和群管理员可添加群成员/分享群== 设置时,仅**群主**和**群管理员**可以获取群分享链接;- 获取内部群分享链接时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/link ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/LinkChatSample.java ; - */ - public LinkChatResp link(LinkChatReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/chats/:chat_id/link" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - LinkChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, LinkChatResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/link" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取群分享链接,获取指定群的分享链接。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - access_token所对应的 **机器人** 或 **授权用户** 必须在`chat_id`参数指定的群组中;- 单聊、密聊、团队群不支持分享群链接;- 当Bot被停用或Bot退出群组时,Bot生成的群链接也将停用;- 当群聊开启了 ==仅群主和群管理员可添加群成员/分享群== 设置时,仅**群主**和**群管理员**可以获取群分享链接;- 获取内部群分享链接时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/link ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/LinkChatSample.java ; - */ - public LinkChatResp link(LinkChatReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/chats/:chat_id/link" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - LinkChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, LinkChatResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/link" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取用户或机器人所在的群列表,获取用户或者机器人所在群列表。 - *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 请注意区分本接口和[获取群信息](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/get)的请求 URL;- 获取的群列表不包含P2P单聊 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListChatSample.java ; - */ - public ListChatResp list(ListChatReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/chats" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListChatResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取用户或机器人所在的群列表,获取用户或者机器人所在群列表。 - *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 请注意区分本接口和[获取群信息](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/get)的请求 URL;- 获取的群列表不包含P2P单聊 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListChatSample.java ; - */ - public ListChatResp list(ListChatReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/chats" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListChatResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 搜索对用户或机器人可见的群列表,搜索对用户或机器人可见的群列表,包括:用户或机器人所在的群、对用户或机器人公开的群。;搜索可获得的群信息包括:群ID(chat_id)、群名称、群描述等。 - *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/search ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/SearchChatSample.java ; - */ - public SearchChatResp search(SearchChatReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/chats/search" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - SearchChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchChatResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 搜索对用户或机器人可见的群列表,搜索对用户或机器人可见的群列表,包括:用户或机器人所在的群、对用户或机器人公开的群。;搜索可获得的群信息包括:群ID(chat_id)、群名称、群描述等。 - *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/search ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/SearchChatSample.java ; - */ - public SearchChatResp search(SearchChatReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/chats/search" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - SearchChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchChatResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新群信息,更新群头像、群名称、群描述、群配置、转让群主等。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 对于群主/群管理员 或 创建群组且具备 ==更新应用所创建群的群信息== 权限的机器人,可更新所有信息;- 对于不满足上述权限条件的群成员或机器人:; - 若未开启 ==仅群主和群管理员可编辑群信息== 配置,仅可更新群头像、群名称、群描述、群国际化名称信息; - 若开启了 ==仅群主和群管理员可编辑群信息== 配置,任何群信息都不能修改;- 如果同时更新 ==邀请用户或机器人入群权限== 和 ==群分享权限== 这两项设置需要满足以下条件:; - 若未开启 ==仅群主和管理员可以邀请用户或机器人入群==,需要设置 ==群分享权限== 为 ==允许分享==; - 若开启了 ==仅群主和管理员可以邀请用户或机器人入群==,需要设置 ==群分享权限== 为 ==不允许分享== ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateChatSample.java ; - */ - public UpdateChatResp update(UpdateChatReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/im/v1/chats/:chat_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UpdateChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateChatResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新群信息,更新群头像、群名称、群描述、群配置、转让群主等。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 对于群主/群管理员 或 创建群组且具备 ==更新应用所创建群的群信息== 权限的机器人,可更新所有信息;- 对于不满足上述权限条件的群成员或机器人:; - 若未开启 ==仅群主和群管理员可编辑群信息== 配置,仅可更新群头像、群名称、群描述、群国际化名称信息; - 若开启了 ==仅群主和群管理员可编辑群信息== 配置,任何群信息都不能修改;- 如果同时更新 ==邀请用户或机器人入群权限== 和 ==群分享权限== 这两项设置需要满足以下条件:; - 若未开启 ==仅群主和管理员可以邀请用户或机器人入群==,需要设置 ==群分享权限== 为 ==允许分享==; - 若开启了 ==仅群主和管理员可以邀请用户或机器人入群==,需要设置 ==群分享权限== 为 ==不允许分享== ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateChatSample.java ; - */ - public UpdateChatResp update(UpdateChatReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/im/v1/chats/:chat_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UpdateChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateChatResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ChatAnnouncement { - private final Config config; - - public ChatAnnouncement(Config config) { - this.config = config; - } - - /** - * 获取群公告信息,获取会话中的群公告信息,公告信息格式与[云文档](https://open.feishu.cn/document/ukTMukTMukTM/uAzM5YjLwMTO24CMzkjN)格式相同。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 获取内部群信息时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-announcement/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatAnnouncementSample.java ; - */ - public GetChatAnnouncementResp get(GetChatAnnouncementReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/chats/:chat_id/announcement" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetChatAnnouncementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetChatAnnouncementResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/announcement" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取群公告信息,获取会话中的群公告信息,公告信息格式与[云文档](https://open.feishu.cn/document/ukTMukTMukTM/uAzM5YjLwMTO24CMzkjN)格式相同。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 获取内部群信息时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-announcement/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatAnnouncementSample.java ; - */ - public GetChatAnnouncementResp get(GetChatAnnouncementReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/chats/:chat_id/announcement" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetChatAnnouncementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetChatAnnouncementResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/announcement" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新群公告信息,更新会话中的群公告信息,更新公告信息的格式和更新[云文档](https://open.feishu.cn/document/ukTMukTMukTM/uAzM5YjLwMTO24CMzkjN)格式相同。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 操作者需要拥有群公告文档的阅读权限;- 获取内部群信息时,操作者须与群组在同一租户下;- 若群开启了 ==仅群主和群管理员可编辑群信息== 配置,群主/群管理员 或 创建群组且具备 ==更新应用所创建群的群信息== 权限的机器人,可更新群公告;- 若群未开启 ==仅群主和群管理员可编辑群信息== 配置,所有成员可以更新群公告 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-announcement/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PatchChatAnnouncementSample.java ; - */ - public PatchChatAnnouncementResp patch(PatchChatAnnouncementReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/im/v1/chats/:chat_id/announcement" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchChatAnnouncementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchChatAnnouncementResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/announcement" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新群公告信息,更新会话中的群公告信息,更新公告信息的格式和更新[云文档](https://open.feishu.cn/document/ukTMukTMukTM/uAzM5YjLwMTO24CMzkjN)格式相同。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 操作者需要拥有群公告文档的阅读权限;- 获取内部群信息时,操作者须与群组在同一租户下;- 若群开启了 ==仅群主和群管理员可编辑群信息== 配置,群主/群管理员 或 创建群组且具备 ==更新应用所创建群的群信息== 权限的机器人,可更新群公告;- 若群未开启 ==仅群主和群管理员可编辑群信息== 配置,所有成员可以更新群公告 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-announcement/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PatchChatAnnouncementSample.java ; - */ - public PatchChatAnnouncementResp patch(PatchChatAnnouncementReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/im/v1/chats/:chat_id/announcement" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchChatAnnouncementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchChatAnnouncementResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/announcement" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ChatManagers { - private final Config config; - - public ChatManagers(Config config) { - this.config = config; - } - - /** - * 指定群管理员,将用户或机器人指定为群管理员。 - *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 仅有群主可以指定群管理员 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-managers/add_managers ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/AddManagersChatManagersSample.java ; - */ - public AddManagersChatManagersResp addManagers(AddManagersChatManagersReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/chats/:chat_id/managers/add_managers" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - AddManagersChatManagersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddManagersChatManagersResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/managers/add_managers" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 指定群管理员,将用户或机器人指定为群管理员。 - *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 仅有群主可以指定群管理员 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-managers/add_managers ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/AddManagersChatManagersSample.java ; - */ - public AddManagersChatManagersResp addManagers(AddManagersChatManagersReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/chats/:chat_id/managers/add_managers" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - AddManagersChatManagersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddManagersChatManagersResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/managers/add_managers" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除群管理员,删除指定的群管理员(用户或机器人)。 - *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 仅有群主可以删除群管理员 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-managers/delete_managers ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteManagersChatManagersSample.java ; - */ - public DeleteManagersChatManagersResp deleteManagers(DeleteManagersChatManagersReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/chats/:chat_id/managers/delete_managers" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteManagersChatManagersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteManagersChatManagersResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/managers/delete_managers" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除群管理员,删除指定的群管理员(用户或机器人)。 - *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 仅有群主可以删除群管理员 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-managers/delete_managers ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteManagersChatManagersSample.java ; - */ - public DeleteManagersChatManagersResp deleteManagers(DeleteManagersChatManagersReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/chats/:chat_id/managers/delete_managers" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteManagersChatManagersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteManagersChatManagersResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/managers/delete_managers" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ChatMemberBot { - private final Config config; - - public ChatMemberBot(Config config) { - this.config = config; - } - } - - public static class ChatMemberUser { - private final Config config; - - public ChatMemberUser(Config config) { - this.config = config; - } - } - - public static class ChatMembers { - private final Config config; - - public ChatMembers(Config config) { - this.config = config; - } - - /** - * 将用户或机器人拉入群聊,将用户或机器人拉入群聊。 - *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 如需拉用户进群,需要机器人对用户有[可用性](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability); - 机器人或授权用户必须在群组中;- 外部租户不能被加入到内部群中;- 操作内部群时,操作者须与群组在同一租户下; - 在开启 ==仅群主和群管理员可添加群成员== 的设置时,仅有群主/管理员 或 创建群组且具备 ==更新应用所创建群的群信息== 权限的机器人,可以拉用户或者机器人进群; - 在未开启 ==仅群主和群管理员可添加群成员== 的设置时,所有群成员都可以拉用户或机器人进群 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatMembersSample.java ; - */ - public CreateChatMembersResp create(CreateChatMembersReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/chats/:chat_id/members" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateChatMembersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateChatMembersResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 将用户或机器人拉入群聊,将用户或机器人拉入群聊。 - *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 如需拉用户进群,需要机器人对用户有[可用性](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability); - 机器人或授权用户必须在群组中;- 外部租户不能被加入到内部群中;- 操作内部群时,操作者须与群组在同一租户下; - 在开启 ==仅群主和群管理员可添加群成员== 的设置时,仅有群主/管理员 或 创建群组且具备 ==更新应用所创建群的群信息== 权限的机器人,可以拉用户或者机器人进群; - 在未开启 ==仅群主和群管理员可添加群成员== 的设置时,所有群成员都可以拉用户或机器人进群 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatMembersSample.java ; - */ - public CreateChatMembersResp create(CreateChatMembersReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/chats/:chat_id/members" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateChatMembersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateChatMembersResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 将用户或机器人移出群聊,将用户或机器人移出群聊。 - *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 用户或机器人在任何条件下均可移除自己出群(即主动退群);- 仅有群主/管理员 或 创建群组并且具备 ==更新应用所创建群的群信息== 权限的机器人,可以移除其他用户或者机器人;- 每次请求,最多移除50个用户或者5个机器人;- 操作内部群时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteChatMembersSample.java ; - */ - public DeleteChatMembersResp delete(DeleteChatMembersReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/im/v1/chats/:chat_id/members" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteChatMembersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteChatMembersResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 将用户或机器人移出群聊,将用户或机器人移出群聊。 - *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 用户或机器人在任何条件下均可移除自己出群(即主动退群);- 仅有群主/管理员 或 创建群组并且具备 ==更新应用所创建群的群信息== 权限的机器人,可以移除其他用户或者机器人;- 每次请求,最多移除50个用户或者5个机器人;- 操作内部群时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteChatMembersSample.java ; - */ - public DeleteChatMembersResp delete(DeleteChatMembersReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/im/v1/chats/:chat_id/members" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteChatMembersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteChatMembersResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取群成员列表,获取用户/机器人所在群的群成员列表。 - *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人或授权用户必须在群组中; - 该接口不会返回群内的机器人成员; - 由于返回的群成员列表会过滤掉机器人成员,因此返回的群成员个数可能会小于指定的page_size; - 如果有同一时间加入群的群成员,会一次性返回,这会导致返回的群成员个数可能会大于指定的page_size;- 获取内部群信息时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatMembersSample.java ; - */ - public GetChatMembersResp get(GetChatMembersReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/chats/:chat_id/members" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetChatMembersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetChatMembersResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取群成员列表,获取用户/机器人所在群的群成员列表。 - *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人或授权用户必须在群组中; - 该接口不会返回群内的机器人成员; - 由于返回的群成员列表会过滤掉机器人成员,因此返回的群成员个数可能会小于指定的page_size; - 如果有同一时间加入群的群成员,会一次性返回,这会导致返回的群成员个数可能会大于指定的page_size;- 获取内部群信息时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatMembersSample.java ; - */ - public GetChatMembersResp get(GetChatMembersReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/chats/:chat_id/members" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetChatMembersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetChatMembersResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 判断用户或机器人是否在群里,根据使用的access_token判断对应的用户或者机器人是否在群里。 - *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 获取内部群信息时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/is_in_chat ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/IsInChatChatMembersSample.java ; - */ - public IsInChatChatMembersResp isInChat(IsInChatChatMembersReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/chats/:chat_id/members/is_in_chat" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - IsInChatChatMembersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, IsInChatChatMembersResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/members/is_in_chat" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 判断用户或机器人是否在群里,根据使用的access_token判断对应的用户或者机器人是否在群里。 - *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 获取内部群信息时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/is_in_chat ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/IsInChatChatMembersSample.java ; - */ - public IsInChatChatMembersResp isInChat(IsInChatChatMembersReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/chats/:chat_id/members/is_in_chat" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - IsInChatChatMembersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, IsInChatChatMembersResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/members/is_in_chat" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 用户或机器人主动加入群聊,用户或机器人主动加入群聊。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 目前仅支持加入公开群;- 操作内部群时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/me_join ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/MeJoinChatMembersSample.java ; - */ - public MeJoinChatMembersResp meJoin(MeJoinChatMembersReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/im/v1/chats/:chat_id/members/me_join" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - MeJoinChatMembersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MeJoinChatMembersResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/members/me_join" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 用户或机器人主动加入群聊,用户或机器人主动加入群聊。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 目前仅支持加入公开群;- 操作内部群时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/me_join ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/MeJoinChatMembersSample.java ; - */ - public MeJoinChatMembersResp meJoin(MeJoinChatMembersReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/im/v1/chats/:chat_id/members/me_join" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - MeJoinChatMembersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MeJoinChatMembersResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/members/me_join" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ChatMenuItem { - private final Config config; - - public ChatMenuItem(Config config) { - this.config = config; - } - - /** - * 修改群菜单元信息,修改某个一级菜单或者二级菜单的元信息。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_item/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PatchChatMenuItemSample.java ; - */ - public PatchChatMenuItemResp patch(PatchChatMenuItemReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/im/v1/chats/:chat_id/menu_items/:menu_item_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchChatMenuItemResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchChatMenuItemResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/menu_items/:menu_item_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改群菜单元信息,修改某个一级菜单或者二级菜单的元信息。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_item/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PatchChatMenuItemSample.java ; - */ - public PatchChatMenuItemResp patch(PatchChatMenuItemReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/im/v1/chats/:chat_id/menu_items/:menu_item_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchChatMenuItemResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchChatMenuItemResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/menu_items/:menu_item_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ChatMenuTree { - private final Config config; - - public ChatMenuTree(Config config) { - this.config = config; - } - - /** - * 添加群菜单,向群内添加群菜单。 - *

注意事项:;- 该API是向群内追加菜单,群内原来存在的菜单并不会被覆盖。操作API后,将返回群内所有菜单。;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。;- 一个群内,一级菜单最多有3个,每个一级菜单最多有5个二级菜单。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatMenuTreeSample.java ; - */ - public CreateChatMenuTreeResp create(CreateChatMenuTreeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/chats/:chat_id/menu_tree" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateChatMenuTreeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateChatMenuTreeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/menu_tree" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 添加群菜单,向群内添加群菜单。 - *

注意事项:;- 该API是向群内追加菜单,群内原来存在的菜单并不会被覆盖。操作API后,将返回群内所有菜单。;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。;- 一个群内,一级菜单最多有3个,每个一级菜单最多有5个二级菜单。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatMenuTreeSample.java ; - */ - public CreateChatMenuTreeResp create(CreateChatMenuTreeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/chats/:chat_id/menu_tree" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateChatMenuTreeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateChatMenuTreeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/menu_tree" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除群菜单。,删除群内菜单。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。;- 操作API后,将返回群内所有菜单。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteChatMenuTreeSample.java ; - */ - public DeleteChatMenuTreeResp delete(DeleteChatMenuTreeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/im/v1/chats/:chat_id/menu_tree" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteChatMenuTreeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteChatMenuTreeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/menu_tree" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除群菜单。,删除群内菜单。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。;- 操作API后,将返回群内所有菜单。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteChatMenuTreeSample.java ; - */ - public DeleteChatMenuTreeResp delete(DeleteChatMenuTreeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/im/v1/chats/:chat_id/menu_tree" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteChatMenuTreeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteChatMenuTreeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/menu_tree" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取群内菜单,通过群ID获取群内菜单。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatMenuTreeSample.java ; - */ - public GetChatMenuTreeResp get(GetChatMenuTreeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/chats/:chat_id/menu_tree" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetChatMenuTreeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetChatMenuTreeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/menu_tree" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取群内菜单,通过群ID获取群内菜单。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatMenuTreeSample.java ; - */ - public GetChatMenuTreeResp get(GetChatMenuTreeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/chats/:chat_id/menu_tree" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetChatMenuTreeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetChatMenuTreeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/menu_tree" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 排序群菜单,给一个群内的一级菜单排序。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。;- 操作API后,将返回群内所有菜单。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/sort ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/SortChatMenuTreeSample.java ; - */ - public SortChatMenuTreeResp sort(SortChatMenuTreeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/chats/:chat_id/menu_tree/sort" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SortChatMenuTreeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SortChatMenuTreeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/menu_tree/sort" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 排序群菜单,给一个群内的一级菜单排序。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。;- 操作API后,将返回群内所有菜单。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/sort ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/SortChatMenuTreeSample.java ; - */ - public SortChatMenuTreeResp sort(SortChatMenuTreeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/chats/:chat_id/menu_tree/sort" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SortChatMenuTreeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SortChatMenuTreeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/menu_tree/sort" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ChatModeration { - private final Config config; - - public ChatModeration(Config config) { - this.config = config; - } - - /** - * 获取群成员发言权限,获取群发言模式、可发言用户名单等 - *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人 或 授权用户 必须在群里 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-moderation/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatModerationSample.java ; - */ - public GetChatModerationResp get(GetChatModerationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/chats/:chat_id/moderation" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetChatModerationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetChatModerationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/moderation" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取群成员发言权限,获取群发言模式、可发言用户名单等 - *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人 或 授权用户 必须在群里 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-moderation/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatModerationSample.java ; - */ - public GetChatModerationResp get(GetChatModerationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/chats/:chat_id/moderation" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetChatModerationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetChatModerationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/moderation" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新群发言权限,更新群组的发言权限设置,可设置为全员可发言、仅管理员可发言 或 指定用户可发言。 - *

注意事项:; - 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 若以用户授权调用接口,**当授权用户是群主**时,可更新群发言权限;- 若以租户授权调用接口(即以机器人身份调用接口),当**机器人是群主** 或者 **机器人是群组创建者、具备==更新应用所创建群的群信息==权限且仍在群内**时,可更新群发言权限 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-moderation/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateChatModerationSample.java ; - */ - public UpdateChatModerationResp update(UpdateChatModerationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/im/v1/chats/:chat_id/moderation" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateChatModerationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateChatModerationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/moderation" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新群发言权限,更新群组的发言权限设置,可设置为全员可发言、仅管理员可发言 或 指定用户可发言。 - *

注意事项:; - 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 若以用户授权调用接口,**当授权用户是群主**时,可更新群发言权限;- 若以租户授权调用接口(即以机器人身份调用接口),当**机器人是群主** 或者 **机器人是群组创建者、具备==更新应用所创建群的群信息==权限且仍在群内**时,可更新群发言权限 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-moderation/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateChatModerationSample.java ; - */ - public UpdateChatModerationResp update(UpdateChatModerationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/im/v1/chats/:chat_id/moderation" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateChatModerationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateChatModerationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/moderation" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ChatTab { - private final Config config; - - public ChatTab(Config config) { - this.config = config; - } - - /** - * 添加会话标签页,添加自定义会话标签页。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 只允许添加类型为`doc`和`url`的会话标签页;- 添加doc类型时,操作者(access token对应的身份)需要拥有对应文档的权限;- tab_config字段当前只对`url`类型的会话标签页生效;- 在开启 ==仅群主和管理员可管理标签页== 的设置时,仅群主和群管理员可以添加会话标签页;- 操作内部群时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatTabSample.java ; - */ - public CreateChatTabResp create(CreateChatTabReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/chats/:chat_id/chat_tabs" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateChatTabResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateChatTabResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/chat_tabs" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 添加会话标签页,添加自定义会话标签页。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 只允许添加类型为`doc`和`url`的会话标签页;- 添加doc类型时,操作者(access token对应的身份)需要拥有对应文档的权限;- tab_config字段当前只对`url`类型的会话标签页生效;- 在开启 ==仅群主和管理员可管理标签页== 的设置时,仅群主和群管理员可以添加会话标签页;- 操作内部群时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatTabSample.java ; - */ - public CreateChatTabResp create(CreateChatTabReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/chats/:chat_id/chat_tabs" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateChatTabResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateChatTabResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/chat_tabs" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除会话标签页,删除会话标签页。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 只允许删除类型为`doc`和`url`的会话标签页;- 在开启 ==仅群主和管理员可管理标签页== 的设置时,仅群主和群管理员可以删除会话标签页;- 操作内部群时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/delete_tabs ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteTabsChatTabSample.java ; - */ - public DeleteTabsChatTabResp deleteTabs(DeleteTabsChatTabReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/im/v1/chats/:chat_id/chat_tabs/delete_tabs" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteTabsChatTabResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTabsChatTabResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/chat_tabs/delete_tabs" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除会话标签页,删除会话标签页。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 只允许删除类型为`doc`和`url`的会话标签页;- 在开启 ==仅群主和管理员可管理标签页== 的设置时,仅群主和群管理员可以删除会话标签页;- 操作内部群时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/delete_tabs ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteTabsChatTabSample.java ; - */ - public DeleteTabsChatTabResp deleteTabs(DeleteTabsChatTabReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/im/v1/chats/:chat_id/chat_tabs/delete_tabs" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteTabsChatTabResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTabsChatTabResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/chat_tabs/delete_tabs" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 拉取会话标签页,拉取会话标签页。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 操作内部群时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/list_tabs ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListTabsChatTabSample.java ; - */ - public ListTabsChatTabResp listTabs(ListTabsChatTabReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/chats/:chat_id/chat_tabs/list_tabs" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListTabsChatTabResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTabsChatTabResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/chat_tabs/list_tabs" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 拉取会话标签页,拉取会话标签页。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 操作内部群时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/list_tabs ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListTabsChatTabSample.java ; - */ - public ListTabsChatTabResp listTabs(ListTabsChatTabReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/chats/:chat_id/chat_tabs/list_tabs" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListTabsChatTabResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTabsChatTabResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/chat_tabs/list_tabs" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 会话标签页排序,会话标签页排序。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 消息标签页强制固定为第一顺位,不参与排序,但是请求体中必须包含该标签页的Tab ID;- 操作内部群时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/sort_tabs ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/SortTabsChatTabSample.java ; - */ - public SortTabsChatTabResp sortTabs(SortTabsChatTabReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/chats/:chat_id/chat_tabs/sort_tabs" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - SortTabsChatTabResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SortTabsChatTabResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/chat_tabs/sort_tabs" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 会话标签页排序,会话标签页排序。 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 消息标签页强制固定为第一顺位,不参与排序,但是请求体中必须包含该标签页的Tab ID;- 操作内部群时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/sort_tabs ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/SortTabsChatTabSample.java ; - */ - public SortTabsChatTabResp sortTabs(SortTabsChatTabReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/chats/:chat_id/chat_tabs/sort_tabs" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - SortTabsChatTabResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SortTabsChatTabResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/chat_tabs/sort_tabs" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新会话标签页,更新会话标签页 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 只允许更新类型为`doc`和`url`的会话标签页;- 更新doc类型时,操作者(access token对应的身份)需要拥有对应文档的权限;- 在开启 ==仅群主和管理员可管理标签页== 的设置时,仅群主和群管理员可以更新会话标签页;- 操作内部群时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/update_tabs ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateTabsChatTabSample.java ; - */ - public UpdateTabsChatTabResp updateTabs(UpdateTabsChatTabReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/chats/:chat_id/chat_tabs/update_tabs" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UpdateTabsChatTabResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateTabsChatTabResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/chat_tabs/update_tabs" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新会话标签页,更新会话标签页 - *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 只允许更新类型为`doc`和`url`的会话标签页;- 更新doc类型时,操作者(access token对应的身份)需要拥有对应文档的权限;- 在开启 ==仅群主和管理员可管理标签页== 的设置时,仅群主和群管理员可以更新会话标签页;- 操作内部群时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/update_tabs ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateTabsChatTabSample.java ; - */ - public UpdateTabsChatTabResp updateTabs(UpdateTabsChatTabReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/chats/:chat_id/chat_tabs/update_tabs" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UpdateTabsChatTabResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateTabsChatTabResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/chat_tabs/update_tabs" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ChatTopNotice { - private final Config config; - - public ChatTopNotice(Config config) { - this.config = config; - } - - /** - * 撤销群置顶,撤销会话中的置顶。 - *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人或授权用户必须在群组中;- 撤销内部群置顶时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-top_notice/delete_top_notice ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteTopNoticeChatTopNoticeSample.java ; - */ - public DeleteTopNoticeChatTopNoticeResp deleteTopNotice(DeleteTopNoticeChatTopNoticeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/chats/:chat_id/top_notice/delete_top_notice" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteTopNoticeChatTopNoticeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTopNoticeChatTopNoticeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/top_notice/delete_top_notice" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 撤销群置顶,撤销会话中的置顶。 - *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人或授权用户必须在群组中;- 撤销内部群置顶时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-top_notice/delete_top_notice ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteTopNoticeChatTopNoticeSample.java ; - */ - public DeleteTopNoticeChatTopNoticeResp deleteTopNotice(DeleteTopNoticeChatTopNoticeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/chats/:chat_id/top_notice/delete_top_notice" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteTopNoticeChatTopNoticeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTopNoticeChatTopNoticeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/top_notice/delete_top_notice" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新群置顶,更新会话中的群置顶信息,可以将群中的某一条消息,或者群公告置顶显示。 - *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人或授权用户必须在群组中;- 更新内部群置顶时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-top_notice/put_top_notice ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PutTopNoticeChatTopNoticeSample.java ; - */ - public PutTopNoticeChatTopNoticeResp putTopNotice(PutTopNoticeChatTopNoticeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/chats/:chat_id/top_notice/put_top_notice" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PutTopNoticeChatTopNoticeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PutTopNoticeChatTopNoticeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/top_notice/put_top_notice" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新群置顶,更新会话中的群置顶信息,可以将群中的某一条消息,或者群公告置顶显示。 - *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人或授权用户必须在群组中;- 更新内部群置顶时,操作者须与群组在同一租户下 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-top_notice/put_top_notice ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PutTopNoticeChatTopNoticeSample.java ; - */ - public PutTopNoticeChatTopNoticeResp putTopNotice(PutTopNoticeChatTopNoticeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/chats/:chat_id/top_notice/put_top_notice" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PutTopNoticeChatTopNoticeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PutTopNoticeChatTopNoticeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/top_notice/put_top_notice" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class File { - private final Config config; - - public File(Config config) { - this.config = config; - } - - /** - * 上传文件,上传文件,可以上传视频,音频和常见的文件类型。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 文件大小不得超过30M,且不允许上传空文件 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/file/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateFileSample.java ; - */ - public CreateFileResp create(CreateFileReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/files" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/files" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 上传文件,上传文件,可以上传视频,音频和常见的文件类型。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 文件大小不得超过30M,且不允许上传空文件 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/file/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateFileSample.java ; - */ - public CreateFileResp create(CreateFileReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/files" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/files" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 下载文件,下载文件接口,只能下载应用自己上传的文件。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 只能下载机器人自己上传的文件;- 下载用户发送的资源,请使用[获取消息中的资源文件](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-resource/get)接口;- 下载的资源大小不能超过100M;- 如果需要Content-Disposition header,发起请求的时候需要在header中设置Content-Type为application/json ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/file/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetFileSample.java ; - */ - public GetFileResp get(GetFileReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/files/:file_key" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - if (httpResponse.getStatusCode() == 200) { - GetFileResp resp = new GetFileResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - GetFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/files/:file_key" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 下载文件,下载文件接口,只能下载应用自己上传的文件。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 只能下载机器人自己上传的文件;- 下载用户发送的资源,请使用[获取消息中的资源文件](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-resource/get)接口;- 下载的资源大小不能超过100M;- 如果需要Content-Disposition header,发起请求的时候需要在header中设置Content-Type为application/json ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/file/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetFileSample.java ; - */ - public GetFileResp get(GetFileReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/files/:file_key" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 下载请求,返回流 - if (httpResponse.getStatusCode() == 200) { - GetFileResp resp = new GetFileResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - GetFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/files/:file_key" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Image { - private final Config config; - - public Image(Config config) { - this.config = config; - } - - /** - * 上传图片,上传图片接口,支持上传 JPEG、PNG、WEBP、GIF、TIFF、BMP、ICO格式图片。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 图片大小不得超过10M,且不支持上传大小为0的图片 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/image/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateImageSample.java ; - */ - public CreateImageResp create(CreateImageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/images" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateImageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/images" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 上传图片,上传图片接口,支持上传 JPEG、PNG、WEBP、GIF、TIFF、BMP、ICO格式图片。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 图片大小不得超过10M,且不支持上传大小为0的图片 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/image/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateImageSample.java ; - */ - public CreateImageResp create(CreateImageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/images" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateImageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/images" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 下载图片,下载图片资源,只能下载当前应用所上传且图片类型为message的图片。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 只能下载机器人自己上传且图片类型为message的图片,avatar类型暂不支持下载;- 下载用户发送的资源,请使用[获取消息中的资源文件](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-resource/get)接口 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/image/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetImageSample.java ; - */ - public GetImageResp get(GetImageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/images/:image_key" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - if (httpResponse.getStatusCode() == 200) { - GetImageResp resp = new GetImageResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - GetImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetImageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/images/:image_key" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 下载图片,下载图片资源,只能下载当前应用所上传且图片类型为message的图片。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 只能下载机器人自己上传且图片类型为message的图片,avatar类型暂不支持下载;- 下载用户发送的资源,请使用[获取消息中的资源文件](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-resource/get)接口 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/image/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetImageSample.java ; - */ - public GetImageResp get(GetImageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/images/:image_key" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 下载请求,返回流 - if (httpResponse.getStatusCode() == 200) { - GetImageResp resp = new GetImageResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - GetImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetImageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/images/:image_key" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Message { - private final Config config; - - public Message(Config config) { - this.config = config; - } - - /** - * 发送消息,给指定用户或者会话发送消息,支持文本、富文本、可交互的[消息卡片](https://open.feishu.cn/document/ukTMukTMukTM/uczM3QjL3MzN04yNzcDN)、群名片、个人名片、图片、视频、音频、文件、表情包。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 给用户发送消息,需要机器人对用户有[可用性](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability);- 给群组发送消息,需要机器人在群组中 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateMessageSample.java ; - */ - public CreateMessageResp create(CreateMessageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/messages" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 发送消息,给指定用户或者会话发送消息,支持文本、富文本、可交互的[消息卡片](https://open.feishu.cn/document/ukTMukTMukTM/uczM3QjL3MzN04yNzcDN)、群名片、个人名片、图片、视频、音频、文件、表情包。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 给用户发送消息,需要机器人对用户有[可用性](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability);- 给群组发送消息,需要机器人在群组中 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateMessageSample.java ; - */ - public CreateMessageResp create(CreateMessageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/messages" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 撤回消息,机器人撤回机器人自己发送的消息或群主撤回群内消息。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ,撤回消息时机器人仍需要在会话内;- 机器人可以撤回单聊和群组内,自己发送 且 发送时间不超过1天(24小时)的消息;- 若机器人要撤回群内他人发送的消息,则机器人必须是该群的群主、管理员 或者 创建者,且消息发送时间不超过1年;- 无法撤回通过「[批量发送消息](https://open.feishu.cn/document/ukTMukTMukTM/ucDO1EjL3gTNx4yN4UTM)」接口发送的消息 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteMessageSample.java ; - */ - public DeleteMessageResp delete(DeleteMessageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/im/v1/messages/:message_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 撤回消息,机器人撤回机器人自己发送的消息或群主撤回群内消息。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ,撤回消息时机器人仍需要在会话内;- 机器人可以撤回单聊和群组内,自己发送 且 发送时间不超过1天(24小时)的消息;- 若机器人要撤回群内他人发送的消息,则机器人必须是该群的群主、管理员 或者 创建者,且消息发送时间不超过1年;- 无法撤回通过「[批量发送消息](https://open.feishu.cn/document/ukTMukTMukTM/ucDO1EjL3gTNx4yN4UTM)」接口发送的消息 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteMessageSample.java ; - */ - public DeleteMessageResp delete(DeleteMessageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/im/v1/messages/:message_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * ,转发一条消息 - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=forward&project=im&resource=message&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ForwardMessageSample.java ; - */ - public ForwardMessageResp forward(ForwardMessageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/messages/:message_id/forward" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ForwardMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ForwardMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/forward" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * ,转发一条消息 - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=forward&project=im&resource=message&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ForwardMessageSample.java ; - */ - public ForwardMessageResp forward(ForwardMessageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/messages/:message_id/forward" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ForwardMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ForwardMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/forward" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取指定消息的内容,通过 message_id 查询消息内容。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 机器人必须在群组中 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetMessageSample.java ; - */ - public GetMessageResp get(GetMessageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/messages/:message_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取指定消息的内容,通过 message_id 查询消息内容。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 机器人必须在群组中 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetMessageSample.java ; - */ - public GetMessageResp get(GetMessageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/messages/:message_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取会话历史消息,获取会话(包括单聊、群组)的历史消息(聊天记录)。 - *

接口级别权限默认只能获取单聊(p2p)消息,如果需要获取群组(group)消息,应用还必须拥有 **==获取群组中所有消息==** 权限 ; - *

- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 获取消息时,机器人必须在群组中 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListMessageSample.java ; - */ - public ListMessageResp list(ListMessageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/messages" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取会话历史消息,获取会话(包括单聊、群组)的历史消息(聊天记录)。 - *

接口级别权限默认只能获取单聊(p2p)消息,如果需要获取群组(group)消息,应用还必须拥有 **==获取群组中所有消息==** 权限 ; - *

- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 获取消息时,机器人必须在群组中 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListMessageSample.java ; - */ - public ListMessageResp list(ListMessageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/messages" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * ,合并转发多条消息 - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=merge_forward&project=im&resource=message&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/MergeForwardMessageSample.java ; - */ - public MergeForwardMessageResp mergeForward(MergeForwardMessageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/messages/merge_forward" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - MergeForwardMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MergeForwardMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/merge_forward" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * ,合并转发多条消息 - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=merge_forward&project=im&resource=message&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/MergeForwardMessageSample.java ; - */ - public MergeForwardMessageResp mergeForward(MergeForwardMessageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/messages/merge_forward" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - MergeForwardMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MergeForwardMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/merge_forward" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新应用发送的消息,更新应用已发送的消息卡片内容。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 若以user_access_token更新消息,该操作用户必须是卡片消息的发送者;- 仅支持对所有人更新**未撤回**的[「共享卡片」](ukTMukTMukTM/uAjNwUjLwYDM14CM2ATN)消息,需在卡片的config属性中,显式声明 =="update_multi":true==。 ;- **不支持更新批量消息**;- 文本消息请求体最大不能超过150KB;卡片及富文本消息请求体最大不能超过30KB;- 仅支持修改14天内发送的消息;- 单条消息更新频控为**5QPS** ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PatchMessageSample.java ; - */ - public PatchMessageResp patch(PatchMessageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/im/v1/messages/:message_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新应用发送的消息,更新应用已发送的消息卡片内容。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 若以user_access_token更新消息,该操作用户必须是卡片消息的发送者;- 仅支持对所有人更新**未撤回**的[「共享卡片」](ukTMukTMukTM/uAjNwUjLwYDM14CM2ATN)消息,需在卡片的config属性中,显式声明 =="update_multi":true==。 ;- **不支持更新批量消息**;- 文本消息请求体最大不能超过150KB;卡片及富文本消息请求体最大不能超过30KB;- 仅支持修改14天内发送的消息;- 单条消息更新频控为**5QPS** ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PatchMessageSample.java ; - */ - public PatchMessageResp patch(PatchMessageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/im/v1/messages/:message_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询消息已读信息,查询消息的已读信息。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 只能查询机器人自己发送,且发送时间不超过7天的消息;- 查询消息已读信息时机器人仍需要在会话内;- 本接口不支持查询批量消息 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/read_users ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ReadUsersMessageSample.java ; - */ - public ReadUsersMessageResp readUsers(ReadUsersMessageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/messages/:message_id/read_users" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ReadUsersMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ReadUsersMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/read_users" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询消息已读信息,查询消息的已读信息。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 只能查询机器人自己发送,且发送时间不超过7天的消息;- 查询消息已读信息时机器人仍需要在会话内;- 本接口不支持查询批量消息 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/read_users ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ReadUsersMessageSample.java ; - */ - public ReadUsersMessageResp readUsers(ReadUsersMessageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/messages/:message_id/read_users" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ReadUsersMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ReadUsersMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/read_users" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 回复消息,回复指定消息,支持文本、富文本、卡片、群名片、个人名片、图片、视频、文件等多种消息类型。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 回复私聊消息,需要机器人对用户有[可用性](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability);- 回复群组消息,需要机器人在群中 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/reply ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ReplyMessageSample.java ; - */ - public ReplyMessageResp reply(ReplyMessageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/messages/:message_id/reply" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ReplyMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ReplyMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/reply" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 回复消息,回复指定消息,支持文本、富文本、卡片、群名片、个人名片、图片、视频、文件等多种消息类型。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 回复私聊消息,需要机器人对用户有[可用性](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability);- 回复群组消息,需要机器人在群中 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/reply ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ReplyMessageSample.java ; - */ - public ReplyMessageResp reply(ReplyMessageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/messages/:message_id/reply" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ReplyMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ReplyMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/reply" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * ,编辑已发送的消息内容,当前仅支持编辑文本和富文本消息。 - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=im&resource=message&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateMessageSample.java ; - */ - public UpdateMessageResp update(UpdateMessageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/im/v1/messages/:message_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * ,编辑已发送的消息内容,当前仅支持编辑文本和富文本消息。 - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=im&resource=message&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateMessageSample.java ; - */ - public UpdateMessageResp update(UpdateMessageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/im/v1/messages/:message_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 发送应用内加急,对指定消息进行应用内加急。 - *

特别说明:;- 默认接口限流为50 QPS,请谨慎调用 ; - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 不支持加急批量消息;- 只能加急机器人自己发送的消息;- 加急时机器人需要在加急消息所在的群中;- 调用本接口需要用户已阅读加急的消息才可以继续加急(用户未读的加急上限为200条) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/urgent_app ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UrgentAppMessageSample.java ; - */ - public UrgentAppMessageResp urgentApp(UrgentAppMessageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/im/v1/messages/:message_id/urgent_app" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UrgentAppMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UrgentAppMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/urgent_app" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 发送应用内加急,对指定消息进行应用内加急。 - *

特别说明:;- 默认接口限流为50 QPS,请谨慎调用 ; - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 不支持加急批量消息;- 只能加急机器人自己发送的消息;- 加急时机器人需要在加急消息所在的群中;- 调用本接口需要用户已阅读加急的消息才可以继续加急(用户未读的加急上限为200条) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/urgent_app ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UrgentAppMessageSample.java ; - */ - public UrgentAppMessageResp urgentApp(UrgentAppMessageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/im/v1/messages/:message_id/urgent_app" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UrgentAppMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UrgentAppMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/urgent_app" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 发送电话加急,对指定消息进行应用内加急与电话加急。 - *

特别说明:;- 通过接口产生的电话加急将消耗企业的加急额度,请慎重调用;- 通过[租户管理后台](https://admin.feishu.cn/)-费用中心-短信/电话加急 可以查看当前额度;- 默认接口限流为50 QPS,请谨慎调用 ; - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 只能加急机器人自己发送的消息;- 加急时机器人需要在加急消息所在的群组中;- 需要用户阅读已加急的消息才可以继续加急(用户未读的加急上限为200条) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/urgent_phone ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UrgentPhoneMessageSample.java ; - */ - public UrgentPhoneMessageResp urgentPhone(UrgentPhoneMessageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/im/v1/messages/:message_id/urgent_phone" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UrgentPhoneMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UrgentPhoneMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/urgent_phone" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 发送电话加急,对指定消息进行应用内加急与电话加急。 - *

特别说明:;- 通过接口产生的电话加急将消耗企业的加急额度,请慎重调用;- 通过[租户管理后台](https://admin.feishu.cn/)-费用中心-短信/电话加急 可以查看当前额度;- 默认接口限流为50 QPS,请谨慎调用 ; - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 只能加急机器人自己发送的消息;- 加急时机器人需要在加急消息所在的群组中;- 需要用户阅读已加急的消息才可以继续加急(用户未读的加急上限为200条) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/urgent_phone ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UrgentPhoneMessageSample.java ; - */ - public UrgentPhoneMessageResp urgentPhone(UrgentPhoneMessageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/im/v1/messages/:message_id/urgent_phone" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UrgentPhoneMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UrgentPhoneMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/urgent_phone" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 发送短信加急,对指定消息进行应用内加急与短信加急。 - *

特别说明:;- 通过接口产生的短信加急将消耗企业的加急额度,请慎重调用;- 通过[租户管理后台](https://admin.feishu.cn/)-费用中心-短信/电话加急 可以查看当前额度;- 默认接口限流为50 QPS,请谨慎调用 ; - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 只能加急机器人自己发送的消息;- 加急时机器人仍需要在加急消息所在的群组中;- 调用本接口需要用户已阅读加急的消息才可以继续加急(用户未读的加急上限为200条) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/urgent_sms ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UrgentSmsMessageSample.java ; - */ - public UrgentSmsMessageResp urgentSms(UrgentSmsMessageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/im/v1/messages/:message_id/urgent_sms" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UrgentSmsMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UrgentSmsMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/urgent_sms" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 发送短信加急,对指定消息进行应用内加急与短信加急。 - *

特别说明:;- 通过接口产生的短信加急将消耗企业的加急额度,请慎重调用;- 通过[租户管理后台](https://admin.feishu.cn/)-费用中心-短信/电话加急 可以查看当前额度;- 默认接口限流为50 QPS,请谨慎调用 ; - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 只能加急机器人自己发送的消息;- 加急时机器人仍需要在加急消息所在的群组中;- 调用本接口需要用户已阅读加急的消息才可以继续加急(用户未读的加急上限为200条) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/urgent_sms ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UrgentSmsMessageSample.java ; - */ - public UrgentSmsMessageResp urgentSms(UrgentSmsMessageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/im/v1/messages/:message_id/urgent_sms" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UrgentSmsMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UrgentSmsMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/urgent_sms" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class MessageReaction { - private final Config config; - - public MessageReaction(Config config) { - this.config = config; - } - - /** - * 添加消息表情回复,给指定消息添加指定类型的表情回复(reaction即表情回复,本文档统一用“reaction”代称)。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 待添加reaction的消息要真实存在,不能被撤回;- 给消息添加reaction,需要reaction的发送方(机器人或者用户)在消息所在的会话内 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-reaction/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateMessageReactionSample.java ; - */ - public CreateMessageReactionResp create(CreateMessageReactionReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/messages/:message_id/reactions" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateMessageReactionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMessageReactionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/reactions" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 添加消息表情回复,给指定消息添加指定类型的表情回复(reaction即表情回复,本文档统一用“reaction”代称)。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 待添加reaction的消息要真实存在,不能被撤回;- 给消息添加reaction,需要reaction的发送方(机器人或者用户)在消息所在的会话内 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-reaction/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateMessageReactionSample.java ; - */ - public CreateMessageReactionResp create(CreateMessageReactionReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/messages/:message_id/reactions" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateMessageReactionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMessageReactionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/reactions" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除消息表情回复,删除指定消息的表情回复(reaction即表情回复,本文档统一用“reaction”代称)。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 只能删除真实存在的reaction,并且删除reaction请求的操作者必须是reaction的原始添加者 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-reaction/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteMessageReactionSample.java ; - */ - public DeleteMessageReactionResp delete(DeleteMessageReactionReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/im/v1/messages/:message_id/reactions/:reaction_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteMessageReactionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteMessageReactionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/reactions/:reaction_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除消息表情回复,删除指定消息的表情回复(reaction即表情回复,本文档统一用“reaction”代称)。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 只能删除真实存在的reaction,并且删除reaction请求的操作者必须是reaction的原始添加者 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-reaction/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteMessageReactionSample.java ; - */ - public DeleteMessageReactionResp delete(DeleteMessageReactionReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/im/v1/messages/:message_id/reactions/:reaction_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteMessageReactionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteMessageReactionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/reactions/:reaction_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取消息表情回复,获取指定消息的特定类型表情回复列表(reaction即表情回复,本文档统一用“reaction”代称)。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 待获取reaction信息的消息要真实存在,不能被撤回;- 获取消息的reaction,需要request的授权主体(机器人或者用户)在消息所在的会话内 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-reaction/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListMessageReactionSample.java ; - */ - public ListMessageReactionResp list(ListMessageReactionReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/messages/:message_id/reactions" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListMessageReactionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMessageReactionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/reactions" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取消息表情回复,获取指定消息的特定类型表情回复列表(reaction即表情回复,本文档统一用“reaction”代称)。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 待获取reaction信息的消息要真实存在,不能被撤回;- 获取消息的reaction,需要request的授权主体(机器人或者用户)在消息所在的会话内 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-reaction/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListMessageReactionSample.java ; - */ - public ListMessageReactionResp list(ListMessageReactionReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/messages/:message_id/reactions" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListMessageReactionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMessageReactionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/reactions" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class MessageResource { - private final Config config; - - public MessageResource(Config config) { - this.config = config; - } - - /** - * 获取消息中的资源文件,获取消息中的资源文件,包括音频,视频,图片和文件,**暂不支持表情包资源下载**。当前仅支持 100M 以内的资源文件的下载。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人和消息需要在同一会话中;- 暂不支持获取合并转发消息中的子消息的资源文件 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-resource/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetMessageResourceSample.java ; - */ - public GetMessageResourceResp get(GetMessageResourceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/messages/:message_id/resources/:file_key" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - if (httpResponse.getStatusCode() == 200) { - GetMessageResourceResp resp = new GetMessageResourceResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - GetMessageResourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMessageResourceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/resources/:file_key" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取消息中的资源文件,获取消息中的资源文件,包括音频,视频,图片和文件,**暂不支持表情包资源下载**。当前仅支持 100M 以内的资源文件的下载。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人和消息需要在同一会话中;- 暂不支持获取合并转发消息中的子消息的资源文件 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-resource/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetMessageResourceSample.java ; - */ - public GetMessageResourceResp get(GetMessageResourceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/messages/:message_id/resources/:file_key" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 下载请求,返回流 - if (httpResponse.getStatusCode() == 200) { - GetMessageResourceResp resp = new GetMessageResourceResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - GetMessageResourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMessageResourceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/resources/:file_key" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Pin { - private final Config config; - - public Pin(Config config) { - this.config = config; - } - - /** - * Pin消息,Pin一条指定的消息。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- Pin消息时,机器人必须在对应的群组中;- 若消息已经被Pin,返回该Pin的操作信息;- 不能Pin一条对操作者不可见的消息;- 对同一条消息的Pin操作不能超过==5 QPS== ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/pin/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreatePinSample.java ; - */ - public CreatePinResp create(CreatePinReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/pins" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreatePinResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePinResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/pins" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * Pin消息,Pin一条指定的消息。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- Pin消息时,机器人必须在对应的群组中;- 若消息已经被Pin,返回该Pin的操作信息;- 不能Pin一条对操作者不可见的消息;- 对同一条消息的Pin操作不能超过==5 QPS== ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/pin/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreatePinSample.java ; - */ - public CreatePinResp create(CreatePinReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/im/v1/pins" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreatePinResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePinResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/pins" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 移除Pin消息,移除一条指定消息的Pin。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 移除Pin消息时,机器人必须在对应的群组中;- 若消息未被Pin或已被撤回,返回成功信息;- 不能移除一条对操作者不可见的Pin消息;- 对同一条消息移除Pin的操作不能超过==5 QPS== ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/pin/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeletePinSample.java ; - */ - public DeletePinResp delete(DeletePinReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/im/v1/pins/:message_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeletePinResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePinResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/pins/:message_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 移除Pin消息,移除一条指定消息的Pin。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 移除Pin消息时,机器人必须在对应的群组中;- 若消息未被Pin或已被撤回,返回成功信息;- 不能移除一条对操作者不可见的Pin消息;- 对同一条消息移除Pin的操作不能超过==5 QPS== ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/pin/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeletePinSample.java ; - */ - public DeletePinResp delete(DeletePinReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/im/v1/pins/:message_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeletePinResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePinResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/pins/:message_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取群内Pin消息,获取所在群内指定时间范围内的所有Pin消息。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 获取Pin消息时,机器人必须在群组中;- 获取的Pin消息按Pin的创建时间降序排列;- 接口默认限流为==50 QPS== ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/pin/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListPinSample.java ; - */ - public ListPinResp list(ListPinReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/pins" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListPinResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPinResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/pins" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取群内Pin消息,获取所在群内指定时间范围内的所有Pin消息。 - *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 获取Pin消息时,机器人必须在群组中;- 获取的Pin消息按Pin的创建时间降序排列;- 接口默认限流为==50 QPS== ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/pin/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListPinSample.java ; - */ - public ListPinResp list(ListPinReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/im/v1/pins" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListPinResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPinResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/pins" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public abstract static class P2ChatDisbandedV1Handler implements IEventHandler { - @Override - public P2ChatDisbandedV1 getEvent() { - return new P2ChatDisbandedV1(); - } - } - - public abstract static class P2ChatUpdatedV1Handler implements IEventHandler { - @Override - public P2ChatUpdatedV1 getEvent() { - return new P2ChatUpdatedV1(); - } - } - - public abstract static class P2ChatMemberBotAddedV1Handler implements IEventHandler { - @Override - public P2ChatMemberBotAddedV1 getEvent() { - return new P2ChatMemberBotAddedV1(); - } - } - - public abstract static class P2ChatMemberBotDeletedV1Handler implements IEventHandler { - @Override - public P2ChatMemberBotDeletedV1 getEvent() { - return new P2ChatMemberBotDeletedV1(); - } - } - - public abstract static class P2ChatMemberUserAddedV1Handler implements IEventHandler { - @Override - public P2ChatMemberUserAddedV1 getEvent() { - return new P2ChatMemberUserAddedV1(); - } - } - - public abstract static class P2ChatMemberUserDeletedV1Handler implements IEventHandler { - @Override - public P2ChatMemberUserDeletedV1 getEvent() { - return new P2ChatMemberUserDeletedV1(); - } - } - - public abstract static class P2ChatMemberUserWithdrawnV1Handler implements IEventHandler { - @Override - public P2ChatMemberUserWithdrawnV1 getEvent() { - return new P2ChatMemberUserWithdrawnV1(); - } - } - - public abstract static class P2MessageReadV1Handler implements IEventHandler { - @Override - public P2MessageReadV1 getEvent() { - return new P2MessageReadV1(); - } - } - - public abstract static class P2MessageRecalledV1Handler implements IEventHandler { - @Override - public P2MessageRecalledV1 getEvent() { - return new P2MessageRecalledV1(); - } - } - - public abstract static class P2MessageReceiveV1Handler implements IEventHandler { - @Override - public P2MessageReceiveV1 getEvent() { - return new P2MessageReceiveV1(); - } - } - - public abstract static class P2MessageReactionCreatedV1Handler implements IEventHandler { - @Override - public P2MessageReactionCreatedV1 getEvent() { - return new P2MessageReactionCreatedV1(); - } - } - - public abstract static class P2MessageReactionDeletedV1Handler implements IEventHandler { - @Override - public P2MessageReactionDeletedV1 getEvent() { - return new P2MessageReactionDeletedV1(); - } - } - - public abstract static class P1MessageReadV1Handler implements IEventHandler { - - @Override - public P1MessageReadV1 getEvent() { - return new P1MessageReadV1(); - } - } - - - public abstract static class P1MessageReceivedV1Handler implements IEventHandler { - - @Override - public P1MessageReceivedV1 getEvent() { - return new P1MessageReceivedV1(); - } - } - - public abstract static class P1P2PChatCreatedV1Handler implements IEventHandler { - @Override - public P1P2PChatCreatedV1 getEvent() { - return new P1P2PChatCreatedV1(); - } - } -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/V1.java new file mode 100644 index 000000000..20af20105 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/V1.java @@ -0,0 +1,131 @@ +// Code generated by lark suite 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 com.lark.oapi.service.im.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.im.v1.resource.*; + +public class V1 { + private final BatchMessage batchMessage; // 消息 - 批量消息 + private final Chat chat; // 群组 + private final ChatAnnouncement chatAnnouncement; // 群组 - 群公告 + private final ChatManagers chatManagers; // 群组 - 群成员 + private final ChatMemberBot chatMemberBot; // 事件 + private final ChatMemberUser chatMemberUser; // 事件 + private final ChatMembers chatMembers; // 群组 - 群成员 + private final ChatMenuItem chatMenuItem; // chat.menu_item + private final ChatMenuTree chatMenuTree; // 群组 - 群菜单 + private final ChatModeration chatModeration; // chat.moderation + private final ChatTab chatTab; // 群组 - 会话标签页 + private final ChatTopNotice chatTopNotice; // chat.top_notice + private final File file; // 消息 - 文件信息 + private final Image image; // 消息 - 图片信息 + private final Message message; // 消息加急 + private final MessageReaction messageReaction; // 消息 - 表情回复 + private final MessageResource messageResource; // message.resource + private final Pin pin; // 消息 - Pin + + public V1(Config config) { + this.batchMessage = new BatchMessage(config); + this.chat = new Chat(config); + this.chatAnnouncement = new ChatAnnouncement(config); + this.chatManagers = new ChatManagers(config); + this.chatMemberBot = new ChatMemberBot(config); + this.chatMemberUser = new ChatMemberUser(config); + this.chatMembers = new ChatMembers(config); + this.chatMenuItem = new ChatMenuItem(config); + this.chatMenuTree = new ChatMenuTree(config); + this.chatModeration = new ChatModeration(config); + this.chatTab = new ChatTab(config); + this.chatTopNotice = new ChatTopNotice(config); + this.file = new File(config); + this.image = new Image(config); + this.message = new Message(config); + this.messageReaction = new MessageReaction(config); + this.messageResource = new MessageResource(config); + this.pin = new Pin(config); + } + + public BatchMessage batchMessage() { + return batchMessage; + } + + public Chat chat() { + return chat; + } + + public ChatAnnouncement chatAnnouncement() { + return chatAnnouncement; + } + + public ChatManagers chatManagers() { + return chatManagers; + } + + public ChatMemberBot chatMemberBot() { + return chatMemberBot; + } + + public ChatMemberUser chatMemberUser() { + return chatMemberUser; + } + + public ChatMembers chatMembers() { + return chatMembers; + } + + public ChatMenuItem chatMenuItem() { + return chatMenuItem; + } + + public ChatMenuTree chatMenuTree() { + return chatMenuTree; + } + + public ChatModeration chatModeration() { + return chatModeration; + } + + public ChatTab chatTab() { + return chatTab; + } + + public ChatTopNotice chatTopNotice() { + return chatTopNotice; + } + + public File file() { + return file; + } + + public Image image() { + return image; + } + + public Message message() { + return message; + } + + public MessageReaction messageReaction() { + return messageReaction; + } + + public MessageResource messageResource() { + return messageResource; + } + + public Pin pin() { + return pin; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/model/GetMessageResourceReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/model/GetMessageResourceReq.java index ab9d29ff1..95f5b81e2 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/model/GetMessageResourceReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/model/GetMessageResourceReq.java @@ -43,6 +43,7 @@ public class GetMessageResourceReq { // builder 开始 public GetMessageResourceReq() { } + public GetMessageResourceReq(Builder builder) { /** * 资源类型,可选"image, file“; image对应消息中的 图片,富文本消息中的图片。 file对应消息中的 文件、音频、视频、(表情包除外) diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/BatchMessage.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/BatchMessage.java new file mode 100644 index 000000000..0d692e2a3 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/BatchMessage.java @@ -0,0 +1,242 @@ +// Code generated by lark suite 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 com.lark.oapi.service.im.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.im.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class BatchMessage { + private static final Logger log = LoggerFactory.getLogger(BatchMessage.class); + private final Config config; + + public BatchMessage(Config config) { + this.config = config; + } + + + /** + * 批量撤回消息,批量撤回通过[批量发送消息](https://open.feishu.cn/document/ukTMukTMukTM/ucDO1EjL3gTNx4yN4UTM)接口发送的消息。 + *

注意事项:;- 应用需要启用[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 撤回单条发送的消息请使用[撤回消息](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/delete)接口;- 不支持撤回发出时间超过1天的消息;- 一次调用涉及大量消息,所以为异步接口,会有一定延迟。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/batch_message/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteBatchMessageSample.java ; + */ + public DeleteBatchMessageResp delete(DeleteBatchMessageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/im/v1/batch_messages/:batch_message_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteBatchMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteBatchMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/batch_messages/:batch_message_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量撤回消息,批量撤回通过[批量发送消息](https://open.feishu.cn/document/ukTMukTMukTM/ucDO1EjL3gTNx4yN4UTM)接口发送的消息。 + *

注意事项:;- 应用需要启用[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 撤回单条发送的消息请使用[撤回消息](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/delete)接口;- 不支持撤回发出时间超过1天的消息;- 一次调用涉及大量消息,所以为异步接口,会有一定延迟。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/batch_message/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteBatchMessageSample.java ; + */ + public DeleteBatchMessageResp delete(DeleteBatchMessageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/im/v1/batch_messages/:batch_message_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteBatchMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteBatchMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/batch_messages/:batch_message_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询批量消息整体进度,该接口在[查询批量消息推送和阅读人数](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/batch_message/read_user)查询结果的基础上,增加了批量请求中有效的userid数量以及消息撤回进度数据。 + *

注意事项:;* 该接口返回的数据为查询时刻的快照数据 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/batch_message/get_progress ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetProgressBatchMessageSample.java ; + */ + public GetProgressBatchMessageResp getProgress(GetProgressBatchMessageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/batch_messages/:batch_message_id/get_progress" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetProgressBatchMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetProgressBatchMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/batch_messages/:batch_message_id/get_progress" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询批量消息整体进度,该接口在[查询批量消息推送和阅读人数](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/batch_message/read_user)查询结果的基础上,增加了批量请求中有效的userid数量以及消息撤回进度数据。 + *

注意事项:;* 该接口返回的数据为查询时刻的快照数据 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/batch_message/get_progress ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetProgressBatchMessageSample.java ; + */ + public GetProgressBatchMessageResp getProgress(GetProgressBatchMessageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/batch_messages/:batch_message_id/get_progress" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetProgressBatchMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetProgressBatchMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/batch_messages/:batch_message_id/get_progress" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询批量消息推送和阅读人数,批量发送消息后,可以通过该接口查询批量消息推送的总人数和阅读人数。 + *

注意事项:;- 只能查询通过[批量发送消息](https://open.feishu.cn/document/ukTMukTMukTM/ucDO1EjL3gTNx4yN4UTM)接口产生的消息;- 该接口返回的数据为查询时刻的快照数据 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/batch_message/read_user ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ReadUserBatchMessageSample.java ; + */ + public ReadUserBatchMessageResp readUser(ReadUserBatchMessageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/batch_messages/:batch_message_id/read_user" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ReadUserBatchMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ReadUserBatchMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/batch_messages/:batch_message_id/read_user" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询批量消息推送和阅读人数,批量发送消息后,可以通过该接口查询批量消息推送的总人数和阅读人数。 + *

注意事项:;- 只能查询通过[批量发送消息](https://open.feishu.cn/document/ukTMukTMukTM/ucDO1EjL3gTNx4yN4UTM)接口产生的消息;- 该接口返回的数据为查询时刻的快照数据 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/batch_message/read_user ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ReadUserBatchMessageSample.java ; + */ + public ReadUserBatchMessageResp readUser(ReadUserBatchMessageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/batch_messages/:batch_message_id/read_user" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ReadUserBatchMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ReadUserBatchMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/batch_messages/:batch_message_id/read_user" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/Chat.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/Chat.java new file mode 100644 index 000000000..74e844669 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/Chat.java @@ -0,0 +1,514 @@ +// Code generated by lark suite 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 com.lark.oapi.service.im.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.im.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Chat { + private static final Logger log = LoggerFactory.getLogger(Chat.class); + private final Config config; + + public Chat(Config config) { + this.config = config; + } + + + /** + * 创建群,创建群并设置群头像、群名、群描述等。 + *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 本接口支持在创建群的同时拉用户或机器人进群;如果仅需要拉用户或者机器人入群参考 [将用户或机器人拉入群聊](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/create)接口 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatSample.java ; + */ + public CreateChatResp create(CreateChatReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/chats" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateChatResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建群,创建群并设置群头像、群名、群描述等。 + *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 本接口支持在创建群的同时拉用户或机器人进群;如果仅需要拉用户或者机器人入群参考 [将用户或机器人拉入群聊](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/create)接口 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatSample.java ; + */ + public CreateChatResp create(CreateChatReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/chats" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateChatResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 解散群,解散群组。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 如果使用tenant_access_token,需要机器人符合以下任一情况才可解散群:; - 机器人是群主; - 机器人是群的创建者且具备==更新应用所创建群的群信息==权限;- 如果使用user_access_token,需要对应的用户是群主才可解散群 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteChatSample.java ; + */ + public DeleteChatResp delete(DeleteChatReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/im/v1/chats/:chat_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteChatResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 解散群,解散群组。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 如果使用tenant_access_token,需要机器人符合以下任一情况才可解散群:; - 机器人是群主; - 机器人是群的创建者且具备==更新应用所创建群的群信息==权限;- 如果使用user_access_token,需要对应的用户是群主才可解散群 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteChatSample.java ; + */ + public DeleteChatResp delete(DeleteChatReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/im/v1/chats/:chat_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteChatResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取群信息,获取群名称、群描述、群头像、群主 ID 等群基本信息。 + *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人或授权用户必须在群里(否则只会返回群名称、群头像等基本信息);- 获取内部群信息时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatSample.java ; + */ + public GetChatResp get(GetChatReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/chats/:chat_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetChatResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取群信息,获取群名称、群描述、群头像、群主 ID 等群基本信息。 + *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人或授权用户必须在群里(否则只会返回群名称、群头像等基本信息);- 获取内部群信息时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatSample.java ; + */ + public GetChatResp get(GetChatReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/chats/:chat_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetChatResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取群分享链接,获取指定群的分享链接。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - access_token所对应的 **机器人** 或 **授权用户** 必须在`chat_id`参数指定的群组中;- 单聊、密聊、团队群不支持分享群链接;- 当Bot被停用或Bot退出群组时,Bot生成的群链接也将停用;- 当群聊开启了 ==仅群主和群管理员可添加群成员/分享群== 设置时,仅**群主**和**群管理员**可以获取群分享链接;- 获取内部群分享链接时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/link ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/LinkChatSample.java ; + */ + public LinkChatResp link(LinkChatReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/chats/:chat_id/link" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + LinkChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, LinkChatResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/link" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取群分享链接,获取指定群的分享链接。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - access_token所对应的 **机器人** 或 **授权用户** 必须在`chat_id`参数指定的群组中;- 单聊、密聊、团队群不支持分享群链接;- 当Bot被停用或Bot退出群组时,Bot生成的群链接也将停用;- 当群聊开启了 ==仅群主和群管理员可添加群成员/分享群== 设置时,仅**群主**和**群管理员**可以获取群分享链接;- 获取内部群分享链接时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/link ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/LinkChatSample.java ; + */ + public LinkChatResp link(LinkChatReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/chats/:chat_id/link" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + LinkChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, LinkChatResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/link" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取用户或机器人所在的群列表,获取用户或者机器人所在群列表。 + *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 请注意区分本接口和[获取群信息](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/get)的请求 URL;- 获取的群列表不包含P2P单聊 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListChatSample.java ; + */ + public ListChatResp list(ListChatReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/chats" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListChatResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取用户或机器人所在的群列表,获取用户或者机器人所在群列表。 + *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 请注意区分本接口和[获取群信息](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/get)的请求 URL;- 获取的群列表不包含P2P单聊 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListChatSample.java ; + */ + public ListChatResp list(ListChatReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/chats" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListChatResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 搜索对用户或机器人可见的群列表,搜索对用户或机器人可见的群列表,包括:用户或机器人所在的群、对用户或机器人公开的群。;搜索可获得的群信息包括:群ID(chat_id)、群名称、群描述等。 + *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/search ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/SearchChatSample.java ; + */ + public SearchChatResp search(SearchChatReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/chats/search" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchChatResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 搜索对用户或机器人可见的群列表,搜索对用户或机器人可见的群列表,包括:用户或机器人所在的群、对用户或机器人公开的群。;搜索可获得的群信息包括:群ID(chat_id)、群名称、群描述等。 + *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/search ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/SearchChatSample.java ; + */ + public SearchChatResp search(SearchChatReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/chats/search" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchChatResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新群信息,更新群头像、群名称、群描述、群配置、转让群主等。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 对于群主/群管理员 或 创建群组且具备 ==更新应用所创建群的群信息== 权限的机器人,可更新所有信息;- 对于不满足上述权限条件的群成员或机器人:; - 若未开启 ==仅群主和群管理员可编辑群信息== 配置,仅可更新群头像、群名称、群描述、群国际化名称信息; - 若开启了 ==仅群主和群管理员可编辑群信息== 配置,任何群信息都不能修改;- 如果同时更新 ==邀请用户或机器人入群权限== 和 ==群分享权限== 这两项设置需要满足以下条件:; - 若未开启 ==仅群主和管理员可以邀请用户或机器人入群==,需要设置 ==群分享权限== 为 ==允许分享==; - 若开启了 ==仅群主和管理员可以邀请用户或机器人入群==,需要设置 ==群分享权限== 为 ==不允许分享== ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateChatSample.java ; + */ + public UpdateChatResp update(UpdateChatReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/im/v1/chats/:chat_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UpdateChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateChatResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新群信息,更新群头像、群名称、群描述、群配置、转让群主等。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 对于群主/群管理员 或 创建群组且具备 ==更新应用所创建群的群信息== 权限的机器人,可更新所有信息;- 对于不满足上述权限条件的群成员或机器人:; - 若未开启 ==仅群主和群管理员可编辑群信息== 配置,仅可更新群头像、群名称、群描述、群国际化名称信息; - 若开启了 ==仅群主和群管理员可编辑群信息== 配置,任何群信息都不能修改;- 如果同时更新 ==邀请用户或机器人入群权限== 和 ==群分享权限== 这两项设置需要满足以下条件:; - 若未开启 ==仅群主和管理员可以邀请用户或机器人入群==,需要设置 ==群分享权限== 为 ==允许分享==; - 若开启了 ==仅群主和管理员可以邀请用户或机器人入群==,需要设置 ==群分享权限== 为 ==不允许分享== ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateChatSample.java ; + */ + public UpdateChatResp update(UpdateChatReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/im/v1/chats/:chat_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UpdateChatResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateChatResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatAnnouncement.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatAnnouncement.java new file mode 100644 index 000000000..2e42e98a5 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatAnnouncement.java @@ -0,0 +1,177 @@ +// Code generated by lark suite 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 com.lark.oapi.service.im.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.im.v1.model.GetChatAnnouncementReq; +import com.lark.oapi.service.im.v1.model.GetChatAnnouncementResp; +import com.lark.oapi.service.im.v1.model.PatchChatAnnouncementReq; +import com.lark.oapi.service.im.v1.model.PatchChatAnnouncementResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ChatAnnouncement { + private static final Logger log = LoggerFactory.getLogger(ChatAnnouncement.class); + private final Config config; + + public ChatAnnouncement(Config config) { + this.config = config; + } + + + /** + * 获取群公告信息,获取会话中的群公告信息,公告信息格式与[云文档](https://open.feishu.cn/document/ukTMukTMukTM/uAzM5YjLwMTO24CMzkjN)格式相同。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 获取内部群信息时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-announcement/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatAnnouncementSample.java ; + */ + public GetChatAnnouncementResp get(GetChatAnnouncementReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/chats/:chat_id/announcement" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetChatAnnouncementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetChatAnnouncementResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/announcement" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取群公告信息,获取会话中的群公告信息,公告信息格式与[云文档](https://open.feishu.cn/document/ukTMukTMukTM/uAzM5YjLwMTO24CMzkjN)格式相同。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 获取内部群信息时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-announcement/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatAnnouncementSample.java ; + */ + public GetChatAnnouncementResp get(GetChatAnnouncementReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/chats/:chat_id/announcement" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetChatAnnouncementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetChatAnnouncementResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/announcement" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新群公告信息,更新会话中的群公告信息,更新公告信息的格式和更新[云文档](https://open.feishu.cn/document/ukTMukTMukTM/uAzM5YjLwMTO24CMzkjN)格式相同。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 操作者需要拥有群公告文档的阅读权限;- 获取内部群信息时,操作者须与群组在同一租户下;- 若群开启了 ==仅群主和群管理员可编辑群信息== 配置,群主/群管理员 或 创建群组且具备 ==更新应用所创建群的群信息== 权限的机器人,可更新群公告;- 若群未开启 ==仅群主和群管理员可编辑群信息== 配置,所有成员可以更新群公告 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-announcement/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PatchChatAnnouncementSample.java ; + */ + public PatchChatAnnouncementResp patch(PatchChatAnnouncementReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/im/v1/chats/:chat_id/announcement" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchChatAnnouncementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchChatAnnouncementResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/announcement" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新群公告信息,更新会话中的群公告信息,更新公告信息的格式和更新[云文档](https://open.feishu.cn/document/ukTMukTMukTM/uAzM5YjLwMTO24CMzkjN)格式相同。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 操作者需要拥有群公告文档的阅读权限;- 获取内部群信息时,操作者须与群组在同一租户下;- 若群开启了 ==仅群主和群管理员可编辑群信息== 配置,群主/群管理员 或 创建群组且具备 ==更新应用所创建群的群信息== 权限的机器人,可更新群公告;- 若群未开启 ==仅群主和群管理员可编辑群信息== 配置,所有成员可以更新群公告 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-announcement/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PatchChatAnnouncementSample.java ; + */ + public PatchChatAnnouncementResp patch(PatchChatAnnouncementReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/im/v1/chats/:chat_id/announcement" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchChatAnnouncementResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchChatAnnouncementResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/announcement" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatManagers.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatManagers.java new file mode 100644 index 000000000..5d629544b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatManagers.java @@ -0,0 +1,177 @@ +// Code generated by lark suite 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 com.lark.oapi.service.im.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.im.v1.model.AddManagersChatManagersReq; +import com.lark.oapi.service.im.v1.model.AddManagersChatManagersResp; +import com.lark.oapi.service.im.v1.model.DeleteManagersChatManagersReq; +import com.lark.oapi.service.im.v1.model.DeleteManagersChatManagersResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ChatManagers { + private static final Logger log = LoggerFactory.getLogger(ChatManagers.class); + private final Config config; + + public ChatManagers(Config config) { + this.config = config; + } + + + /** + * 指定群管理员,将用户或机器人指定为群管理员。 + *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 仅有群主可以指定群管理员 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-managers/add_managers ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/AddManagersChatManagersSample.java ; + */ + public AddManagersChatManagersResp addManagers(AddManagersChatManagersReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/chats/:chat_id/managers/add_managers" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + AddManagersChatManagersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddManagersChatManagersResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/managers/add_managers" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 指定群管理员,将用户或机器人指定为群管理员。 + *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 仅有群主可以指定群管理员 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-managers/add_managers ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/AddManagersChatManagersSample.java ; + */ + public AddManagersChatManagersResp addManagers(AddManagersChatManagersReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/chats/:chat_id/managers/add_managers" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + AddManagersChatManagersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddManagersChatManagersResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/managers/add_managers" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除群管理员,删除指定的群管理员(用户或机器人)。 + *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 仅有群主可以删除群管理员 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-managers/delete_managers ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteManagersChatManagersSample.java ; + */ + public DeleteManagersChatManagersResp deleteManagers(DeleteManagersChatManagersReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/chats/:chat_id/managers/delete_managers" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteManagersChatManagersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteManagersChatManagersResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/managers/delete_managers" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除群管理员,删除指定的群管理员(用户或机器人)。 + *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 仅有群主可以删除群管理员 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-managers/delete_managers ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteManagersChatManagersSample.java ; + */ + public DeleteManagersChatManagersResp deleteManagers(DeleteManagersChatManagersReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/chats/:chat_id/managers/delete_managers" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteManagersChatManagersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteManagersChatManagersResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/managers/delete_managers" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatMemberBot.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatMemberBot.java new file mode 100644 index 000000000..63c2b251d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatMemberBot.java @@ -0,0 +1,29 @@ +// Code generated by lark suite 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 com.lark.oapi.service.im.v1.resource; + +import com.lark.oapi.core.Config; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ChatMemberBot { + private static final Logger log = LoggerFactory.getLogger(ChatMemberBot.class); + private final Config config; + + public ChatMemberBot(Config config) { + this.config = config; + } + + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatMemberUser.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatMemberUser.java new file mode 100644 index 000000000..74118584f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatMemberUser.java @@ -0,0 +1,29 @@ +// Code generated by lark suite 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 com.lark.oapi.service.im.v1.resource; + +import com.lark.oapi.core.Config; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ChatMemberUser { + private static final Logger log = LoggerFactory.getLogger(ChatMemberUser.class); + private final Config config; + + public ChatMemberUser(Config config) { + this.config = config; + } + + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatMembers.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatMembers.java new file mode 100644 index 000000000..0ad9e09bf --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatMembers.java @@ -0,0 +1,378 @@ +// Code generated by lark suite 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 com.lark.oapi.service.im.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.im.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ChatMembers { + private static final Logger log = LoggerFactory.getLogger(ChatMembers.class); + private final Config config; + + public ChatMembers(Config config) { + this.config = config; + } + + + /** + * 将用户或机器人拉入群聊,将用户或机器人拉入群聊。 + *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 如需拉用户进群,需要机器人对用户有[可用性](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability); - 机器人或授权用户必须在群组中;- 外部租户不能被加入到内部群中;- 操作内部群时,操作者须与群组在同一租户下; - 在开启 ==仅群主和群管理员可添加群成员== 的设置时,仅有群主/管理员 或 创建群组且具备 ==更新应用所创建群的群信息== 权限的机器人,可以拉用户或者机器人进群; - 在未开启 ==仅群主和群管理员可添加群成员== 的设置时,所有群成员都可以拉用户或机器人进群 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatMembersSample.java ; + */ + public CreateChatMembersResp create(CreateChatMembersReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/chats/:chat_id/members" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateChatMembersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateChatMembersResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 将用户或机器人拉入群聊,将用户或机器人拉入群聊。 + *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 如需拉用户进群,需要机器人对用户有[可用性](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability); - 机器人或授权用户必须在群组中;- 外部租户不能被加入到内部群中;- 操作内部群时,操作者须与群组在同一租户下; - 在开启 ==仅群主和群管理员可添加群成员== 的设置时,仅有群主/管理员 或 创建群组且具备 ==更新应用所创建群的群信息== 权限的机器人,可以拉用户或者机器人进群; - 在未开启 ==仅群主和群管理员可添加群成员== 的设置时,所有群成员都可以拉用户或机器人进群 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatMembersSample.java ; + */ + public CreateChatMembersResp create(CreateChatMembersReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/chats/:chat_id/members" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateChatMembersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateChatMembersResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 将用户或机器人移出群聊,将用户或机器人移出群聊。 + *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 用户或机器人在任何条件下均可移除自己出群(即主动退群);- 仅有群主/管理员 或 创建群组并且具备 ==更新应用所创建群的群信息== 权限的机器人,可以移除其他用户或者机器人;- 每次请求,最多移除50个用户或者5个机器人;- 操作内部群时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteChatMembersSample.java ; + */ + public DeleteChatMembersResp delete(DeleteChatMembersReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/im/v1/chats/:chat_id/members" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteChatMembersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteChatMembersResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 将用户或机器人移出群聊,将用户或机器人移出群聊。 + *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 用户或机器人在任何条件下均可移除自己出群(即主动退群);- 仅有群主/管理员 或 创建群组并且具备 ==更新应用所创建群的群信息== 权限的机器人,可以移除其他用户或者机器人;- 每次请求,最多移除50个用户或者5个机器人;- 操作内部群时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteChatMembersSample.java ; + */ + public DeleteChatMembersResp delete(DeleteChatMembersReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/im/v1/chats/:chat_id/members" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteChatMembersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteChatMembersResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取群成员列表,获取用户/机器人所在群的群成员列表。 + *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人或授权用户必须在群组中; - 该接口不会返回群内的机器人成员; - 由于返回的群成员列表会过滤掉机器人成员,因此返回的群成员个数可能会小于指定的page_size; - 如果有同一时间加入群的群成员,会一次性返回,这会导致返回的群成员个数可能会大于指定的page_size;- 获取内部群信息时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatMembersSample.java ; + */ + public GetChatMembersResp get(GetChatMembersReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/chats/:chat_id/members" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetChatMembersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetChatMembersResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取群成员列表,获取用户/机器人所在群的群成员列表。 + *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人或授权用户必须在群组中; - 该接口不会返回群内的机器人成员; - 由于返回的群成员列表会过滤掉机器人成员,因此返回的群成员个数可能会小于指定的page_size; - 如果有同一时间加入群的群成员,会一次性返回,这会导致返回的群成员个数可能会大于指定的page_size;- 获取内部群信息时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatMembersSample.java ; + */ + public GetChatMembersResp get(GetChatMembersReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/chats/:chat_id/members" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetChatMembersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetChatMembersResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 判断用户或机器人是否在群里,根据使用的access_token判断对应的用户或者机器人是否在群里。 + *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 获取内部群信息时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/is_in_chat ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/IsInChatChatMembersSample.java ; + */ + public IsInChatChatMembersResp isInChat(IsInChatChatMembersReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/chats/:chat_id/members/is_in_chat" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + IsInChatChatMembersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, IsInChatChatMembersResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/members/is_in_chat" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 判断用户或机器人是否在群里,根据使用的access_token判断对应的用户或者机器人是否在群里。 + *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 获取内部群信息时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/is_in_chat ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/IsInChatChatMembersSample.java ; + */ + public IsInChatChatMembersResp isInChat(IsInChatChatMembersReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/chats/:chat_id/members/is_in_chat" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + IsInChatChatMembersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, IsInChatChatMembersResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/members/is_in_chat" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 用户或机器人主动加入群聊,用户或机器人主动加入群聊。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 目前仅支持加入公开群;- 操作内部群时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/me_join ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/MeJoinChatMembersSample.java ; + */ + public MeJoinChatMembersResp meJoin(MeJoinChatMembersReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/im/v1/chats/:chat_id/members/me_join" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + MeJoinChatMembersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MeJoinChatMembersResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/members/me_join" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 用户或机器人主动加入群聊,用户或机器人主动加入群聊。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 目前仅支持加入公开群;- 操作内部群时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/me_join ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/MeJoinChatMembersSample.java ; + */ + public MeJoinChatMembersResp meJoin(MeJoinChatMembersReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/im/v1/chats/:chat_id/members/me_join" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + MeJoinChatMembersResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MeJoinChatMembersResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/members/me_join" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatMenuItem.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatMenuItem.java new file mode 100644 index 000000000..f2bf4baea --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatMenuItem.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.im.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.im.v1.model.PatchChatMenuItemReq; +import com.lark.oapi.service.im.v1.model.PatchChatMenuItemResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ChatMenuItem { + private static final Logger log = LoggerFactory.getLogger(ChatMenuItem.class); + private final Config config; + + public ChatMenuItem(Config config) { + this.config = config; + } + + + /** + * 修改群菜单元信息,修改某个一级菜单或者二级菜单的元信息。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_item/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PatchChatMenuItemSample.java ; + */ + public PatchChatMenuItemResp patch(PatchChatMenuItemReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/im/v1/chats/:chat_id/menu_items/:menu_item_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchChatMenuItemResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchChatMenuItemResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/menu_items/:menu_item_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改群菜单元信息,修改某个一级菜单或者二级菜单的元信息。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_item/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PatchChatMenuItemSample.java ; + */ + public PatchChatMenuItemResp patch(PatchChatMenuItemReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/im/v1/chats/:chat_id/menu_items/:menu_item_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchChatMenuItemResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchChatMenuItemResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/menu_items/:menu_item_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatMenuTree.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatMenuTree.java new file mode 100644 index 000000000..15adafeb3 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatMenuTree.java @@ -0,0 +1,310 @@ +// Code generated by lark suite 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 com.lark.oapi.service.im.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.im.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ChatMenuTree { + private static final Logger log = LoggerFactory.getLogger(ChatMenuTree.class); + private final Config config; + + public ChatMenuTree(Config config) { + this.config = config; + } + + + /** + * 添加群菜单,向群内添加群菜单。 + *

注意事项:;- 该API是向群内追加菜单,群内原来存在的菜单并不会被覆盖。操作API后,将返回群内所有菜单。;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。;- 一个群内,一级菜单最多有3个,每个一级菜单最多有5个二级菜单。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatMenuTreeSample.java ; + */ + public CreateChatMenuTreeResp create(CreateChatMenuTreeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/chats/:chat_id/menu_tree" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateChatMenuTreeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateChatMenuTreeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/menu_tree" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 添加群菜单,向群内添加群菜单。 + *

注意事项:;- 该API是向群内追加菜单,群内原来存在的菜单并不会被覆盖。操作API后,将返回群内所有菜单。;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。;- 一个群内,一级菜单最多有3个,每个一级菜单最多有5个二级菜单。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatMenuTreeSample.java ; + */ + public CreateChatMenuTreeResp create(CreateChatMenuTreeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/chats/:chat_id/menu_tree" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateChatMenuTreeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateChatMenuTreeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/menu_tree" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除群菜单。,删除群内菜单。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。;- 操作API后,将返回群内所有菜单。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteChatMenuTreeSample.java ; + */ + public DeleteChatMenuTreeResp delete(DeleteChatMenuTreeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/im/v1/chats/:chat_id/menu_tree" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteChatMenuTreeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteChatMenuTreeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/menu_tree" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除群菜单。,删除群内菜单。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。;- 操作API后,将返回群内所有菜单。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteChatMenuTreeSample.java ; + */ + public DeleteChatMenuTreeResp delete(DeleteChatMenuTreeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/im/v1/chats/:chat_id/menu_tree" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteChatMenuTreeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteChatMenuTreeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/menu_tree" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取群内菜单,通过群ID获取群内菜单。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatMenuTreeSample.java ; + */ + public GetChatMenuTreeResp get(GetChatMenuTreeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/chats/:chat_id/menu_tree" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetChatMenuTreeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetChatMenuTreeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/menu_tree" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取群内菜单,通过群ID获取群内菜单。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatMenuTreeSample.java ; + */ + public GetChatMenuTreeResp get(GetChatMenuTreeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/chats/:chat_id/menu_tree" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetChatMenuTreeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetChatMenuTreeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/menu_tree" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 排序群菜单,给一个群内的一级菜单排序。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。;- 操作API后,将返回群内所有菜单。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/sort ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/SortChatMenuTreeSample.java ; + */ + public SortChatMenuTreeResp sort(SortChatMenuTreeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/chats/:chat_id/menu_tree/sort" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SortChatMenuTreeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SortChatMenuTreeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/menu_tree/sort" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 排序群菜单,给一个群内的一级菜单排序。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。;- 操作API后,将返回群内所有菜单。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/sort ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/SortChatMenuTreeSample.java ; + */ + public SortChatMenuTreeResp sort(SortChatMenuTreeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/chats/:chat_id/menu_tree/sort" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SortChatMenuTreeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SortChatMenuTreeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/menu_tree/sort" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatModeration.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatModeration.java new file mode 100644 index 000000000..eb34d0319 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatModeration.java @@ -0,0 +1,177 @@ +// Code generated by lark suite 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 com.lark.oapi.service.im.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.im.v1.model.GetChatModerationReq; +import com.lark.oapi.service.im.v1.model.GetChatModerationResp; +import com.lark.oapi.service.im.v1.model.UpdateChatModerationReq; +import com.lark.oapi.service.im.v1.model.UpdateChatModerationResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ChatModeration { + private static final Logger log = LoggerFactory.getLogger(ChatModeration.class); + private final Config config; + + public ChatModeration(Config config) { + this.config = config; + } + + + /** + * 获取群成员发言权限,获取群发言模式、可发言用户名单等 + *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人 或 授权用户 必须在群里 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-moderation/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatModerationSample.java ; + */ + public GetChatModerationResp get(GetChatModerationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/chats/:chat_id/moderation" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetChatModerationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetChatModerationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/moderation" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取群成员发言权限,获取群发言模式、可发言用户名单等 + *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人 或 授权用户 必须在群里 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-moderation/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatModerationSample.java ; + */ + public GetChatModerationResp get(GetChatModerationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/chats/:chat_id/moderation" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetChatModerationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetChatModerationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/moderation" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新群发言权限,更新群组的发言权限设置,可设置为全员可发言、仅管理员可发言 或 指定用户可发言。 + *

注意事项:; - 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 若以用户授权调用接口,**当授权用户是群主**时,可更新群发言权限;- 若以租户授权调用接口(即以机器人身份调用接口),当**机器人是群主** 或者 **机器人是群组创建者、具备==更新应用所创建群的群信息==权限且仍在群内**时,可更新群发言权限 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-moderation/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateChatModerationSample.java ; + */ + public UpdateChatModerationResp update(UpdateChatModerationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/im/v1/chats/:chat_id/moderation" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateChatModerationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateChatModerationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/moderation" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新群发言权限,更新群组的发言权限设置,可设置为全员可发言、仅管理员可发言 或 指定用户可发言。 + *

注意事项:; - 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 若以用户授权调用接口,**当授权用户是群主**时,可更新群发言权限;- 若以租户授权调用接口(即以机器人身份调用接口),当**机器人是群主** 或者 **机器人是群组创建者、具备==更新应用所创建群的群信息==权限且仍在群内**时,可更新群发言权限 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-moderation/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateChatModerationSample.java ; + */ + public UpdateChatModerationResp update(UpdateChatModerationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/im/v1/chats/:chat_id/moderation" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateChatModerationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateChatModerationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/moderation" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatTab.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatTab.java new file mode 100644 index 000000000..a6f8b5b07 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatTab.java @@ -0,0 +1,378 @@ +// Code generated by lark suite 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 com.lark.oapi.service.im.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.im.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ChatTab { + private static final Logger log = LoggerFactory.getLogger(ChatTab.class); + private final Config config; + + public ChatTab(Config config) { + this.config = config; + } + + + /** + * 添加会话标签页,添加自定义会话标签页。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 只允许添加类型为`doc`和`url`的会话标签页;- 添加doc类型时,操作者(access token对应的身份)需要拥有对应文档的权限;- tab_config字段当前只对`url`类型的会话标签页生效;- 在开启 ==仅群主和管理员可管理标签页== 的设置时,仅群主和群管理员可以添加会话标签页;- 操作内部群时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatTabSample.java ; + */ + public CreateChatTabResp create(CreateChatTabReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/chats/:chat_id/chat_tabs" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateChatTabResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateChatTabResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/chat_tabs" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 添加会话标签页,添加自定义会话标签页。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 只允许添加类型为`doc`和`url`的会话标签页;- 添加doc类型时,操作者(access token对应的身份)需要拥有对应文档的权限;- tab_config字段当前只对`url`类型的会话标签页生效;- 在开启 ==仅群主和管理员可管理标签页== 的设置时,仅群主和群管理员可以添加会话标签页;- 操作内部群时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatTabSample.java ; + */ + public CreateChatTabResp create(CreateChatTabReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/chats/:chat_id/chat_tabs" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateChatTabResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateChatTabResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/chat_tabs" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除会话标签页,删除会话标签页。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 只允许删除类型为`doc`和`url`的会话标签页;- 在开启 ==仅群主和管理员可管理标签页== 的设置时,仅群主和群管理员可以删除会话标签页;- 操作内部群时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/delete_tabs ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteTabsChatTabSample.java ; + */ + public DeleteTabsChatTabResp deleteTabs(DeleteTabsChatTabReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/im/v1/chats/:chat_id/chat_tabs/delete_tabs" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteTabsChatTabResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTabsChatTabResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/chat_tabs/delete_tabs" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除会话标签页,删除会话标签页。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 只允许删除类型为`doc`和`url`的会话标签页;- 在开启 ==仅群主和管理员可管理标签页== 的设置时,仅群主和群管理员可以删除会话标签页;- 操作内部群时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/delete_tabs ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteTabsChatTabSample.java ; + */ + public DeleteTabsChatTabResp deleteTabs(DeleteTabsChatTabReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/im/v1/chats/:chat_id/chat_tabs/delete_tabs" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteTabsChatTabResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTabsChatTabResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/chat_tabs/delete_tabs" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 拉取会话标签页,拉取会话标签页。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 操作内部群时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/list_tabs ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListTabsChatTabSample.java ; + */ + public ListTabsChatTabResp listTabs(ListTabsChatTabReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/chats/:chat_id/chat_tabs/list_tabs" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListTabsChatTabResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTabsChatTabResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/chat_tabs/list_tabs" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 拉取会话标签页,拉取会话标签页。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 操作内部群时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/list_tabs ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListTabsChatTabSample.java ; + */ + public ListTabsChatTabResp listTabs(ListTabsChatTabReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/chats/:chat_id/chat_tabs/list_tabs" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListTabsChatTabResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTabsChatTabResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/chat_tabs/list_tabs" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 会话标签页排序,会话标签页排序。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 消息标签页强制固定为第一顺位,不参与排序,但是请求体中必须包含该标签页的Tab ID;- 操作内部群时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/sort_tabs ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/SortTabsChatTabSample.java ; + */ + public SortTabsChatTabResp sortTabs(SortTabsChatTabReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/chats/:chat_id/chat_tabs/sort_tabs" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + SortTabsChatTabResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SortTabsChatTabResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/chat_tabs/sort_tabs" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 会话标签页排序,会话标签页排序。 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 消息标签页强制固定为第一顺位,不参与排序,但是请求体中必须包含该标签页的Tab ID;- 操作内部群时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/sort_tabs ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/SortTabsChatTabSample.java ; + */ + public SortTabsChatTabResp sortTabs(SortTabsChatTabReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/chats/:chat_id/chat_tabs/sort_tabs" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + SortTabsChatTabResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SortTabsChatTabResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/chat_tabs/sort_tabs" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新会话标签页,更新会话标签页 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 只允许更新类型为`doc`和`url`的会话标签页;- 更新doc类型时,操作者(access token对应的身份)需要拥有对应文档的权限;- 在开启 ==仅群主和管理员可管理标签页== 的设置时,仅群主和群管理员可以更新会话标签页;- 操作内部群时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/update_tabs ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateTabsChatTabSample.java ; + */ + public UpdateTabsChatTabResp updateTabs(UpdateTabsChatTabReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/chats/:chat_id/chat_tabs/update_tabs" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UpdateTabsChatTabResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateTabsChatTabResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/chat_tabs/update_tabs" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新会话标签页,更新会话标签页 + *

注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 只允许更新类型为`doc`和`url`的会话标签页;- 更新doc类型时,操作者(access token对应的身份)需要拥有对应文档的权限;- 在开启 ==仅群主和管理员可管理标签页== 的设置时,仅群主和群管理员可以更新会话标签页;- 操作内部群时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/update_tabs ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateTabsChatTabSample.java ; + */ + public UpdateTabsChatTabResp updateTabs(UpdateTabsChatTabReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/chats/:chat_id/chat_tabs/update_tabs" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UpdateTabsChatTabResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateTabsChatTabResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/chat_tabs/update_tabs" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatTopNotice.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatTopNotice.java new file mode 100644 index 000000000..fba6c5402 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/ChatTopNotice.java @@ -0,0 +1,177 @@ +// Code generated by lark suite 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 com.lark.oapi.service.im.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.im.v1.model.DeleteTopNoticeChatTopNoticeReq; +import com.lark.oapi.service.im.v1.model.DeleteTopNoticeChatTopNoticeResp; +import com.lark.oapi.service.im.v1.model.PutTopNoticeChatTopNoticeReq; +import com.lark.oapi.service.im.v1.model.PutTopNoticeChatTopNoticeResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ChatTopNotice { + private static final Logger log = LoggerFactory.getLogger(ChatTopNotice.class); + private final Config config; + + public ChatTopNotice(Config config) { + this.config = config; + } + + + /** + * 撤销群置顶,撤销会话中的置顶。 + *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人或授权用户必须在群组中;- 撤销内部群置顶时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-top_notice/delete_top_notice ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteTopNoticeChatTopNoticeSample.java ; + */ + public DeleteTopNoticeChatTopNoticeResp deleteTopNotice(DeleteTopNoticeChatTopNoticeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/chats/:chat_id/top_notice/delete_top_notice" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteTopNoticeChatTopNoticeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTopNoticeChatTopNoticeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/top_notice/delete_top_notice" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 撤销群置顶,撤销会话中的置顶。 + *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人或授权用户必须在群组中;- 撤销内部群置顶时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-top_notice/delete_top_notice ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteTopNoticeChatTopNoticeSample.java ; + */ + public DeleteTopNoticeChatTopNoticeResp deleteTopNotice(DeleteTopNoticeChatTopNoticeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/chats/:chat_id/top_notice/delete_top_notice" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteTopNoticeChatTopNoticeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTopNoticeChatTopNoticeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/top_notice/delete_top_notice" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新群置顶,更新会话中的群置顶信息,可以将群中的某一条消息,或者群公告置顶显示。 + *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人或授权用户必须在群组中;- 更新内部群置顶时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-top_notice/put_top_notice ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PutTopNoticeChatTopNoticeSample.java ; + */ + public PutTopNoticeChatTopNoticeResp putTopNotice(PutTopNoticeChatTopNoticeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/chats/:chat_id/top_notice/put_top_notice" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PutTopNoticeChatTopNoticeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PutTopNoticeChatTopNoticeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/top_notice/put_top_notice" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新群置顶,更新会话中的群置顶信息,可以将群中的某一条消息,或者群公告置顶显示。 + *

注意事项:; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人或授权用户必须在群组中;- 更新内部群置顶时,操作者须与群组在同一租户下 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-top_notice/put_top_notice ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PutTopNoticeChatTopNoticeSample.java ; + */ + public PutTopNoticeChatTopNoticeResp putTopNotice(PutTopNoticeChatTopNoticeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/chats/:chat_id/top_notice/put_top_notice" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PutTopNoticeChatTopNoticeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PutTopNoticeChatTopNoticeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/chats/:chat_id/top_notice/put_top_notice" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/File.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/File.java new file mode 100644 index 000000000..8fdf5e2c0 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/File.java @@ -0,0 +1,201 @@ +// Code generated by lark suite 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 com.lark.oapi.service.im.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.im.v1.model.CreateFileReq; +import com.lark.oapi.service.im.v1.model.CreateFileResp; +import com.lark.oapi.service.im.v1.model.GetFileReq; +import com.lark.oapi.service.im.v1.model.GetFileResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.ByteArrayOutputStream; +import java.nio.charset.StandardCharsets; + +public class File { + private static final Logger log = LoggerFactory.getLogger(File.class); + private final Config config; + + public File(Config config) { + this.config = config; + } + + + /** + * 上传文件,上传文件,可以上传视频,音频和常见的文件类型。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 文件大小不得超过30M,且不允许上传空文件 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/file/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateFileSample.java ; + */ + public CreateFileResp create(CreateFileReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/files" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/files" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 上传文件,上传文件,可以上传视频,音频和常见的文件类型。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 文件大小不得超过30M,且不允许上传空文件 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/file/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateFileSample.java ; + */ + public CreateFileResp create(CreateFileReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/files" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/files" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 下载文件,下载文件接口,只能下载应用自己上传的文件。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 只能下载机器人自己上传的文件;- 下载用户发送的资源,请使用[获取消息中的资源文件](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-resource/get)接口;- 下载的资源大小不能超过100M;- 如果需要Content-Disposition header,发起请求的时候需要在header中设置Content-Type为application/json ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/file/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetFileSample.java ; + */ + public GetFileResp get(GetFileReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/files/:file_key" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + if (httpResponse.getStatusCode() == 200) { + GetFileResp resp = new GetFileResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + GetFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/files/:file_key" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 下载文件,下载文件接口,只能下载应用自己上传的文件。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 只能下载机器人自己上传的文件;- 下载用户发送的资源,请使用[获取消息中的资源文件](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-resource/get)接口;- 下载的资源大小不能超过100M;- 如果需要Content-Disposition header,发起请求的时候需要在header中设置Content-Type为application/json ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/file/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetFileSample.java ; + */ + public GetFileResp get(GetFileReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/files/:file_key" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 下载请求,返回流 + if (httpResponse.getStatusCode() == 200) { + GetFileResp resp = new GetFileResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + GetFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/files/:file_key" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/Image.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/Image.java new file mode 100644 index 000000000..4fddbc7c0 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/Image.java @@ -0,0 +1,201 @@ +// Code generated by lark suite 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 com.lark.oapi.service.im.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.im.v1.model.CreateImageReq; +import com.lark.oapi.service.im.v1.model.CreateImageResp; +import com.lark.oapi.service.im.v1.model.GetImageReq; +import com.lark.oapi.service.im.v1.model.GetImageResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.ByteArrayOutputStream; +import java.nio.charset.StandardCharsets; + +public class Image { + private static final Logger log = LoggerFactory.getLogger(Image.class); + private final Config config; + + public Image(Config config) { + this.config = config; + } + + + /** + * 上传图片,上传图片接口,支持上传 JPEG、PNG、WEBP、GIF、TIFF、BMP、ICO格式图片。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 图片大小不得超过10M,且不支持上传大小为0的图片 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/image/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateImageSample.java ; + */ + public CreateImageResp create(CreateImageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/images" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateImageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/images" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 上传图片,上传图片接口,支持上传 JPEG、PNG、WEBP、GIF、TIFF、BMP、ICO格式图片。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 图片大小不得超过10M,且不支持上传大小为0的图片 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/image/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateImageSample.java ; + */ + public CreateImageResp create(CreateImageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/images" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateImageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/images" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 下载图片,下载图片资源,只能下载当前应用所上传且图片类型为message的图片。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 只能下载机器人自己上传且图片类型为message的图片,avatar类型暂不支持下载;- 下载用户发送的资源,请使用[获取消息中的资源文件](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-resource/get)接口 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/image/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetImageSample.java ; + */ + public GetImageResp get(GetImageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/images/:image_key" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + if (httpResponse.getStatusCode() == 200) { + GetImageResp resp = new GetImageResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + GetImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetImageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/images/:image_key" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 下载图片,下载图片资源,只能下载当前应用所上传且图片类型为message的图片。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 只能下载机器人自己上传且图片类型为message的图片,avatar类型暂不支持下载;- 下载用户发送的资源,请使用[获取消息中的资源文件](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-resource/get)接口 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/image/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetImageSample.java ; + */ + public GetImageResp get(GetImageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/images/:image_key" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 下载请求,返回流 + if (httpResponse.getStatusCode() == 200) { + GetImageResp resp = new GetImageResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + GetImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetImageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/images/:image_key" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/Message.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/Message.java new file mode 100644 index 000000000..b8e88140b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/Message.java @@ -0,0 +1,924 @@ +// Code generated by lark suite 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 com.lark.oapi.service.im.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.im.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Message { + private static final Logger log = LoggerFactory.getLogger(Message.class); + private final Config config; + + public Message(Config config) { + this.config = config; + } + + + /** + * 发送消息,给指定用户或者会话发送消息,支持文本、富文本、可交互的[消息卡片](https://open.feishu.cn/document/ukTMukTMukTM/uczM3QjL3MzN04yNzcDN)、群名片、个人名片、图片、视频、音频、文件、表情包。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 给用户发送消息,需要机器人对用户有[可用性](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability);- 给群组发送消息,需要机器人在群组中 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateMessageSample.java ; + */ + public CreateMessageResp create(CreateMessageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/messages" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 发送消息,给指定用户或者会话发送消息,支持文本、富文本、可交互的[消息卡片](https://open.feishu.cn/document/ukTMukTMukTM/uczM3QjL3MzN04yNzcDN)、群名片、个人名片、图片、视频、音频、文件、表情包。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 给用户发送消息,需要机器人对用户有[可用性](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability);- 给群组发送消息,需要机器人在群组中 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateMessageSample.java ; + */ + public CreateMessageResp create(CreateMessageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/messages" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 撤回消息,机器人撤回机器人自己发送的消息或群主撤回群内消息。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ,撤回消息时机器人仍需要在会话内;- 机器人可以撤回单聊和群组内,自己发送 且 发送时间不超过1天(24小时)的消息;- 若机器人要撤回群内他人发送的消息,则机器人必须是该群的群主、管理员 或者 创建者,且消息发送时间不超过1年;- 无法撤回通过「[批量发送消息](https://open.feishu.cn/document/ukTMukTMukTM/ucDO1EjL3gTNx4yN4UTM)」接口发送的消息 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteMessageSample.java ; + */ + public DeleteMessageResp delete(DeleteMessageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/im/v1/messages/:message_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 撤回消息,机器人撤回机器人自己发送的消息或群主撤回群内消息。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ,撤回消息时机器人仍需要在会话内;- 机器人可以撤回单聊和群组内,自己发送 且 发送时间不超过1天(24小时)的消息;- 若机器人要撤回群内他人发送的消息,则机器人必须是该群的群主、管理员 或者 创建者,且消息发送时间不超过1年;- 无法撤回通过「[批量发送消息](https://open.feishu.cn/document/ukTMukTMukTM/ucDO1EjL3gTNx4yN4UTM)」接口发送的消息 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteMessageSample.java ; + */ + public DeleteMessageResp delete(DeleteMessageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/im/v1/messages/:message_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,转发一条消息 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=forward&project=im&resource=message&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ForwardMessageSample.java ; + */ + public ForwardMessageResp forward(ForwardMessageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/messages/:message_id/forward" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ForwardMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ForwardMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/forward" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,转发一条消息 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=forward&project=im&resource=message&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ForwardMessageSample.java ; + */ + public ForwardMessageResp forward(ForwardMessageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/messages/:message_id/forward" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ForwardMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ForwardMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/forward" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取指定消息的内容,通过 message_id 查询消息内容。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 机器人必须在群组中 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetMessageSample.java ; + */ + public GetMessageResp get(GetMessageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/messages/:message_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取指定消息的内容,通过 message_id 查询消息内容。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 机器人必须在群组中 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetMessageSample.java ; + */ + public GetMessageResp get(GetMessageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/messages/:message_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取会话历史消息,获取会话(包括单聊、群组)的历史消息(聊天记录)。 + *

接口级别权限默认只能获取单聊(p2p)消息,如果需要获取群组(group)消息,应用还必须拥有 **==获取群组中所有消息==** 权限 ; + *

- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 获取消息时,机器人必须在群组中 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListMessageSample.java ; + */ + public ListMessageResp list(ListMessageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/messages" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取会话历史消息,获取会话(包括单聊、群组)的历史消息(聊天记录)。 + *

接口级别权限默认只能获取单聊(p2p)消息,如果需要获取群组(group)消息,应用还必须拥有 **==获取群组中所有消息==** 权限 ; + *

- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 获取消息时,机器人必须在群组中 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListMessageSample.java ; + */ + public ListMessageResp list(ListMessageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/messages" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,合并转发多条消息 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=merge_forward&project=im&resource=message&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/MergeForwardMessageSample.java ; + */ + public MergeForwardMessageResp mergeForward(MergeForwardMessageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/messages/merge_forward" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + MergeForwardMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MergeForwardMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/merge_forward" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,合并转发多条消息 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=merge_forward&project=im&resource=message&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/MergeForwardMessageSample.java ; + */ + public MergeForwardMessageResp mergeForward(MergeForwardMessageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/messages/merge_forward" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + MergeForwardMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MergeForwardMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/merge_forward" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新应用发送的消息,更新应用已发送的消息卡片内容。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 若以user_access_token更新消息,该操作用户必须是卡片消息的发送者;- 仅支持对所有人更新**未撤回**的[「共享卡片」](ukTMukTMukTM/uAjNwUjLwYDM14CM2ATN)消息,需在卡片的config属性中,显式声明 =="update_multi":true==。 ;- **不支持更新批量消息**;- 文本消息请求体最大不能超过150KB;卡片及富文本消息请求体最大不能超过30KB;- 仅支持修改14天内发送的消息;- 单条消息更新频控为**5QPS** ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PatchMessageSample.java ; + */ + public PatchMessageResp patch(PatchMessageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/im/v1/messages/:message_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新应用发送的消息,更新应用已发送的消息卡片内容。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 若以user_access_token更新消息,该操作用户必须是卡片消息的发送者;- 仅支持对所有人更新**未撤回**的[「共享卡片」](ukTMukTMukTM/uAjNwUjLwYDM14CM2ATN)消息,需在卡片的config属性中,显式声明 =="update_multi":true==。 ;- **不支持更新批量消息**;- 文本消息请求体最大不能超过150KB;卡片及富文本消息请求体最大不能超过30KB;- 仅支持修改14天内发送的消息;- 单条消息更新频控为**5QPS** ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PatchMessageSample.java ; + */ + public PatchMessageResp patch(PatchMessageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/im/v1/messages/:message_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询消息已读信息,查询消息的已读信息。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 只能查询机器人自己发送,且发送时间不超过7天的消息;- 查询消息已读信息时机器人仍需要在会话内;- 本接口不支持查询批量消息 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/read_users ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ReadUsersMessageSample.java ; + */ + public ReadUsersMessageResp readUsers(ReadUsersMessageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/messages/:message_id/read_users" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ReadUsersMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ReadUsersMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/read_users" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询消息已读信息,查询消息的已读信息。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 只能查询机器人自己发送,且发送时间不超过7天的消息;- 查询消息已读信息时机器人仍需要在会话内;- 本接口不支持查询批量消息 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/read_users ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ReadUsersMessageSample.java ; + */ + public ReadUsersMessageResp readUsers(ReadUsersMessageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/messages/:message_id/read_users" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ReadUsersMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ReadUsersMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/read_users" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 回复消息,回复指定消息,支持文本、富文本、卡片、群名片、个人名片、图片、视频、文件等多种消息类型。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 回复私聊消息,需要机器人对用户有[可用性](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability);- 回复群组消息,需要机器人在群中 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/reply ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ReplyMessageSample.java ; + */ + public ReplyMessageResp reply(ReplyMessageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/messages/:message_id/reply" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ReplyMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ReplyMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/reply" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 回复消息,回复指定消息,支持文本、富文本、卡片、群名片、个人名片、图片、视频、文件等多种消息类型。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 回复私聊消息,需要机器人对用户有[可用性](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability);- 回复群组消息,需要机器人在群中 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/reply ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ReplyMessageSample.java ; + */ + public ReplyMessageResp reply(ReplyMessageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/messages/:message_id/reply" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ReplyMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ReplyMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/reply" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,编辑已发送的消息内容,当前仅支持编辑文本和富文本消息。 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=im&resource=message&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateMessageSample.java ; + */ + public UpdateMessageResp update(UpdateMessageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/im/v1/messages/:message_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * ,编辑已发送的消息内容,当前仅支持编辑文本和富文本消息。 + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=im&resource=message&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateMessageSample.java ; + */ + public UpdateMessageResp update(UpdateMessageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/im/v1/messages/:message_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 发送应用内加急,对指定消息进行应用内加急。 + *

特别说明:;- 默认接口限流为50 QPS,请谨慎调用 ; + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 不支持加急批量消息;- 只能加急机器人自己发送的消息;- 加急时机器人需要在加急消息所在的群中;- 调用本接口需要用户已阅读加急的消息才可以继续加急(用户未读的加急上限为200条) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/urgent_app ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UrgentAppMessageSample.java ; + */ + public UrgentAppMessageResp urgentApp(UrgentAppMessageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/im/v1/messages/:message_id/urgent_app" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UrgentAppMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UrgentAppMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/urgent_app" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 发送应用内加急,对指定消息进行应用内加急。 + *

特别说明:;- 默认接口限流为50 QPS,请谨慎调用 ; + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 不支持加急批量消息;- 只能加急机器人自己发送的消息;- 加急时机器人需要在加急消息所在的群中;- 调用本接口需要用户已阅读加急的消息才可以继续加急(用户未读的加急上限为200条) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/urgent_app ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UrgentAppMessageSample.java ; + */ + public UrgentAppMessageResp urgentApp(UrgentAppMessageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/im/v1/messages/:message_id/urgent_app" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UrgentAppMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UrgentAppMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/urgent_app" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 发送电话加急,对指定消息进行应用内加急与电话加急。 + *

特别说明:;- 通过接口产生的电话加急将消耗企业的加急额度,请慎重调用;- 通过[租户管理后台](https://admin.feishu.cn/)-费用中心-短信/电话加急 可以查看当前额度;- 默认接口限流为50 QPS,请谨慎调用 ; + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 只能加急机器人自己发送的消息;- 加急时机器人需要在加急消息所在的群组中;- 需要用户阅读已加急的消息才可以继续加急(用户未读的加急上限为200条) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/urgent_phone ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UrgentPhoneMessageSample.java ; + */ + public UrgentPhoneMessageResp urgentPhone(UrgentPhoneMessageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/im/v1/messages/:message_id/urgent_phone" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UrgentPhoneMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UrgentPhoneMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/urgent_phone" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 发送电话加急,对指定消息进行应用内加急与电话加急。 + *

特别说明:;- 通过接口产生的电话加急将消耗企业的加急额度,请慎重调用;- 通过[租户管理后台](https://admin.feishu.cn/)-费用中心-短信/电话加急 可以查看当前额度;- 默认接口限流为50 QPS,请谨慎调用 ; + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 只能加急机器人自己发送的消息;- 加急时机器人需要在加急消息所在的群组中;- 需要用户阅读已加急的消息才可以继续加急(用户未读的加急上限为200条) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/urgent_phone ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UrgentPhoneMessageSample.java ; + */ + public UrgentPhoneMessageResp urgentPhone(UrgentPhoneMessageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/im/v1/messages/:message_id/urgent_phone" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UrgentPhoneMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UrgentPhoneMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/urgent_phone" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 发送短信加急,对指定消息进行应用内加急与短信加急。 + *

特别说明:;- 通过接口产生的短信加急将消耗企业的加急额度,请慎重调用;- 通过[租户管理后台](https://admin.feishu.cn/)-费用中心-短信/电话加急 可以查看当前额度;- 默认接口限流为50 QPS,请谨慎调用 ; + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 只能加急机器人自己发送的消息;- 加急时机器人仍需要在加急消息所在的群组中;- 调用本接口需要用户已阅读加急的消息才可以继续加急(用户未读的加急上限为200条) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/urgent_sms ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UrgentSmsMessageSample.java ; + */ + public UrgentSmsMessageResp urgentSms(UrgentSmsMessageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/im/v1/messages/:message_id/urgent_sms" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UrgentSmsMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UrgentSmsMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/urgent_sms" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 发送短信加急,对指定消息进行应用内加急与短信加急。 + *

特别说明:;- 通过接口产生的短信加急将消耗企业的加急额度,请慎重调用;- 通过[租户管理后台](https://admin.feishu.cn/)-费用中心-短信/电话加急 可以查看当前额度;- 默认接口限流为50 QPS,请谨慎调用 ; + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 只能加急机器人自己发送的消息;- 加急时机器人仍需要在加急消息所在的群组中;- 调用本接口需要用户已阅读加急的消息才可以继续加急(用户未读的加急上限为200条) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/urgent_sms ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UrgentSmsMessageSample.java ; + */ + public UrgentSmsMessageResp urgentSms(UrgentSmsMessageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/im/v1/messages/:message_id/urgent_sms" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UrgentSmsMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UrgentSmsMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/urgent_sms" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/MessageReaction.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/MessageReaction.java new file mode 100644 index 000000000..96da1a5ae --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/MessageReaction.java @@ -0,0 +1,242 @@ +// Code generated by lark suite 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 com.lark.oapi.service.im.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.im.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class MessageReaction { + private static final Logger log = LoggerFactory.getLogger(MessageReaction.class); + private final Config config; + + public MessageReaction(Config config) { + this.config = config; + } + + + /** + * 添加消息表情回复,给指定消息添加指定类型的表情回复(reaction即表情回复,本文档统一用“reaction”代称)。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 待添加reaction的消息要真实存在,不能被撤回;- 给消息添加reaction,需要reaction的发送方(机器人或者用户)在消息所在的会话内 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-reaction/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateMessageReactionSample.java ; + */ + public CreateMessageReactionResp create(CreateMessageReactionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/messages/:message_id/reactions" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateMessageReactionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMessageReactionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/reactions" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 添加消息表情回复,给指定消息添加指定类型的表情回复(reaction即表情回复,本文档统一用“reaction”代称)。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 待添加reaction的消息要真实存在,不能被撤回;- 给消息添加reaction,需要reaction的发送方(机器人或者用户)在消息所在的会话内 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-reaction/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateMessageReactionSample.java ; + */ + public CreateMessageReactionResp create(CreateMessageReactionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/messages/:message_id/reactions" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateMessageReactionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMessageReactionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/reactions" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除消息表情回复,删除指定消息的表情回复(reaction即表情回复,本文档统一用“reaction”代称)。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 只能删除真实存在的reaction,并且删除reaction请求的操作者必须是reaction的原始添加者 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-reaction/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteMessageReactionSample.java ; + */ + public DeleteMessageReactionResp delete(DeleteMessageReactionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/im/v1/messages/:message_id/reactions/:reaction_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteMessageReactionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteMessageReactionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/reactions/:reaction_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除消息表情回复,删除指定消息的表情回复(reaction即表情回复,本文档统一用“reaction”代称)。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 只能删除真实存在的reaction,并且删除reaction请求的操作者必须是reaction的原始添加者 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-reaction/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteMessageReactionSample.java ; + */ + public DeleteMessageReactionResp delete(DeleteMessageReactionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/im/v1/messages/:message_id/reactions/:reaction_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteMessageReactionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteMessageReactionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/reactions/:reaction_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取消息表情回复,获取指定消息的特定类型表情回复列表(reaction即表情回复,本文档统一用“reaction”代称)。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 待获取reaction信息的消息要真实存在,不能被撤回;- 获取消息的reaction,需要request的授权主体(机器人或者用户)在消息所在的会话内 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-reaction/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListMessageReactionSample.java ; + */ + public ListMessageReactionResp list(ListMessageReactionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/messages/:message_id/reactions" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListMessageReactionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMessageReactionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/reactions" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取消息表情回复,获取指定消息的特定类型表情回复列表(reaction即表情回复,本文档统一用“reaction”代称)。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 待获取reaction信息的消息要真实存在,不能被撤回;- 获取消息的reaction,需要request的授权主体(机器人或者用户)在消息所在的会话内 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-reaction/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListMessageReactionSample.java ; + */ + public ListMessageReactionResp list(ListMessageReactionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/messages/:message_id/reactions" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListMessageReactionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMessageReactionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/reactions" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/MessageResource.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/MessageResource.java new file mode 100644 index 000000000..103e314ba --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/MessageResource.java @@ -0,0 +1,129 @@ +// Code generated by lark suite 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 com.lark.oapi.service.im.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.im.v1.model.GetMessageResourceReq; +import com.lark.oapi.service.im.v1.model.GetMessageResourceResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.ByteArrayOutputStream; +import java.nio.charset.StandardCharsets; + +public class MessageResource { + private static final Logger log = LoggerFactory.getLogger(MessageResource.class); + private final Config config; + + public MessageResource(Config config) { + this.config = config; + } + + + /** + * 获取消息中的资源文件,获取消息中的资源文件,包括音频,视频,图片和文件,**暂不支持表情包资源下载**。当前仅支持 100M 以内的资源文件的下载。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人和消息需要在同一会话中;- 暂不支持获取合并转发消息中的子消息的资源文件 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-resource/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetMessageResourceSample.java ; + */ + public GetMessageResourceResp get(GetMessageResourceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/messages/:message_id/resources/:file_key" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + if (httpResponse.getStatusCode() == 200) { + GetMessageResourceResp resp = new GetMessageResourceResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + GetMessageResourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMessageResourceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/resources/:file_key" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取消息中的资源文件,获取消息中的资源文件,包括音频,视频,图片和文件,**暂不支持表情包资源下载**。当前仅支持 100M 以内的资源文件的下载。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人和消息需要在同一会话中;- 暂不支持获取合并转发消息中的子消息的资源文件 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-resource/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetMessageResourceSample.java ; + */ + public GetMessageResourceResp get(GetMessageResourceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/messages/:message_id/resources/:file_key" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 下载请求,返回流 + if (httpResponse.getStatusCode() == 200) { + GetMessageResourceResp resp = new GetMessageResourceResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + GetMessageResourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMessageResourceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/messages/:message_id/resources/:file_key" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/Pin.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/Pin.java new file mode 100644 index 000000000..5b8824f07 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/im/v1/resource/Pin.java @@ -0,0 +1,242 @@ +// Code generated by lark suite 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 com.lark.oapi.service.im.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.im.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Pin { + private static final Logger log = LoggerFactory.getLogger(Pin.class); + private final Config config; + + public Pin(Config config) { + this.config = config; + } + + + /** + * Pin消息,Pin一条指定的消息。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- Pin消息时,机器人必须在对应的群组中;- 若消息已经被Pin,返回该Pin的操作信息;- 不能Pin一条对操作者不可见的消息;- 对同一条消息的Pin操作不能超过==5 QPS== ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/pin/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreatePinSample.java ; + */ + public CreatePinResp create(CreatePinReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/pins" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreatePinResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePinResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/pins" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * Pin消息,Pin一条指定的消息。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- Pin消息时,机器人必须在对应的群组中;- 若消息已经被Pin,返回该Pin的操作信息;- 不能Pin一条对操作者不可见的消息;- 对同一条消息的Pin操作不能超过==5 QPS== ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/pin/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreatePinSample.java ; + */ + public CreatePinResp create(CreatePinReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/im/v1/pins" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreatePinResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePinResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/pins" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 移除Pin消息,移除一条指定消息的Pin。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 移除Pin消息时,机器人必须在对应的群组中;- 若消息未被Pin或已被撤回,返回成功信息;- 不能移除一条对操作者不可见的Pin消息;- 对同一条消息移除Pin的操作不能超过==5 QPS== ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/pin/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeletePinSample.java ; + */ + public DeletePinResp delete(DeletePinReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/im/v1/pins/:message_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeletePinResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePinResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/pins/:message_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 移除Pin消息,移除一条指定消息的Pin。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 移除Pin消息时,机器人必须在对应的群组中;- 若消息未被Pin或已被撤回,返回成功信息;- 不能移除一条对操作者不可见的Pin消息;- 对同一条消息移除Pin的操作不能超过==5 QPS== ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/pin/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeletePinSample.java ; + */ + public DeletePinResp delete(DeletePinReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/im/v1/pins/:message_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeletePinResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePinResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/pins/:message_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取群内Pin消息,获取所在群内指定时间范围内的所有Pin消息。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 获取Pin消息时,机器人必须在群组中;- 获取的Pin消息按Pin的创建时间降序排列;- 接口默认限流为==50 QPS== ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/pin/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListPinSample.java ; + */ + public ListPinResp list(ListPinReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/pins" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListPinResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPinResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/pins" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取群内Pin消息,获取所在群内指定时间范围内的所有Pin消息。 + *

注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 获取Pin消息时,机器人必须在群组中;- 获取的Pin消息按Pin的创建时间降序排列;- 接口默认限流为==50 QPS== ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/pin/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListPinSample.java ; + */ + public ListPinResp list(ListPinReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/im/v1/pins" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListPinResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPinResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/im/v1/pins" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/LingoService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/LingoService.java new file mode 100644 index 000000000..d9c7449a5 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/LingoService.java @@ -0,0 +1,59 @@ +// Code generated by lark suite 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 com.lark.oapi.service.lingo; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.lingo.v1.V1; +import com.lark.oapi.service.lingo.v1.resource.*; + +public class LingoService { + private final V1 v1; + private final Classification classification; // classification + private final Draft draft; // draft + private final Entity entity; // entity + private final File file; // file + private final Repo repo; // repo + + public LingoService(Config config) { + this.v1 = new V1(config); + this.classification = new Classification(config); + this.draft = new Draft(config); + this.entity = new Entity(config); + this.file = new File(config); + this.repo = new Repo(config); + } + + public V1 v1() { + return v1; + } + + public Classification classification() { + return classification; + } + + public Draft draft() { + return draft; + } + + public Entity entity() { + return entity; + } + + public File file() { + return file; + } + + public Repo repo() { + return repo; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/LingoService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/LingoService.java deleted file mode 100644 index 15d2114b5..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/LingoService.java +++ /dev/null @@ -1,1011 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.lingo.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.lingo.v1.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.ByteArrayOutputStream; -import java.nio.charset.StandardCharsets; - -public class LingoService { - private static final Logger log = LoggerFactory.getLogger(LingoService.class); - private final Classification classification; // classification - private final Draft draft; // draft - private final Entity entity; // entity - private final File file; // file - private final Repo repo; // repo - - public LingoService(Config config) { - this.classification = new Classification(config); - this.draft = new Draft(config); - this.entity = new Entity(config); - this.file = new File(config); - this.repo = new Repo(config); - } - - /** - * classification - * - * @return - */ - public Classification classification() { - return classification; - } - - /** - * draft - * - * @return - */ - public Draft draft() { - return draft; - } - - /** - * entity - * - * @return - */ - public Entity entity() { - return entity; - } - - /** - * file - * - * @return - */ - public File file() { - return file; - } - - /** - * repo - * - * @return - */ - public Repo repo() { - return repo; - } - - public static class Classification { - private final Config config; - - public Classification(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=lingo&resource=classification&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/ListClassificationSample.java ; - */ - public ListClassificationResp list(ListClassificationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/lingo/v1/classifications" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListClassificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListClassificationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/classifications" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=lingo&resource=classification&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/ListClassificationSample.java ; - */ - public ListClassificationResp list(ListClassificationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/lingo/v1/classifications" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListClassificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListClassificationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/classifications" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Draft { - private final Config config; - - public Draft(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=lingo&resource=draft&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/CreateDraftSample.java ; - */ - public CreateDraftResp create(CreateDraftReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/lingo/v1/drafts" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateDraftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDraftResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/drafts" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=lingo&resource=draft&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/CreateDraftSample.java ; - */ - public CreateDraftResp create(CreateDraftReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/lingo/v1/drafts" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateDraftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDraftResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/drafts" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=lingo&resource=draft&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/UpdateDraftSample.java ; - */ - public UpdateDraftResp update(UpdateDraftReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/lingo/v1/drafts/:draft_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateDraftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateDraftResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/drafts/:draft_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=lingo&resource=draft&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/UpdateDraftSample.java ; - */ - public UpdateDraftResp update(UpdateDraftReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/lingo/v1/drafts/:draft_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateDraftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateDraftResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/drafts/:draft_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Entity { - private final Config config; - - public Entity(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=lingo&resource=entity&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/CreateEntitySample.java ; - */ - public CreateEntityResp create(CreateEntityReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/lingo/v1/entities" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=lingo&resource=entity&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/CreateEntitySample.java ; - */ - public CreateEntityResp create(CreateEntityReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/lingo/v1/entities" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=lingo&resource=entity&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/GetEntitySample.java ; - */ - public GetEntityResp get(GetEntityReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/lingo/v1/entities/:entity_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities/:entity_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=lingo&resource=entity&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/GetEntitySample.java ; - */ - public GetEntityResp get(GetEntityReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/lingo/v1/entities/:entity_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities/:entity_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=highlight&project=lingo&resource=entity&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/HighlightEntitySample.java ; - */ - public HighlightEntityResp highlight(HighlightEntityReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/lingo/v1/entities/highlight" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - HighlightEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, HighlightEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities/highlight" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=highlight&project=lingo&resource=entity&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/HighlightEntitySample.java ; - */ - public HighlightEntityResp highlight(HighlightEntityReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/lingo/v1/entities/highlight" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - HighlightEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, HighlightEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities/highlight" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=lingo&resource=entity&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/ListEntitySample.java ; - */ - public ListEntityResp list(ListEntityReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/lingo/v1/entities" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=lingo&resource=entity&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/ListEntitySample.java ; - */ - public ListEntityResp list(ListEntityReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/lingo/v1/entities" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=match&project=lingo&resource=entity&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/MatchEntitySample.java ; - */ - public MatchEntityResp match(MatchEntityReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/lingo/v1/entities/match" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - MatchEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MatchEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities/match" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=match&project=lingo&resource=entity&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/MatchEntitySample.java ; - */ - public MatchEntityResp match(MatchEntityReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/lingo/v1/entities/match" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - MatchEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MatchEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities/match" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=lingo&resource=entity&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/SearchEntitySample.java ; - */ - public SearchEntityResp search(SearchEntityReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/lingo/v1/entities/search" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - SearchEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=lingo&resource=entity&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/SearchEntitySample.java ; - */ - public SearchEntityResp search(SearchEntityReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/lingo/v1/entities/search" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - SearchEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=lingo&resource=entity&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/UpdateEntitySample.java ; - */ - public UpdateEntityResp update(UpdateEntityReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/lingo/v1/entities/:entity_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UpdateEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities/:entity_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=lingo&resource=entity&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/UpdateEntitySample.java ; - */ - public UpdateEntityResp update(UpdateEntityReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/lingo/v1/entities/:entity_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UpdateEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateEntityResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities/:entity_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class File { - private final Config config; - - public File(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=download&project=lingo&resource=file&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/DownloadFileSample.java ; - */ - public DownloadFileResp download(DownloadFileReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/lingo/v1/files/:file_token/download" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - if (httpResponse.getStatusCode() == 200) { - DownloadFileResp resp = new DownloadFileResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - DownloadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/files/:file_token/download" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=download&project=lingo&resource=file&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/DownloadFileSample.java ; - */ - public DownloadFileResp download(DownloadFileReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/lingo/v1/files/:file_token/download" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 下载请求,返回流 - if (httpResponse.getStatusCode() == 200) { - DownloadFileResp resp = new DownloadFileResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - DownloadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/files/:file_token/download" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=upload&project=lingo&resource=file&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/UploadFileSample.java ; - */ - public UploadFileResp upload(UploadFileReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/lingo/v1/files/upload" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UploadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/files/upload" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=upload&project=lingo&resource=file&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/UploadFileSample.java ; - */ - public UploadFileResp upload(UploadFileReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/lingo/v1/files/upload" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UploadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadFileResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/files/upload" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Repo { - private final Config config; - - public Repo(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=lingo&resource=repo&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/ListRepoSample.java ; - */ - public ListRepoResp list(RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/lingo/v1/repos" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , null); - - // 反序列化 - ListRepoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListRepoResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/repos" - , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=lingo&resource=repo&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/ListRepoSample.java ; - */ - public ListRepoResp list() throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/lingo/v1/repos" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , null); - - // 反序列化 - ListRepoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListRepoResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/repos" - , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/V1.java new file mode 100644 index 000000000..fcf01d115 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/V1.java @@ -0,0 +1,53 @@ +// Code generated by lark suite 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 com.lark.oapi.service.lingo.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.lingo.v1.resource.*; + +public class V1 { + private final Classification classification; // classification + private final Draft draft; // draft + private final Entity entity; // entity + private final File file; // file + private final Repo repo; // repo + + public V1(Config config) { + this.classification = new Classification(config); + this.draft = new Draft(config); + this.entity = new Entity(config); + this.file = new File(config); + this.repo = new Repo(config); + } + + public Classification classification() { + return classification; + } + + public Draft draft() { + return draft; + } + + public Entity entity() { + return entity; + } + + public File file() { + return file; + } + + public Repo repo() { + return repo; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/model/DeleteEntityReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/model/DeleteEntityReq.java new file mode 100644 index 000000000..b03821dae --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/model/DeleteEntityReq.java @@ -0,0 +1,138 @@ +// Code generated by lark suite 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 com.lark.oapi.service.lingo.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class DeleteEntityReq { + /** + * 数据提供方(使用时需要将路径中的词条 ID 固定为:enterprise_0,且提供 provider 和 outer_id) + *

示例值:星云 + */ + @Query + @SerializedName("provider") + private String provider; + /** + * 外部唯一 id(使用时需要将路径中的词条 ID 固定为:enterprise_0,且提供 provider 和 outer_id) + *

示例值:123aaa + */ + @Query + @SerializedName("outer_id") + private String outerId; + /** + * 词条 id + *

示例值:enterprise_43742132363 + */ + @Path + @SerializedName("entity_id") + private String entityId; + + // builder 开始 + public DeleteEntityReq() { + } + + public DeleteEntityReq(Builder builder) { + /** + * 数据提供方(使用时需要将路径中的词条 ID 固定为:enterprise_0,且提供 provider 和 outer_id) + *

示例值:星云 + */ + this.provider = builder.provider; + /** + * 外部唯一 id(使用时需要将路径中的词条 ID 固定为:enterprise_0,且提供 provider 和 outer_id) + *

示例值:123aaa + */ + this.outerId = builder.outerId; + /** + * 词条 id + *

示例值:enterprise_43742132363 + */ + this.entityId = builder.entityId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getProvider() { + return this.provider; + } + + public void setProvider(String provider) { + this.provider = provider; + } + + public String getOuterId() { + return this.outerId; + } + + public void setOuterId(String outerId) { + this.outerId = outerId; + } + + public String getEntityId() { + return this.entityId; + } + + public void setEntityId(String entityId) { + this.entityId = entityId; + } + + public static class Builder { + private String provider; // 数据提供方(使用时需要将路径中的词条 ID 固定为:enterprise_0,且提供 provider 和 outer_id) + private String outerId; // 外部唯一 id(使用时需要将路径中的词条 ID 固定为:enterprise_0,且提供 provider 和 outer_id) + private String entityId; // 词条 id + + /** + * 数据提供方(使用时需要将路径中的词条 ID 固定为:enterprise_0,且提供 provider 和 outer_id) + *

示例值:星云 + * + * @param provider + * @return + */ + public Builder provider(String provider) { + this.provider = provider; + return this; + } + + /** + * 外部唯一 id(使用时需要将路径中的词条 ID 固定为:enterprise_0,且提供 provider 和 outer_id) + *

示例值:123aaa + * + * @param outerId + * @return + */ + public Builder outerId(String outerId) { + this.outerId = outerId; + return this; + } + + /** + * 词条 id + *

示例值:enterprise_43742132363 + * + * @param entityId + * @return + */ + public Builder entityId(String entityId) { + this.entityId = entityId; + return this; + } + + public DeleteEntityReq build() { + return new DeleteEntityReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/model/DeleteEntityResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/model/DeleteEntityResp.java new file mode 100644 index 000000000..a6a8f8340 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/model/DeleteEntityResp.java @@ -0,0 +1,20 @@ +// Code generated by lark suite 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 com.lark.oapi.service.lingo.v1.model; + +import com.lark.oapi.core.response.BaseResponse; +import com.lark.oapi.core.response.EmptyData; + +public class DeleteEntityResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/resource/Classification.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/resource/Classification.java new file mode 100644 index 000000000..b88a187cb --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/resource/Classification.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.lingo.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.lingo.v1.model.ListClassificationReq; +import com.lark.oapi.service.lingo.v1.model.ListClassificationResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Classification { + private static final Logger log = LoggerFactory.getLogger(Classification.class); + private final Config config; + + public Classification(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=lingo&resource=classification&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/ListClassificationSample.java ; + */ + public ListClassificationResp list(ListClassificationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/lingo/v1/classifications" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListClassificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListClassificationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/classifications" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=lingo&resource=classification&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/ListClassificationSample.java ; + */ + public ListClassificationResp list(ListClassificationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/lingo/v1/classifications" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListClassificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListClassificationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/classifications" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/resource/Draft.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/resource/Draft.java new file mode 100644 index 000000000..1a603c414 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/resource/Draft.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.lingo.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.lingo.v1.model.CreateDraftReq; +import com.lark.oapi.service.lingo.v1.model.CreateDraftResp; +import com.lark.oapi.service.lingo.v1.model.UpdateDraftReq; +import com.lark.oapi.service.lingo.v1.model.UpdateDraftResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Draft { + private static final Logger log = LoggerFactory.getLogger(Draft.class); + private final Config config; + + public Draft(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=lingo&resource=draft&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/CreateDraftSample.java ; + */ + public CreateDraftResp create(CreateDraftReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/lingo/v1/drafts" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateDraftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDraftResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/drafts" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=lingo&resource=draft&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/CreateDraftSample.java ; + */ + public CreateDraftResp create(CreateDraftReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/lingo/v1/drafts" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateDraftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDraftResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/drafts" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=lingo&resource=draft&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/UpdateDraftSample.java ; + */ + public UpdateDraftResp update(UpdateDraftReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/lingo/v1/drafts/:draft_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateDraftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateDraftResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/drafts/:draft_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=lingo&resource=draft&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/UpdateDraftSample.java ; + */ + public UpdateDraftResp update(UpdateDraftReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/lingo/v1/drafts/:draft_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateDraftResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateDraftResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/drafts/:draft_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/resource/Entity.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/resource/Entity.java new file mode 100644 index 000000000..3b931b55b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/resource/Entity.java @@ -0,0 +1,566 @@ +// Code generated by lark suite 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 com.lark.oapi.service.lingo.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.lingo.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Entity { + private static final Logger log = LoggerFactory.getLogger(Entity.class); + private final Config config; + + public Entity(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=lingo&resource=entity&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/CreateEntitySample.java ; + */ + public CreateEntityResp create(CreateEntityReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/lingo/v1/entities" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=lingo&resource=entity&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/CreateEntitySample.java ; + */ + public CreateEntityResp create(CreateEntityReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/lingo/v1/entities" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=lingo&resource=entity&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/DeleteEntitySample.java ; + */ + public DeleteEntityResp delete(DeleteEntityReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/lingo/v1/entities/:entity_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities/:entity_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=lingo&resource=entity&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/DeleteEntitySample.java ; + */ + public DeleteEntityResp delete(DeleteEntityReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/lingo/v1/entities/:entity_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities/:entity_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=lingo&resource=entity&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/GetEntitySample.java ; + */ + public GetEntityResp get(GetEntityReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/lingo/v1/entities/:entity_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities/:entity_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=lingo&resource=entity&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/GetEntitySample.java ; + */ + public GetEntityResp get(GetEntityReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/lingo/v1/entities/:entity_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities/:entity_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=highlight&project=lingo&resource=entity&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/HighlightEntitySample.java ; + */ + public HighlightEntityResp highlight(HighlightEntityReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/lingo/v1/entities/highlight" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + HighlightEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, HighlightEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities/highlight" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=highlight&project=lingo&resource=entity&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/HighlightEntitySample.java ; + */ + public HighlightEntityResp highlight(HighlightEntityReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/lingo/v1/entities/highlight" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + HighlightEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, HighlightEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities/highlight" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=lingo&resource=entity&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/ListEntitySample.java ; + */ + public ListEntityResp list(ListEntityReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/lingo/v1/entities" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=lingo&resource=entity&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/ListEntitySample.java ; + */ + public ListEntityResp list(ListEntityReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/lingo/v1/entities" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=match&project=lingo&resource=entity&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/MatchEntitySample.java ; + */ + public MatchEntityResp match(MatchEntityReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/lingo/v1/entities/match" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + MatchEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MatchEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities/match" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=match&project=lingo&resource=entity&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/MatchEntitySample.java ; + */ + public MatchEntityResp match(MatchEntityReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/lingo/v1/entities/match" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + MatchEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MatchEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities/match" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=lingo&resource=entity&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/SearchEntitySample.java ; + */ + public SearchEntityResp search(SearchEntityReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/lingo/v1/entities/search" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + SearchEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=lingo&resource=entity&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/SearchEntitySample.java ; + */ + public SearchEntityResp search(SearchEntityReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/lingo/v1/entities/search" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + SearchEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=lingo&resource=entity&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/UpdateEntitySample.java ; + */ + public UpdateEntityResp update(UpdateEntityReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/lingo/v1/entities/:entity_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UpdateEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities/:entity_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=lingo&resource=entity&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/UpdateEntitySample.java ; + */ + public UpdateEntityResp update(UpdateEntityReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/lingo/v1/entities/:entity_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UpdateEntityResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateEntityResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/entities/:entity_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/resource/File.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/resource/File.java new file mode 100644 index 000000000..6761f04e0 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/resource/File.java @@ -0,0 +1,197 @@ +// Code generated by lark suite 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 com.lark.oapi.service.lingo.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.lingo.v1.model.DownloadFileReq; +import com.lark.oapi.service.lingo.v1.model.DownloadFileResp; +import com.lark.oapi.service.lingo.v1.model.UploadFileReq; +import com.lark.oapi.service.lingo.v1.model.UploadFileResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.ByteArrayOutputStream; +import java.nio.charset.StandardCharsets; + +public class File { + private static final Logger log = LoggerFactory.getLogger(File.class); + private final Config config; + + public File(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=download&project=lingo&resource=file&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/DownloadFileSample.java ; + */ + public DownloadFileResp download(DownloadFileReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/lingo/v1/files/:file_token/download" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + if (httpResponse.getStatusCode() == 200) { + DownloadFileResp resp = new DownloadFileResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + DownloadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/files/:file_token/download" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=download&project=lingo&resource=file&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/DownloadFileSample.java ; + */ + public DownloadFileResp download(DownloadFileReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/lingo/v1/files/:file_token/download" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 下载请求,返回流 + if (httpResponse.getStatusCode() == 200) { + DownloadFileResp resp = new DownloadFileResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + DownloadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/files/:file_token/download" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=upload&project=lingo&resource=file&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/UploadFileSample.java ; + */ + public UploadFileResp upload(UploadFileReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/lingo/v1/files/upload" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UploadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/files/upload" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=upload&project=lingo&resource=file&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/UploadFileSample.java ; + */ + public UploadFileResp upload(UploadFileReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/lingo/v1/files/upload" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UploadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadFileResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/files/upload" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/resource/Repo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/resource/Repo.java new file mode 100644 index 000000000..a905d37d4 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/lingo/v1/resource/Repo.java @@ -0,0 +1,102 @@ +// Code generated by lark suite 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 com.lark.oapi.service.lingo.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.lingo.v1.model.ListRepoResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Repo { + private static final Logger log = LoggerFactory.getLogger(Repo.class); + private final Config config; + + public Repo(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=lingo&resource=repo&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/ListRepoSample.java ; + */ + public ListRepoResp list(RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/lingo/v1/repos" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , null); + + // 反序列化 + ListRepoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListRepoResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/repos" + , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=lingo&resource=repo&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/ListRepoSample.java ; + */ + public ListRepoResp list() throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/lingo/v1/repos" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , null); + + // 反序列化 + ListRepoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListRepoResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/lingo/v1/repos" + , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/MailService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/MailService.java new file mode 100644 index 000000000..82122a995 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/MailService.java @@ -0,0 +1,95 @@ +// Code generated by lark suite 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 com.lark.oapi.service.mail; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.mail.v1.V1; +import com.lark.oapi.service.mail.v1.resource.*; + +public class MailService { + private final V1 v1; + private final Mailgroup mailgroup; // 邮件组 + private final MailgroupAlias mailgroupAlias; // 邮件组别名 + private final MailgroupManager mailgroupManager; // 邮件组管理员 + private final MailgroupMember mailgroupMember; // 邮件组成员 + private final MailgroupPermissionMember mailgroupPermissionMember; // 邮件组权限成员 + private final PublicMailbox publicMailbox; // 公共邮箱 + private final PublicMailboxAlias publicMailboxAlias; // 公共邮箱别名 + private final PublicMailboxMember publicMailboxMember; // 公共邮箱成员 + private final User user; // 邮箱地址 + private final UserMailbox userMailbox; // 用户邮箱 + private final UserMailboxAlias userMailboxAlias; // 用户邮箱别名 + + public MailService(Config config) { + this.v1 = new V1(config); + this.mailgroup = new Mailgroup(config); + this.mailgroupAlias = new MailgroupAlias(config); + this.mailgroupManager = new MailgroupManager(config); + this.mailgroupMember = new MailgroupMember(config); + this.mailgroupPermissionMember = new MailgroupPermissionMember(config); + this.publicMailbox = new PublicMailbox(config); + this.publicMailboxAlias = new PublicMailboxAlias(config); + this.publicMailboxMember = new PublicMailboxMember(config); + this.user = new User(config); + this.userMailbox = new UserMailbox(config); + this.userMailboxAlias = new UserMailboxAlias(config); + } + + public V1 v1() { + return v1; + } + + public Mailgroup mailgroup() { + return mailgroup; + } + + public MailgroupAlias mailgroupAlias() { + return mailgroupAlias; + } + + public MailgroupManager mailgroupManager() { + return mailgroupManager; + } + + public MailgroupMember mailgroupMember() { + return mailgroupMember; + } + + public MailgroupPermissionMember mailgroupPermissionMember() { + return mailgroupPermissionMember; + } + + public PublicMailbox publicMailbox() { + return publicMailbox; + } + + public PublicMailboxAlias publicMailboxAlias() { + return publicMailboxAlias; + } + + public PublicMailboxMember publicMailboxMember() { + return publicMailboxMember; + } + + public User user() { + return user; + } + + public UserMailbox userMailbox() { + return userMailbox; + } + + public UserMailboxAlias userMailboxAlias() { + return userMailboxAlias; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/MailService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/MailService.java deleted file mode 100644 index 81f7d4721..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/MailService.java +++ /dev/null @@ -1,3215 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.mail.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.mail.v1.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class MailService { - private static final Logger log = LoggerFactory.getLogger(MailService.class); - private final Mailgroup mailgroup; // 邮件组 - private final MailgroupAlias mailgroupAlias; // 邮件组别名 - private final MailgroupManager mailgroupManager; // 邮件组管理员 - private final MailgroupMember mailgroupMember; // 邮件组成员 - private final MailgroupPermissionMember mailgroupPermissionMember; // 邮件组权限成员 - private final PublicMailbox publicMailbox; // 公共邮箱 - private final PublicMailboxAlias publicMailboxAlias; // 公共邮箱别名 - private final PublicMailboxMember publicMailboxMember; // 公共邮箱成员 - private final User user; // 邮箱地址 - private final UserMailbox userMailbox; // 用户邮箱 - private final UserMailboxAlias userMailboxAlias; // 用户邮箱别名 - - public MailService(Config config) { - this.mailgroup = new Mailgroup(config); - this.mailgroupAlias = new MailgroupAlias(config); - this.mailgroupManager = new MailgroupManager(config); - this.mailgroupMember = new MailgroupMember(config); - this.mailgroupPermissionMember = new MailgroupPermissionMember(config); - this.publicMailbox = new PublicMailbox(config); - this.publicMailboxAlias = new PublicMailboxAlias(config); - this.publicMailboxMember = new PublicMailboxMember(config); - this.user = new User(config); - this.userMailbox = new UserMailbox(config); - this.userMailboxAlias = new UserMailboxAlias(config); - } - - /** - * 邮件组 - * - * @return - */ - public Mailgroup mailgroup() { - return mailgroup; - } - - /** - * 邮件组别名 - * - * @return - */ - public MailgroupAlias mailgroupAlias() { - return mailgroupAlias; - } - - /** - * 邮件组管理员 - * - * @return - */ - public MailgroupManager mailgroupManager() { - return mailgroupManager; - } - - /** - * 邮件组成员 - * - * @return - */ - public MailgroupMember mailgroupMember() { - return mailgroupMember; - } - - /** - * 邮件组权限成员 - * - * @return - */ - public MailgroupPermissionMember mailgroupPermissionMember() { - return mailgroupPermissionMember; - } - - /** - * 公共邮箱 - * - * @return - */ - public PublicMailbox publicMailbox() { - return publicMailbox; - } - - /** - * 公共邮箱别名 - * - * @return - */ - public PublicMailboxAlias publicMailboxAlias() { - return publicMailboxAlias; - } - - /** - * 公共邮箱成员 - * - * @return - */ - public PublicMailboxMember publicMailboxMember() { - return publicMailboxMember; - } - - /** - * 邮箱地址 - * - * @return - */ - public User user() { - return user; - } - - /** - * 用户邮箱 - * - * @return - */ - public UserMailbox userMailbox() { - return userMailbox; - } - - /** - * 用户邮箱别名 - * - * @return - */ - public UserMailboxAlias userMailboxAlias() { - return userMailboxAlias; - } - - public static class Mailgroup { - private final Config config; - - public Mailgroup(Config config) { - this.config = config; - } - - /** - * 创建邮件组,创建一个邮件组 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupSample.java ; - */ - public CreateMailgroupResp create(CreateMailgroupReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/mailgroups" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateMailgroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMailgroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建邮件组,创建一个邮件组 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupSample.java ; - */ - public CreateMailgroupResp create(CreateMailgroupReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/mailgroups" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateMailgroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMailgroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除邮件组,删除一个邮件组 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupSample.java ; - */ - public DeleteMailgroupResp delete(DeleteMailgroupReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteMailgroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteMailgroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除邮件组,删除一个邮件组 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupSample.java ; - */ - public DeleteMailgroupResp delete(DeleteMailgroupReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteMailgroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteMailgroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取邮件组,获取特定邮件组信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetMailgroupSample.java ; - */ - public GetMailgroupResp get(GetMailgroupReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetMailgroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMailgroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取邮件组,获取特定邮件组信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetMailgroupSample.java ; - */ - public GetMailgroupResp get(GetMailgroupReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetMailgroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMailgroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量获取邮件组,分页批量获取邮件组 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupSample.java ; - */ - public ListMailgroupResp list(ListMailgroupReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/mailgroups" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListMailgroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMailgroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量获取邮件组,分页批量获取邮件组 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupSample.java ; - */ - public ListMailgroupResp list(ListMailgroupReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/mailgroups" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListMailgroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMailgroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改邮件组,更新邮件组部分字段,没有填写的字段不会被更新 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/PatchMailgroupSample.java ; - */ - public PatchMailgroupResp patch(PatchMailgroupReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchMailgroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchMailgroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改邮件组,更新邮件组部分字段,没有填写的字段不会被更新 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/PatchMailgroupSample.java ; - */ - public PatchMailgroupResp patch(PatchMailgroupReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchMailgroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchMailgroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新邮件组,更新邮件组所有信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/UpdateMailgroupSample.java ; - */ - public UpdateMailgroupResp update(UpdateMailgroupReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateMailgroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateMailgroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新邮件组,更新邮件组所有信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/UpdateMailgroupSample.java ; - */ - public UpdateMailgroupResp update(UpdateMailgroupReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateMailgroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateMailgroupResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class MailgroupAlias { - private final Config config; - - public MailgroupAlias(Config config) { - this.config = config; - } - - /** - * 创建邮件组别名,创建邮件组别名 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-alias/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupAliasSample.java ; - */ - public CreateMailgroupAliasResp create(CreateMailgroupAliasReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateMailgroupAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMailgroupAliasResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建邮件组别名,创建邮件组别名 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-alias/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupAliasSample.java ; - */ - public CreateMailgroupAliasResp create(CreateMailgroupAliasReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateMailgroupAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMailgroupAliasResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除邮件组别名,删除邮件组别名 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-alias/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupAliasSample.java ; - */ - public DeleteMailgroupAliasResp delete(DeleteMailgroupAliasReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases/:alias_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteMailgroupAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteMailgroupAliasResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases/:alias_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除邮件组别名,删除邮件组别名 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-alias/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupAliasSample.java ; - */ - public DeleteMailgroupAliasResp delete(DeleteMailgroupAliasReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases/:alias_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteMailgroupAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteMailgroupAliasResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases/:alias_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取邮件组所有别名,获取邮件组所有别名 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-alias/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupAliasSample.java ; - */ - public ListMailgroupAliasResp list(ListMailgroupAliasReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListMailgroupAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMailgroupAliasResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取邮件组所有别名,获取邮件组所有别名 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-alias/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupAliasSample.java ; - */ - public ListMailgroupAliasResp list(ListMailgroupAliasReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListMailgroupAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMailgroupAliasResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class MailgroupManager { - private final Config config; - - public MailgroupManager(Config config) { - this.config = config; - } - - /** - * 批量创建邮件组管理员,批量创建邮件组管理员 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-manager/batch_create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreateMailgroupManagerSample.java ; - */ - public BatchCreateMailgroupManagerResp batchCreate(BatchCreateMailgroupManagerReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_create" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchCreateMailgroupManagerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateMailgroupManagerResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_create" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量创建邮件组管理员,批量创建邮件组管理员 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-manager/batch_create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreateMailgroupManagerSample.java ; - */ - public BatchCreateMailgroupManagerResp batchCreate(BatchCreateMailgroupManagerReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_create" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchCreateMailgroupManagerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateMailgroupManagerResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_create" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量删除邮件组管理员,批量删除邮件组管理员 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-manager/batch_delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeleteMailgroupManagerSample.java ; - */ - public BatchDeleteMailgroupManagerResp batchDelete(BatchDeleteMailgroupManagerReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_delete" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchDeleteMailgroupManagerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteMailgroupManagerResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量删除邮件组管理员,批量删除邮件组管理员 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-manager/batch_delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeleteMailgroupManagerSample.java ; - */ - public BatchDeleteMailgroupManagerResp batchDelete(BatchDeleteMailgroupManagerReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_delete" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchDeleteMailgroupManagerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteMailgroupManagerResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量获取邮件组管理员,批量获取邮件组管理员 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-manager/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupManagerSample.java ; - */ - public ListMailgroupManagerResp list(ListMailgroupManagerReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/managers" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListMailgroupManagerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMailgroupManagerResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/managers" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量获取邮件组管理员,批量获取邮件组管理员 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-manager/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupManagerSample.java ; - */ - public ListMailgroupManagerResp list(ListMailgroupManagerReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/managers" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListMailgroupManagerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMailgroupManagerResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/managers" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class MailgroupMember { - private final Config config; - - public MailgroupMember(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=mail&resource=mailgroup.member&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreateMailgroupMemberSample.java ; - */ - public BatchCreateMailgroupMemberResp batchCreate(BatchCreateMailgroupMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_create" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchCreateMailgroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateMailgroupMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_create" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=mail&resource=mailgroup.member&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreateMailgroupMemberSample.java ; - */ - public BatchCreateMailgroupMemberResp batchCreate(BatchCreateMailgroupMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_create" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchCreateMailgroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateMailgroupMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_create" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=mail&resource=mailgroup.member&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeleteMailgroupMemberSample.java ; - */ - public BatchDeleteMailgroupMemberResp batchDelete(BatchDeleteMailgroupMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_delete" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchDeleteMailgroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteMailgroupMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=mail&resource=mailgroup.member&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeleteMailgroupMemberSample.java ; - */ - public BatchDeleteMailgroupMemberResp batchDelete(BatchDeleteMailgroupMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_delete" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchDeleteMailgroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteMailgroupMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建邮件组成员,向邮件组添加单个成员 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupMemberSample.java ; - */ - public CreateMailgroupMemberResp create(CreateMailgroupMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/members" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateMailgroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMailgroupMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建邮件组成员,向邮件组添加单个成员 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupMemberSample.java ; - */ - public CreateMailgroupMemberResp create(CreateMailgroupMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/members" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateMailgroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMailgroupMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除邮件组成员,删除邮件组单个成员 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupMemberSample.java ; - */ - public DeleteMailgroupMemberResp delete(DeleteMailgroupMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteMailgroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteMailgroupMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除邮件组成员,删除邮件组单个成员 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupMemberSample.java ; - */ - public DeleteMailgroupMemberResp delete(DeleteMailgroupMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteMailgroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteMailgroupMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取邮件组成员信息,获取邮件组单个成员信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetMailgroupMemberSample.java ; - */ - public GetMailgroupMemberResp get(GetMailgroupMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetMailgroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMailgroupMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取邮件组成员信息,获取邮件组单个成员信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetMailgroupMemberSample.java ; - */ - public GetMailgroupMemberResp get(GetMailgroupMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetMailgroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMailgroupMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量获取邮件组成员,分页批量获取邮件组成员列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupMemberSample.java ; - */ - public ListMailgroupMemberResp list(ListMailgroupMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/members" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListMailgroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMailgroupMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量获取邮件组成员,分页批量获取邮件组成员列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupMemberSample.java ; - */ - public ListMailgroupMemberResp list(ListMailgroupMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/members" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListMailgroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMailgroupMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class MailgroupPermissionMember { - private final Config config; - - public MailgroupPermissionMember(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=mail&resource=mailgroup.permission_member&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreateMailgroupPermissionMemberSample.java ; - */ - public BatchCreateMailgroupPermissionMemberResp batchCreate(BatchCreateMailgroupPermissionMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_create" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchCreateMailgroupPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateMailgroupPermissionMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_create" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=mail&resource=mailgroup.permission_member&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreateMailgroupPermissionMemberSample.java ; - */ - public BatchCreateMailgroupPermissionMemberResp batchCreate(BatchCreateMailgroupPermissionMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_create" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchCreateMailgroupPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateMailgroupPermissionMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_create" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=mail&resource=mailgroup.permission_member&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeleteMailgroupPermissionMemberSample.java ; - */ - public BatchDeleteMailgroupPermissionMemberResp batchDelete(BatchDeleteMailgroupPermissionMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_delete" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchDeleteMailgroupPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteMailgroupPermissionMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=mail&resource=mailgroup.permission_member&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeleteMailgroupPermissionMemberSample.java ; - */ - public BatchDeleteMailgroupPermissionMemberResp batchDelete(BatchDeleteMailgroupPermissionMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_delete" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchDeleteMailgroupPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteMailgroupPermissionMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建邮件组权限成员,向邮件组添加单个自定义权限成员,添加后该成员可发送邮件到该邮件组 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-permission_member/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupPermissionMemberSample.java ; - */ - public CreateMailgroupPermissionMemberResp create(CreateMailgroupPermissionMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateMailgroupPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMailgroupPermissionMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建邮件组权限成员,向邮件组添加单个自定义权限成员,添加后该成员可发送邮件到该邮件组 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-permission_member/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupPermissionMemberSample.java ; - */ - public CreateMailgroupPermissionMemberResp create(CreateMailgroupPermissionMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateMailgroupPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMailgroupPermissionMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除邮件组权限成员,从自定义成员中删除单个成员,删除后该成员无法发送邮件到该邮件组 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-permission_member/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupPermissionMemberSample.java ; - */ - public DeleteMailgroupPermissionMemberResp delete(DeleteMailgroupPermissionMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteMailgroupPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteMailgroupPermissionMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除邮件组权限成员,从自定义成员中删除单个成员,删除后该成员无法发送邮件到该邮件组 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-permission_member/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupPermissionMemberSample.java ; - */ - public DeleteMailgroupPermissionMemberResp delete(DeleteMailgroupPermissionMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteMailgroupPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteMailgroupPermissionMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取邮件组权限成员,获取邮件组单个权限成员信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-permission_member/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetMailgroupPermissionMemberSample.java ; - */ - public GetMailgroupPermissionMemberResp get(GetMailgroupPermissionMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetMailgroupPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMailgroupPermissionMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取邮件组权限成员,获取邮件组单个权限成员信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-permission_member/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetMailgroupPermissionMemberSample.java ; - */ - public GetMailgroupPermissionMemberResp get(GetMailgroupPermissionMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetMailgroupPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMailgroupPermissionMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量获取邮件组权限成员,分页批量获取邮件组权限成员列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-permission_member/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupPermissionMemberSample.java ; - */ - public ListMailgroupPermissionMemberResp list(ListMailgroupPermissionMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListMailgroupPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMailgroupPermissionMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量获取邮件组权限成员,分页批量获取邮件组权限成员列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-permission_member/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupPermissionMemberSample.java ; - */ - public ListMailgroupPermissionMemberResp list(ListMailgroupPermissionMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListMailgroupPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMailgroupPermissionMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class PublicMailbox { - private final Config config; - - public PublicMailbox(Config config) { - this.config = config; - } - - /** - * 创建公共邮箱,创建一个公共邮箱 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreatePublicMailboxSample.java ; - */ - public CreatePublicMailboxResp create(CreatePublicMailboxReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/public_mailboxes" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreatePublicMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePublicMailboxResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建公共邮箱,创建一个公共邮箱 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreatePublicMailboxSample.java ; - */ - public CreatePublicMailboxResp create(CreatePublicMailboxReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/public_mailboxes" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreatePublicMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePublicMailboxResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 释放公共邮箱地址,该接口会永久删除公共邮箱地址。可用于释放邮箱回收站的公共邮箱地址,一旦删除,该邮箱地址将无法恢复。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeletePublicMailboxSample.java ; - */ - public DeletePublicMailboxResp delete(DeletePublicMailboxReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeletePublicMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePublicMailboxResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 释放公共邮箱地址,该接口会永久删除公共邮箱地址。可用于释放邮箱回收站的公共邮箱地址,一旦删除,该邮箱地址将无法恢复。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeletePublicMailboxSample.java ; - */ - public DeletePublicMailboxResp delete(DeletePublicMailboxReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeletePublicMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePublicMailboxResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取公共邮箱,获取公共邮箱信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetPublicMailboxSample.java ; - */ - public GetPublicMailboxResp get(GetPublicMailboxReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetPublicMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetPublicMailboxResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取公共邮箱,获取公共邮箱信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetPublicMailboxSample.java ; - */ - public GetPublicMailboxResp get(GetPublicMailboxReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetPublicMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetPublicMailboxResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量获取公共邮箱,分页批量获取公共邮箱列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListPublicMailboxSample.java ; - */ - public ListPublicMailboxResp list(ListPublicMailboxReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/public_mailboxes" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListPublicMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPublicMailboxResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量获取公共邮箱,分页批量获取公共邮箱列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListPublicMailboxSample.java ; - */ - public ListPublicMailboxResp list(ListPublicMailboxReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/public_mailboxes" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListPublicMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPublicMailboxResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改公共邮箱,更新公共邮箱部分字段,没有填写的字段不会被更新 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/PatchPublicMailboxSample.java ; - */ - public PatchPublicMailboxResp patch(PatchPublicMailboxReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchPublicMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchPublicMailboxResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改公共邮箱,更新公共邮箱部分字段,没有填写的字段不会被更新 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/PatchPublicMailboxSample.java ; - */ - public PatchPublicMailboxResp patch(PatchPublicMailboxReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchPublicMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchPublicMailboxResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新公共邮箱,更新公共邮箱所有信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/UpdatePublicMailboxSample.java ; - */ - public UpdatePublicMailboxResp update(UpdatePublicMailboxReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdatePublicMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdatePublicMailboxResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新公共邮箱,更新公共邮箱所有信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/UpdatePublicMailboxSample.java ; - */ - public UpdatePublicMailboxResp update(UpdatePublicMailboxReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdatePublicMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdatePublicMailboxResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class PublicMailboxAlias { - private final Config config; - - public PublicMailboxAlias(Config config) { - this.config = config; - } - - /** - * 创建公共邮箱别名,创建公共邮箱别名 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-alias/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreatePublicMailboxAliasSample.java ; - */ - public CreatePublicMailboxAliasResp create(CreatePublicMailboxAliasReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreatePublicMailboxAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePublicMailboxAliasResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建公共邮箱别名,创建公共邮箱别名 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-alias/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreatePublicMailboxAliasSample.java ; - */ - public CreatePublicMailboxAliasResp create(CreatePublicMailboxAliasReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreatePublicMailboxAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePublicMailboxAliasResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除公共邮箱别名,删除公共邮箱别名 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-alias/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeletePublicMailboxAliasSample.java ; - */ - public DeletePublicMailboxAliasResp delete(DeletePublicMailboxAliasReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases/:alias_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeletePublicMailboxAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePublicMailboxAliasResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases/:alias_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除公共邮箱别名,删除公共邮箱别名 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-alias/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeletePublicMailboxAliasSample.java ; - */ - public DeletePublicMailboxAliasResp delete(DeletePublicMailboxAliasReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases/:alias_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeletePublicMailboxAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePublicMailboxAliasResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases/:alias_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取所有公共邮箱别名,获取所有公共邮箱别名 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-alias/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListPublicMailboxAliasSample.java ; - */ - public ListPublicMailboxAliasResp list(ListPublicMailboxAliasReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListPublicMailboxAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPublicMailboxAliasResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取所有公共邮箱别名,获取所有公共邮箱别名 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-alias/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListPublicMailboxAliasSample.java ; - */ - public ListPublicMailboxAliasResp list(ListPublicMailboxAliasReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListPublicMailboxAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPublicMailboxAliasResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class PublicMailboxMember { - private final Config config; - - public PublicMailboxMember(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=mail&resource=public_mailbox.member&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreatePublicMailboxMemberSample.java ; - */ - public BatchCreatePublicMailboxMemberResp batchCreate(BatchCreatePublicMailboxMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_create" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchCreatePublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreatePublicMailboxMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_create" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=mail&resource=public_mailbox.member&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreatePublicMailboxMemberSample.java ; - */ - public BatchCreatePublicMailboxMemberResp batchCreate(BatchCreatePublicMailboxMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_create" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchCreatePublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreatePublicMailboxMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_create" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=mail&resource=public_mailbox.member&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeletePublicMailboxMemberSample.java ; - */ - public BatchDeletePublicMailboxMemberResp batchDelete(BatchDeletePublicMailboxMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_delete" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchDeletePublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeletePublicMailboxMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=mail&resource=public_mailbox.member&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeletePublicMailboxMemberSample.java ; - */ - public BatchDeletePublicMailboxMemberResp batchDelete(BatchDeletePublicMailboxMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_delete" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchDeletePublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeletePublicMailboxMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_delete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 清空公共邮箱成员,删除公共邮箱所有成员 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/clear ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ClearPublicMailboxMemberSample.java ; - */ - public ClearPublicMailboxMemberResp clear(ClearPublicMailboxMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/clear" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ClearPublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ClearPublicMailboxMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/clear" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 清空公共邮箱成员,删除公共邮箱所有成员 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/clear ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ClearPublicMailboxMemberSample.java ; - */ - public ClearPublicMailboxMemberResp clear(ClearPublicMailboxMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/clear" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ClearPublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ClearPublicMailboxMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/clear" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建公共邮箱成员,向公共邮箱添加单个成员 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreatePublicMailboxMemberSample.java ; - */ - public CreatePublicMailboxMemberResp create(CreatePublicMailboxMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreatePublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePublicMailboxMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建公共邮箱成员,向公共邮箱添加单个成员 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreatePublicMailboxMemberSample.java ; - */ - public CreatePublicMailboxMemberResp create(CreatePublicMailboxMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreatePublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePublicMailboxMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除公共邮箱成员,删除公共邮箱单个成员 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeletePublicMailboxMemberSample.java ; - */ - public DeletePublicMailboxMemberResp delete(DeletePublicMailboxMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeletePublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePublicMailboxMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除公共邮箱成员,删除公共邮箱单个成员 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeletePublicMailboxMemberSample.java ; - */ - public DeletePublicMailboxMemberResp delete(DeletePublicMailboxMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeletePublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePublicMailboxMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取公共邮箱成员信息,获取公共邮箱单个成员信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetPublicMailboxMemberSample.java ; - */ - public GetPublicMailboxMemberResp get(GetPublicMailboxMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetPublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetPublicMailboxMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取公共邮箱成员信息,获取公共邮箱单个成员信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetPublicMailboxMemberSample.java ; - */ - public GetPublicMailboxMemberResp get(GetPublicMailboxMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetPublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetPublicMailboxMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量获取公共邮箱成员,分页批量获取公共邮箱成员列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListPublicMailboxMemberSample.java ; - */ - public ListPublicMailboxMemberResp list(ListPublicMailboxMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListPublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPublicMailboxMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量获取公共邮箱成员,分页批量获取公共邮箱成员列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListPublicMailboxMemberSample.java ; - */ - public ListPublicMailboxMemberResp list(ListPublicMailboxMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListPublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPublicMailboxMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class User { - private final Config config; - - public User(Config config) { - this.config = config; - } - - /** - * 邮箱状态查询,使用邮箱状态查询接口,可以输入邮箱地址,查询出该邮箱地址对应的类型以及状态 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/QueryUserSample.java ; - */ - public QueryUserResp query(QueryUserReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/users/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/users/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 邮箱状态查询,使用邮箱状态查询接口,可以输入邮箱地址,查询出该邮箱地址对应的类型以及状态 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/QueryUserSample.java ; - */ - public QueryUserResp query(QueryUserReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/users/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/users/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class UserMailbox { - private final Config config; - - public UserMailbox(Config config) { - this.config = config; - } - - /** - * 释放用户邮箱地址,该接口会永久删除用户邮箱地址。可用于删除位于邮箱回收站中的用户邮箱地址,一旦删除,将无法恢复。该接口支持邮件的转移,可以将被释放邮箱的邮件转移到另外一个可以使用的邮箱中。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user_mailbox/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteUserMailboxSample.java ; - */ - public DeleteUserMailboxResp delete(DeleteUserMailboxReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteUserMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteUserMailboxResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 释放用户邮箱地址,该接口会永久删除用户邮箱地址。可用于删除位于邮箱回收站中的用户邮箱地址,一旦删除,将无法恢复。该接口支持邮件的转移,可以将被释放邮箱的邮件转移到另外一个可以使用的邮箱中。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user_mailbox/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteUserMailboxSample.java ; - */ - public DeleteUserMailboxResp delete(DeleteUserMailboxReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteUserMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteUserMailboxResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class UserMailboxAlias { - private final Config config; - - public UserMailboxAlias(Config config) { - this.config = config; - } - - /** - * 创建用户邮箱别名,创建用户邮箱别名 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user_mailbox-alias/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateUserMailboxAliasSample.java ; - */ - public CreateUserMailboxAliasResp create(CreateUserMailboxAliasReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateUserMailboxAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateUserMailboxAliasResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建用户邮箱别名,创建用户邮箱别名 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user_mailbox-alias/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateUserMailboxAliasSample.java ; - */ - public CreateUserMailboxAliasResp create(CreateUserMailboxAliasReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateUserMailboxAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateUserMailboxAliasResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除用户邮箱别名,删除用户邮箱别名 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user_mailbox-alias/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteUserMailboxAliasSample.java ; - */ - public DeleteUserMailboxAliasResp delete(DeleteUserMailboxAliasReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases/:alias_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteUserMailboxAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteUserMailboxAliasResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases/:alias_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除用户邮箱别名,删除用户邮箱别名 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user_mailbox-alias/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteUserMailboxAliasSample.java ; - */ - public DeleteUserMailboxAliasResp delete(DeleteUserMailboxAliasReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases/:alias_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteUserMailboxAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteUserMailboxAliasResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases/:alias_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取用户邮箱所有别名,获取用户邮箱所有别名 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user_mailbox-alias/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListUserMailboxAliasSample.java ; - */ - public ListUserMailboxAliasResp list(ListUserMailboxAliasReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListUserMailboxAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListUserMailboxAliasResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取用户邮箱所有别名,获取用户邮箱所有别名 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user_mailbox-alias/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListUserMailboxAliasSample.java ; - */ - public ListUserMailboxAliasResp list(ListUserMailboxAliasReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListUserMailboxAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListUserMailboxAliasResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/V1.java new file mode 100644 index 000000000..8776f7e26 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/V1.java @@ -0,0 +1,89 @@ +// Code generated by lark suite 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 com.lark.oapi.service.mail.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.mail.v1.resource.*; + +public class V1 { + private final Mailgroup mailgroup; // 邮件组 + private final MailgroupAlias mailgroupAlias; // 邮件组别名 + private final MailgroupManager mailgroupManager; // 邮件组管理员 + private final MailgroupMember mailgroupMember; // 邮件组成员 + private final MailgroupPermissionMember mailgroupPermissionMember; // 邮件组权限成员 + private final PublicMailbox publicMailbox; // 公共邮箱 + private final PublicMailboxAlias publicMailboxAlias; // 公共邮箱别名 + private final PublicMailboxMember publicMailboxMember; // 公共邮箱成员 + private final User user; // 邮箱地址 + private final UserMailbox userMailbox; // 用户邮箱 + private final UserMailboxAlias userMailboxAlias; // 用户邮箱别名 + + public V1(Config config) { + this.mailgroup = new Mailgroup(config); + this.mailgroupAlias = new MailgroupAlias(config); + this.mailgroupManager = new MailgroupManager(config); + this.mailgroupMember = new MailgroupMember(config); + this.mailgroupPermissionMember = new MailgroupPermissionMember(config); + this.publicMailbox = new PublicMailbox(config); + this.publicMailboxAlias = new PublicMailboxAlias(config); + this.publicMailboxMember = new PublicMailboxMember(config); + this.user = new User(config); + this.userMailbox = new UserMailbox(config); + this.userMailboxAlias = new UserMailboxAlias(config); + } + + public Mailgroup mailgroup() { + return mailgroup; + } + + public MailgroupAlias mailgroupAlias() { + return mailgroupAlias; + } + + public MailgroupManager mailgroupManager() { + return mailgroupManager; + } + + public MailgroupMember mailgroupMember() { + return mailgroupMember; + } + + public MailgroupPermissionMember mailgroupPermissionMember() { + return mailgroupPermissionMember; + } + + public PublicMailbox publicMailbox() { + return publicMailbox; + } + + public PublicMailboxAlias publicMailboxAlias() { + return publicMailboxAlias; + } + + public PublicMailboxMember publicMailboxMember() { + return publicMailboxMember; + } + + public User user() { + return user; + } + + public UserMailbox userMailbox() { + return userMailbox; + } + + public UserMailboxAlias userMailboxAlias() { + return userMailboxAlias; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/model/GetPublicMailboxMemberReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/model/GetPublicMailboxMemberReq.java index 1b3ebcc88..2f3567371 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/model/GetPublicMailboxMemberReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/model/GetPublicMailboxMemberReq.java @@ -43,6 +43,7 @@ public class GetPublicMailboxMemberReq { // builder 开始 public GetPublicMailboxMemberReq() { } + public GetPublicMailboxMemberReq(Builder builder) { /** * 此次调用中使用的用户ID的类型 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/Mailgroup.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/Mailgroup.java new file mode 100644 index 000000000..82a79b3b1 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/Mailgroup.java @@ -0,0 +1,434 @@ +// Code generated by lark suite 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 com.lark.oapi.service.mail.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.mail.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Mailgroup { + private static final Logger log = LoggerFactory.getLogger(Mailgroup.class); + private final Config config; + + public Mailgroup(Config config) { + this.config = config; + } + + + /** + * 创建邮件组,创建一个邮件组 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupSample.java ; + */ + public CreateMailgroupResp create(CreateMailgroupReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/mailgroups" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateMailgroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMailgroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建邮件组,创建一个邮件组 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupSample.java ; + */ + public CreateMailgroupResp create(CreateMailgroupReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/mailgroups" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateMailgroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMailgroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除邮件组,删除一个邮件组 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupSample.java ; + */ + public DeleteMailgroupResp delete(DeleteMailgroupReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteMailgroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteMailgroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除邮件组,删除一个邮件组 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupSample.java ; + */ + public DeleteMailgroupResp delete(DeleteMailgroupReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteMailgroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteMailgroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取邮件组,获取特定邮件组信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetMailgroupSample.java ; + */ + public GetMailgroupResp get(GetMailgroupReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetMailgroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMailgroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取邮件组,获取特定邮件组信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetMailgroupSample.java ; + */ + public GetMailgroupResp get(GetMailgroupReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetMailgroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMailgroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量获取邮件组,分页批量获取邮件组 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupSample.java ; + */ + public ListMailgroupResp list(ListMailgroupReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/mailgroups" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListMailgroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMailgroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量获取邮件组,分页批量获取邮件组 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupSample.java ; + */ + public ListMailgroupResp list(ListMailgroupReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/mailgroups" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListMailgroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMailgroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改邮件组,更新邮件组部分字段,没有填写的字段不会被更新 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/PatchMailgroupSample.java ; + */ + public PatchMailgroupResp patch(PatchMailgroupReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchMailgroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchMailgroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改邮件组,更新邮件组部分字段,没有填写的字段不会被更新 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/PatchMailgroupSample.java ; + */ + public PatchMailgroupResp patch(PatchMailgroupReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchMailgroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchMailgroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新邮件组,更新邮件组所有信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/UpdateMailgroupSample.java ; + */ + public UpdateMailgroupResp update(UpdateMailgroupReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateMailgroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateMailgroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新邮件组,更新邮件组所有信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/UpdateMailgroupSample.java ; + */ + public UpdateMailgroupResp update(UpdateMailgroupReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateMailgroupResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateMailgroupResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/MailgroupAlias.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/MailgroupAlias.java new file mode 100644 index 000000000..46d029c72 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/MailgroupAlias.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.mail.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.mail.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class MailgroupAlias { + private static final Logger log = LoggerFactory.getLogger(MailgroupAlias.class); + private final Config config; + + public MailgroupAlias(Config config) { + this.config = config; + } + + + /** + * 创建邮件组别名,创建邮件组别名 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-alias/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupAliasSample.java ; + */ + public CreateMailgroupAliasResp create(CreateMailgroupAliasReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateMailgroupAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMailgroupAliasResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建邮件组别名,创建邮件组别名 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-alias/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupAliasSample.java ; + */ + public CreateMailgroupAliasResp create(CreateMailgroupAliasReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateMailgroupAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMailgroupAliasResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除邮件组别名,删除邮件组别名 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-alias/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupAliasSample.java ; + */ + public DeleteMailgroupAliasResp delete(DeleteMailgroupAliasReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases/:alias_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteMailgroupAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteMailgroupAliasResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases/:alias_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除邮件组别名,删除邮件组别名 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-alias/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupAliasSample.java ; + */ + public DeleteMailgroupAliasResp delete(DeleteMailgroupAliasReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases/:alias_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteMailgroupAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteMailgroupAliasResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases/:alias_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取邮件组所有别名,获取邮件组所有别名 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-alias/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupAliasSample.java ; + */ + public ListMailgroupAliasResp list(ListMailgroupAliasReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListMailgroupAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMailgroupAliasResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取邮件组所有别名,获取邮件组所有别名 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-alias/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupAliasSample.java ; + */ + public ListMailgroupAliasResp list(ListMailgroupAliasReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListMailgroupAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMailgroupAliasResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/MailgroupManager.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/MailgroupManager.java new file mode 100644 index 000000000..280586231 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/MailgroupManager.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.mail.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.mail.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class MailgroupManager { + private static final Logger log = LoggerFactory.getLogger(MailgroupManager.class); + private final Config config; + + public MailgroupManager(Config config) { + this.config = config; + } + + + /** + * 批量创建邮件组管理员,批量创建邮件组管理员 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-manager/batch_create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreateMailgroupManagerSample.java ; + */ + public BatchCreateMailgroupManagerResp batchCreate(BatchCreateMailgroupManagerReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_create" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchCreateMailgroupManagerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateMailgroupManagerResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_create" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量创建邮件组管理员,批量创建邮件组管理员 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-manager/batch_create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreateMailgroupManagerSample.java ; + */ + public BatchCreateMailgroupManagerResp batchCreate(BatchCreateMailgroupManagerReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_create" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchCreateMailgroupManagerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateMailgroupManagerResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_create" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量删除邮件组管理员,批量删除邮件组管理员 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-manager/batch_delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeleteMailgroupManagerSample.java ; + */ + public BatchDeleteMailgroupManagerResp batchDelete(BatchDeleteMailgroupManagerReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_delete" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchDeleteMailgroupManagerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteMailgroupManagerResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量删除邮件组管理员,批量删除邮件组管理员 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-manager/batch_delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeleteMailgroupManagerSample.java ; + */ + public BatchDeleteMailgroupManagerResp batchDelete(BatchDeleteMailgroupManagerReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_delete" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchDeleteMailgroupManagerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteMailgroupManagerResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量获取邮件组管理员,批量获取邮件组管理员 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-manager/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupManagerSample.java ; + */ + public ListMailgroupManagerResp list(ListMailgroupManagerReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/managers" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListMailgroupManagerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMailgroupManagerResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/managers" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量获取邮件组管理员,批量获取邮件组管理员 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-manager/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupManagerSample.java ; + */ + public ListMailgroupManagerResp list(ListMailgroupManagerReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/managers" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListMailgroupManagerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMailgroupManagerResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/managers" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/MailgroupMember.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/MailgroupMember.java new file mode 100644 index 000000000..af0264d34 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/MailgroupMember.java @@ -0,0 +1,434 @@ +// Code generated by lark suite 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 com.lark.oapi.service.mail.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.mail.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class MailgroupMember { + private static final Logger log = LoggerFactory.getLogger(MailgroupMember.class); + private final Config config; + + public MailgroupMember(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=mail&resource=mailgroup.member&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreateMailgroupMemberSample.java ; + */ + public BatchCreateMailgroupMemberResp batchCreate(BatchCreateMailgroupMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_create" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchCreateMailgroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateMailgroupMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_create" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=mail&resource=mailgroup.member&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreateMailgroupMemberSample.java ; + */ + public BatchCreateMailgroupMemberResp batchCreate(BatchCreateMailgroupMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_create" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchCreateMailgroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateMailgroupMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_create" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=mail&resource=mailgroup.member&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeleteMailgroupMemberSample.java ; + */ + public BatchDeleteMailgroupMemberResp batchDelete(BatchDeleteMailgroupMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_delete" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchDeleteMailgroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteMailgroupMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=mail&resource=mailgroup.member&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeleteMailgroupMemberSample.java ; + */ + public BatchDeleteMailgroupMemberResp batchDelete(BatchDeleteMailgroupMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_delete" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchDeleteMailgroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteMailgroupMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建邮件组成员,向邮件组添加单个成员 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupMemberSample.java ; + */ + public CreateMailgroupMemberResp create(CreateMailgroupMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/members" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateMailgroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMailgroupMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建邮件组成员,向邮件组添加单个成员 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupMemberSample.java ; + */ + public CreateMailgroupMemberResp create(CreateMailgroupMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/members" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateMailgroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMailgroupMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除邮件组成员,删除邮件组单个成员 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupMemberSample.java ; + */ + public DeleteMailgroupMemberResp delete(DeleteMailgroupMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteMailgroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteMailgroupMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除邮件组成员,删除邮件组单个成员 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupMemberSample.java ; + */ + public DeleteMailgroupMemberResp delete(DeleteMailgroupMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteMailgroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteMailgroupMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取邮件组成员信息,获取邮件组单个成员信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetMailgroupMemberSample.java ; + */ + public GetMailgroupMemberResp get(GetMailgroupMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetMailgroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMailgroupMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取邮件组成员信息,获取邮件组单个成员信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetMailgroupMemberSample.java ; + */ + public GetMailgroupMemberResp get(GetMailgroupMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetMailgroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMailgroupMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量获取邮件组成员,分页批量获取邮件组成员列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupMemberSample.java ; + */ + public ListMailgroupMemberResp list(ListMailgroupMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/members" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListMailgroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMailgroupMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量获取邮件组成员,分页批量获取邮件组成员列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupMemberSample.java ; + */ + public ListMailgroupMemberResp list(ListMailgroupMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/members" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListMailgroupMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMailgroupMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/MailgroupPermissionMember.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/MailgroupPermissionMember.java new file mode 100644 index 000000000..2bde57070 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/MailgroupPermissionMember.java @@ -0,0 +1,434 @@ +// Code generated by lark suite 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 com.lark.oapi.service.mail.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.mail.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class MailgroupPermissionMember { + private static final Logger log = LoggerFactory.getLogger(MailgroupPermissionMember.class); + private final Config config; + + public MailgroupPermissionMember(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=mail&resource=mailgroup.permission_member&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreateMailgroupPermissionMemberSample.java ; + */ + public BatchCreateMailgroupPermissionMemberResp batchCreate(BatchCreateMailgroupPermissionMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_create" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchCreateMailgroupPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateMailgroupPermissionMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_create" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=mail&resource=mailgroup.permission_member&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreateMailgroupPermissionMemberSample.java ; + */ + public BatchCreateMailgroupPermissionMemberResp batchCreate(BatchCreateMailgroupPermissionMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_create" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchCreateMailgroupPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreateMailgroupPermissionMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_create" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=mail&resource=mailgroup.permission_member&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeleteMailgroupPermissionMemberSample.java ; + */ + public BatchDeleteMailgroupPermissionMemberResp batchDelete(BatchDeleteMailgroupPermissionMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_delete" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchDeleteMailgroupPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteMailgroupPermissionMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=mail&resource=mailgroup.permission_member&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeleteMailgroupPermissionMemberSample.java ; + */ + public BatchDeleteMailgroupPermissionMemberResp batchDelete(BatchDeleteMailgroupPermissionMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_delete" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchDeleteMailgroupPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteMailgroupPermissionMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建邮件组权限成员,向邮件组添加单个自定义权限成员,添加后该成员可发送邮件到该邮件组 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-permission_member/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupPermissionMemberSample.java ; + */ + public CreateMailgroupPermissionMemberResp create(CreateMailgroupPermissionMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateMailgroupPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMailgroupPermissionMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建邮件组权限成员,向邮件组添加单个自定义权限成员,添加后该成员可发送邮件到该邮件组 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-permission_member/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupPermissionMemberSample.java ; + */ + public CreateMailgroupPermissionMemberResp create(CreateMailgroupPermissionMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateMailgroupPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMailgroupPermissionMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除邮件组权限成员,从自定义成员中删除单个成员,删除后该成员无法发送邮件到该邮件组 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-permission_member/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupPermissionMemberSample.java ; + */ + public DeleteMailgroupPermissionMemberResp delete(DeleteMailgroupPermissionMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteMailgroupPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteMailgroupPermissionMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除邮件组权限成员,从自定义成员中删除单个成员,删除后该成员无法发送邮件到该邮件组 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-permission_member/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupPermissionMemberSample.java ; + */ + public DeleteMailgroupPermissionMemberResp delete(DeleteMailgroupPermissionMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteMailgroupPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteMailgroupPermissionMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取邮件组权限成员,获取邮件组单个权限成员信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-permission_member/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetMailgroupPermissionMemberSample.java ; + */ + public GetMailgroupPermissionMemberResp get(GetMailgroupPermissionMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetMailgroupPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMailgroupPermissionMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取邮件组权限成员,获取邮件组单个权限成员信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-permission_member/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetMailgroupPermissionMemberSample.java ; + */ + public GetMailgroupPermissionMemberResp get(GetMailgroupPermissionMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetMailgroupPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMailgroupPermissionMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量获取邮件组权限成员,分页批量获取邮件组权限成员列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-permission_member/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupPermissionMemberSample.java ; + */ + public ListMailgroupPermissionMemberResp list(ListMailgroupPermissionMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListMailgroupPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMailgroupPermissionMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量获取邮件组权限成员,分页批量获取邮件组权限成员列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-permission_member/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupPermissionMemberSample.java ; + */ + public ListMailgroupPermissionMemberResp list(ListMailgroupPermissionMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListMailgroupPermissionMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListMailgroupPermissionMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/PublicMailbox.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/PublicMailbox.java new file mode 100644 index 000000000..f83dd9312 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/PublicMailbox.java @@ -0,0 +1,434 @@ +// Code generated by lark suite 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 com.lark.oapi.service.mail.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.mail.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class PublicMailbox { + private static final Logger log = LoggerFactory.getLogger(PublicMailbox.class); + private final Config config; + + public PublicMailbox(Config config) { + this.config = config; + } + + + /** + * 创建公共邮箱,创建一个公共邮箱 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreatePublicMailboxSample.java ; + */ + public CreatePublicMailboxResp create(CreatePublicMailboxReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/public_mailboxes" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreatePublicMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePublicMailboxResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建公共邮箱,创建一个公共邮箱 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreatePublicMailboxSample.java ; + */ + public CreatePublicMailboxResp create(CreatePublicMailboxReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/public_mailboxes" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreatePublicMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePublicMailboxResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 释放公共邮箱地址,该接口会永久删除公共邮箱地址。可用于释放邮箱回收站的公共邮箱地址,一旦删除,该邮箱地址将无法恢复。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeletePublicMailboxSample.java ; + */ + public DeletePublicMailboxResp delete(DeletePublicMailboxReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeletePublicMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePublicMailboxResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 释放公共邮箱地址,该接口会永久删除公共邮箱地址。可用于释放邮箱回收站的公共邮箱地址,一旦删除,该邮箱地址将无法恢复。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeletePublicMailboxSample.java ; + */ + public DeletePublicMailboxResp delete(DeletePublicMailboxReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeletePublicMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePublicMailboxResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取公共邮箱,获取公共邮箱信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetPublicMailboxSample.java ; + */ + public GetPublicMailboxResp get(GetPublicMailboxReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetPublicMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetPublicMailboxResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取公共邮箱,获取公共邮箱信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetPublicMailboxSample.java ; + */ + public GetPublicMailboxResp get(GetPublicMailboxReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetPublicMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetPublicMailboxResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量获取公共邮箱,分页批量获取公共邮箱列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListPublicMailboxSample.java ; + */ + public ListPublicMailboxResp list(ListPublicMailboxReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/public_mailboxes" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListPublicMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPublicMailboxResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量获取公共邮箱,分页批量获取公共邮箱列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListPublicMailboxSample.java ; + */ + public ListPublicMailboxResp list(ListPublicMailboxReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/public_mailboxes" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListPublicMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPublicMailboxResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改公共邮箱,更新公共邮箱部分字段,没有填写的字段不会被更新 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/PatchPublicMailboxSample.java ; + */ + public PatchPublicMailboxResp patch(PatchPublicMailboxReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchPublicMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchPublicMailboxResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改公共邮箱,更新公共邮箱部分字段,没有填写的字段不会被更新 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/PatchPublicMailboxSample.java ; + */ + public PatchPublicMailboxResp patch(PatchPublicMailboxReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchPublicMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchPublicMailboxResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新公共邮箱,更新公共邮箱所有信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/UpdatePublicMailboxSample.java ; + */ + public UpdatePublicMailboxResp update(UpdatePublicMailboxReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdatePublicMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdatePublicMailboxResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新公共邮箱,更新公共邮箱所有信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/UpdatePublicMailboxSample.java ; + */ + public UpdatePublicMailboxResp update(UpdatePublicMailboxReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdatePublicMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdatePublicMailboxResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/PublicMailboxAlias.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/PublicMailboxAlias.java new file mode 100644 index 000000000..0ebf59f5c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/PublicMailboxAlias.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.mail.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.mail.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class PublicMailboxAlias { + private static final Logger log = LoggerFactory.getLogger(PublicMailboxAlias.class); + private final Config config; + + public PublicMailboxAlias(Config config) { + this.config = config; + } + + + /** + * 创建公共邮箱别名,创建公共邮箱别名 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-alias/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreatePublicMailboxAliasSample.java ; + */ + public CreatePublicMailboxAliasResp create(CreatePublicMailboxAliasReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreatePublicMailboxAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePublicMailboxAliasResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建公共邮箱别名,创建公共邮箱别名 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-alias/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreatePublicMailboxAliasSample.java ; + */ + public CreatePublicMailboxAliasResp create(CreatePublicMailboxAliasReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreatePublicMailboxAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePublicMailboxAliasResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除公共邮箱别名,删除公共邮箱别名 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-alias/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeletePublicMailboxAliasSample.java ; + */ + public DeletePublicMailboxAliasResp delete(DeletePublicMailboxAliasReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases/:alias_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeletePublicMailboxAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePublicMailboxAliasResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases/:alias_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除公共邮箱别名,删除公共邮箱别名 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-alias/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeletePublicMailboxAliasSample.java ; + */ + public DeletePublicMailboxAliasResp delete(DeletePublicMailboxAliasReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases/:alias_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeletePublicMailboxAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePublicMailboxAliasResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases/:alias_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取所有公共邮箱别名,获取所有公共邮箱别名 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-alias/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListPublicMailboxAliasSample.java ; + */ + public ListPublicMailboxAliasResp list(ListPublicMailboxAliasReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListPublicMailboxAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPublicMailboxAliasResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取所有公共邮箱别名,获取所有公共邮箱别名 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-alias/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListPublicMailboxAliasSample.java ; + */ + public ListPublicMailboxAliasResp list(ListPublicMailboxAliasReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListPublicMailboxAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPublicMailboxAliasResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/PublicMailboxMember.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/PublicMailboxMember.java new file mode 100644 index 000000000..67e5e1451 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/PublicMailboxMember.java @@ -0,0 +1,500 @@ +// Code generated by lark suite 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 com.lark.oapi.service.mail.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.mail.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class PublicMailboxMember { + private static final Logger log = LoggerFactory.getLogger(PublicMailboxMember.class); + private final Config config; + + public PublicMailboxMember(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=mail&resource=public_mailbox.member&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreatePublicMailboxMemberSample.java ; + */ + public BatchCreatePublicMailboxMemberResp batchCreate(BatchCreatePublicMailboxMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_create" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchCreatePublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreatePublicMailboxMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_create" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=mail&resource=public_mailbox.member&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreatePublicMailboxMemberSample.java ; + */ + public BatchCreatePublicMailboxMemberResp batchCreate(BatchCreatePublicMailboxMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_create" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchCreatePublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCreatePublicMailboxMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_create" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=mail&resource=public_mailbox.member&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeletePublicMailboxMemberSample.java ; + */ + public BatchDeletePublicMailboxMemberResp batchDelete(BatchDeletePublicMailboxMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_delete" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchDeletePublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeletePublicMailboxMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=mail&resource=public_mailbox.member&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeletePublicMailboxMemberSample.java ; + */ + public BatchDeletePublicMailboxMemberResp batchDelete(BatchDeletePublicMailboxMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_delete" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchDeletePublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeletePublicMailboxMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_delete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 清空公共邮箱成员,删除公共邮箱所有成员 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/clear ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ClearPublicMailboxMemberSample.java ; + */ + public ClearPublicMailboxMemberResp clear(ClearPublicMailboxMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/clear" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ClearPublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ClearPublicMailboxMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/clear" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 清空公共邮箱成员,删除公共邮箱所有成员 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/clear ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ClearPublicMailboxMemberSample.java ; + */ + public ClearPublicMailboxMemberResp clear(ClearPublicMailboxMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/clear" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ClearPublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ClearPublicMailboxMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/clear" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建公共邮箱成员,向公共邮箱添加单个成员 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreatePublicMailboxMemberSample.java ; + */ + public CreatePublicMailboxMemberResp create(CreatePublicMailboxMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreatePublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePublicMailboxMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建公共邮箱成员,向公共邮箱添加单个成员 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreatePublicMailboxMemberSample.java ; + */ + public CreatePublicMailboxMemberResp create(CreatePublicMailboxMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreatePublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreatePublicMailboxMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除公共邮箱成员,删除公共邮箱单个成员 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeletePublicMailboxMemberSample.java ; + */ + public DeletePublicMailboxMemberResp delete(DeletePublicMailboxMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeletePublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePublicMailboxMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除公共邮箱成员,删除公共邮箱单个成员 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeletePublicMailboxMemberSample.java ; + */ + public DeletePublicMailboxMemberResp delete(DeletePublicMailboxMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeletePublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeletePublicMailboxMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取公共邮箱成员信息,获取公共邮箱单个成员信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetPublicMailboxMemberSample.java ; + */ + public GetPublicMailboxMemberResp get(GetPublicMailboxMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetPublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetPublicMailboxMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取公共邮箱成员信息,获取公共邮箱单个成员信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetPublicMailboxMemberSample.java ; + */ + public GetPublicMailboxMemberResp get(GetPublicMailboxMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetPublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetPublicMailboxMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量获取公共邮箱成员,分页批量获取公共邮箱成员列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListPublicMailboxMemberSample.java ; + */ + public ListPublicMailboxMemberResp list(ListPublicMailboxMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListPublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPublicMailboxMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量获取公共邮箱成员,分页批量获取公共邮箱成员列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListPublicMailboxMemberSample.java ; + */ + public ListPublicMailboxMemberResp list(ListPublicMailboxMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListPublicMailboxMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPublicMailboxMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/User.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/User.java new file mode 100644 index 000000000..e36a04e7b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/User.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.mail.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.mail.v1.model.QueryUserReq; +import com.lark.oapi.service.mail.v1.model.QueryUserResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class User { + private static final Logger log = LoggerFactory.getLogger(User.class); + private final Config config; + + public User(Config config) { + this.config = config; + } + + + /** + * 邮箱状态查询,使用邮箱状态查询接口,可以输入邮箱地址,查询出该邮箱地址对应的类型以及状态 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/QueryUserSample.java ; + */ + public QueryUserResp query(QueryUserReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/users/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/users/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 邮箱状态查询,使用邮箱状态查询接口,可以输入邮箱地址,查询出该邮箱地址对应的类型以及状态 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/QueryUserSample.java ; + */ + public QueryUserResp query(QueryUserReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/users/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryUserResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryUserResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/users/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/UserMailbox.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/UserMailbox.java new file mode 100644 index 000000000..911f2f61f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/UserMailbox.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.mail.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.mail.v1.model.DeleteUserMailboxReq; +import com.lark.oapi.service.mail.v1.model.DeleteUserMailboxResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class UserMailbox { + private static final Logger log = LoggerFactory.getLogger(UserMailbox.class); + private final Config config; + + public UserMailbox(Config config) { + this.config = config; + } + + + /** + * 释放用户邮箱地址,该接口会永久删除用户邮箱地址。可用于删除位于邮箱回收站中的用户邮箱地址,一旦删除,将无法恢复。该接口支持邮件的转移,可以将被释放邮箱的邮件转移到另外一个可以使用的邮箱中。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user_mailbox/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteUserMailboxSample.java ; + */ + public DeleteUserMailboxResp delete(DeleteUserMailboxReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteUserMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteUserMailboxResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 释放用户邮箱地址,该接口会永久删除用户邮箱地址。可用于删除位于邮箱回收站中的用户邮箱地址,一旦删除,将无法恢复。该接口支持邮件的转移,可以将被释放邮箱的邮件转移到另外一个可以使用的邮箱中。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user_mailbox/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteUserMailboxSample.java ; + */ + public DeleteUserMailboxResp delete(DeleteUserMailboxReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteUserMailboxResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteUserMailboxResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/UserMailboxAlias.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/UserMailboxAlias.java new file mode 100644 index 000000000..955d68fca --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/mail/v1/resource/UserMailboxAlias.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.mail.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.mail.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class UserMailboxAlias { + private static final Logger log = LoggerFactory.getLogger(UserMailboxAlias.class); + private final Config config; + + public UserMailboxAlias(Config config) { + this.config = config; + } + + + /** + * 创建用户邮箱别名,创建用户邮箱别名 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user_mailbox-alias/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateUserMailboxAliasSample.java ; + */ + public CreateUserMailboxAliasResp create(CreateUserMailboxAliasReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateUserMailboxAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateUserMailboxAliasResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建用户邮箱别名,创建用户邮箱别名 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user_mailbox-alias/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateUserMailboxAliasSample.java ; + */ + public CreateUserMailboxAliasResp create(CreateUserMailboxAliasReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateUserMailboxAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateUserMailboxAliasResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除用户邮箱别名,删除用户邮箱别名 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user_mailbox-alias/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteUserMailboxAliasSample.java ; + */ + public DeleteUserMailboxAliasResp delete(DeleteUserMailboxAliasReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases/:alias_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteUserMailboxAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteUserMailboxAliasResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases/:alias_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除用户邮箱别名,删除用户邮箱别名 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user_mailbox-alias/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteUserMailboxAliasSample.java ; + */ + public DeleteUserMailboxAliasResp delete(DeleteUserMailboxAliasReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases/:alias_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteUserMailboxAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteUserMailboxAliasResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases/:alias_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取用户邮箱所有别名,获取用户邮箱所有别名 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user_mailbox-alias/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListUserMailboxAliasSample.java ; + */ + public ListUserMailboxAliasResp list(ListUserMailboxAliasReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListUserMailboxAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListUserMailboxAliasResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取用户邮箱所有别名,获取用户邮箱所有别名 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user_mailbox-alias/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListUserMailboxAliasSample.java ; + */ + public ListUserMailboxAliasResp list(ListUserMailboxAliasReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListUserMailboxAliasResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListUserMailboxAliasResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/mdm/MdmService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/mdm/MdmService.java new file mode 100644 index 000000000..3418862a5 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/mdm/MdmService.java @@ -0,0 +1,35 @@ +// Code generated by lark suite 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 com.lark.oapi.service.mdm; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.mdm.v1.V1; +import com.lark.oapi.service.mdm.v1.resource.UserAuthDataRelation; + +public class MdmService { + private final V1 v1; + private final UserAuthDataRelation userAuthDataRelation; // 数据维度 + + public MdmService(Config config) { + this.v1 = new V1(config); + this.userAuthDataRelation = new UserAuthDataRelation(config); + } + + public V1 v1() { + return v1; + } + + public UserAuthDataRelation userAuthDataRelation() { + return userAuthDataRelation; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/mdm/v1/MdmService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/mdm/v1/MdmService.java deleted file mode 100644 index dafc6960e..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/mdm/v1/MdmService.java +++ /dev/null @@ -1,190 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.mdm.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.mdm.v1.model.BindUserAuthDataRelationReq; -import com.lark.oapi.service.mdm.v1.model.BindUserAuthDataRelationResp; -import com.lark.oapi.service.mdm.v1.model.UnbindUserAuthDataRelationReq; -import com.lark.oapi.service.mdm.v1.model.UnbindUserAuthDataRelationResp; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class MdmService { - private static final Logger log = LoggerFactory.getLogger(MdmService.class); - private final UserAuthDataRelation userAuthDataRelation; // 数据维度 - - public MdmService(Config config) { - this.userAuthDataRelation = new UserAuthDataRelation(config); - } - - /** - * 数据维度 - * - * @return - */ - public UserAuthDataRelation userAuthDataRelation() { - return userAuthDataRelation; - } - - public static class UserAuthDataRelation { - private final Config config; - - public UserAuthDataRelation(Config config) { - this.config = config; - } - - /** - * 用户数据维度绑定,通过该接口,可为指定应用下的用户绑定一类数据维度,支持批量给多个用户同时增量授权。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/mdm-v1/user_auth_data_relation/bind ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mdmv1/BindUserAuthDataRelationSample.java ; - */ - public BindUserAuthDataRelationResp bind(BindUserAuthDataRelationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mdm/v1/user_auth_data_relations/bind" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BindUserAuthDataRelationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BindUserAuthDataRelationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mdm/v1/user_auth_data_relations/bind" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 用户数据维度绑定,通过该接口,可为指定应用下的用户绑定一类数据维度,支持批量给多个用户同时增量授权。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/mdm-v1/user_auth_data_relation/bind ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mdmv1/BindUserAuthDataRelationSample.java ; - */ - public BindUserAuthDataRelationResp bind(BindUserAuthDataRelationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mdm/v1/user_auth_data_relations/bind" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BindUserAuthDataRelationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BindUserAuthDataRelationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mdm/v1/user_auth_data_relations/bind" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 用户数据维度解绑,通过该接口,可为指定应用下的指定用户解除一类数据维度。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/mdm-v1/user_auth_data_relation/unbind ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mdmv1/UnbindUserAuthDataRelationSample.java ; - */ - public UnbindUserAuthDataRelationResp unbind(UnbindUserAuthDataRelationReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mdm/v1/user_auth_data_relations/unbind" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UnbindUserAuthDataRelationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnbindUserAuthDataRelationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mdm/v1/user_auth_data_relations/unbind" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 用户数据维度解绑,通过该接口,可为指定应用下的指定用户解除一类数据维度。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/mdm-v1/user_auth_data_relation/unbind ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mdmv1/UnbindUserAuthDataRelationSample.java ; - */ - public UnbindUserAuthDataRelationResp unbind(UnbindUserAuthDataRelationReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/mdm/v1/user_auth_data_relations/unbind" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - UnbindUserAuthDataRelationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnbindUserAuthDataRelationResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mdm/v1/user_auth_data_relations/unbind" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/mdm/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/mdm/v1/V1.java new file mode 100644 index 000000000..506717564 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/mdm/v1/V1.java @@ -0,0 +1,29 @@ +// Code generated by lark suite 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 com.lark.oapi.service.mdm.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.mdm.v1.resource.UserAuthDataRelation; + +public class V1 { + private final UserAuthDataRelation userAuthDataRelation; // 数据维度 + + public V1(Config config) { + this.userAuthDataRelation = new UserAuthDataRelation(config); + } + + public UserAuthDataRelation userAuthDataRelation() { + return userAuthDataRelation; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/mdm/v1/resource/UserAuthDataRelation.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/mdm/v1/resource/UserAuthDataRelation.java new file mode 100644 index 000000000..a9a0d3e01 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/mdm/v1/resource/UserAuthDataRelation.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.mdm.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.mdm.v1.model.BindUserAuthDataRelationReq; +import com.lark.oapi.service.mdm.v1.model.BindUserAuthDataRelationResp; +import com.lark.oapi.service.mdm.v1.model.UnbindUserAuthDataRelationReq; +import com.lark.oapi.service.mdm.v1.model.UnbindUserAuthDataRelationResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class UserAuthDataRelation { + private static final Logger log = LoggerFactory.getLogger(UserAuthDataRelation.class); + private final Config config; + + public UserAuthDataRelation(Config config) { + this.config = config; + } + + + /** + * 用户数据维度绑定,通过该接口,可为指定应用下的用户绑定一类数据维度,支持批量给多个用户同时增量授权。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/mdm-v1/user_auth_data_relation/bind ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mdmv1/BindUserAuthDataRelationSample.java ; + */ + public BindUserAuthDataRelationResp bind(BindUserAuthDataRelationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mdm/v1/user_auth_data_relations/bind" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BindUserAuthDataRelationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BindUserAuthDataRelationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mdm/v1/user_auth_data_relations/bind" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 用户数据维度绑定,通过该接口,可为指定应用下的用户绑定一类数据维度,支持批量给多个用户同时增量授权。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/mdm-v1/user_auth_data_relation/bind ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mdmv1/BindUserAuthDataRelationSample.java ; + */ + public BindUserAuthDataRelationResp bind(BindUserAuthDataRelationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mdm/v1/user_auth_data_relations/bind" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BindUserAuthDataRelationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BindUserAuthDataRelationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mdm/v1/user_auth_data_relations/bind" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 用户数据维度解绑,通过该接口,可为指定应用下的指定用户解除一类数据维度。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/mdm-v1/user_auth_data_relation/unbind ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mdmv1/UnbindUserAuthDataRelationSample.java ; + */ + public UnbindUserAuthDataRelationResp unbind(UnbindUserAuthDataRelationReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mdm/v1/user_auth_data_relations/unbind" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UnbindUserAuthDataRelationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnbindUserAuthDataRelationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mdm/v1/user_auth_data_relations/unbind" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 用户数据维度解绑,通过该接口,可为指定应用下的指定用户解除一类数据维度。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/mdm-v1/user_auth_data_relation/unbind ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/mdmv1/UnbindUserAuthDataRelationSample.java ; + */ + public UnbindUserAuthDataRelationResp unbind(UnbindUserAuthDataRelationReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/mdm/v1/user_auth_data_relations/unbind" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + UnbindUserAuthDataRelationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UnbindUserAuthDataRelationResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/mdm/v1/user_auth_data_relations/unbind" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/meeting_room/v1/MeetingRoomService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/meeting_room/MeetingRoomService.java similarity index 87% rename from larksuite-oapi/src/main/java/com/lark/oapi/service/meeting_room/v1/MeetingRoomService.java rename to larksuite-oapi/src/main/java/com/lark/oapi/service/meeting_room/MeetingRoomService.java index 48e3bb260..f021720b5 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/meeting_room/v1/MeetingRoomService.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/meeting_room/MeetingRoomService.java @@ -10,38 +10,29 @@ * * 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 com.lark.oapi.service.meeting_room.v1; +package com.lark.oapi.service.meeting_room; import com.lark.oapi.core.Config; import com.lark.oapi.event.IEventHandler; +import com.lark.oapi.service.meeting_room.v1.V1; import com.lark.oapi.service.meeting_room.v1.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import com.lark.oapi.service.meeting_room.v1.resource.MeetingRoom; public class MeetingRoomService { - private static final Logger log = LoggerFactory.getLogger(MeetingRoomService.class); + private final V1 v1; private final MeetingRoom meetingRoom; // 事件 public MeetingRoomService(Config config) { + this.v1 = new V1(config); this.meetingRoom = new MeetingRoom(config); } - /** - * 事件 - * - * @return - */ - public MeetingRoom meetingRoom() { - return meetingRoom; + public V1 v1() { + return v1; } - public static class MeetingRoom { - private final Config config; - - public MeetingRoom(Config config) { - this.config = config; - } + public MeetingRoom meetingRoom() { + return meetingRoom; } public abstract static class P2MeetingRoomCreatedV1Handler implements IEventHandler { diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/meeting_room/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/meeting_room/v1/V1.java new file mode 100644 index 000000000..e33de5f23 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/meeting_room/v1/V1.java @@ -0,0 +1,29 @@ +// Code generated by lark suite 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 com.lark.oapi.service.meeting_room.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.meeting_room.v1.resource.MeetingRoom; + +public class V1 { + private final MeetingRoom meetingRoom; // 事件 + + public V1(Config config) { + this.meetingRoom = new MeetingRoom(config); + } + + public MeetingRoom meetingRoom() { + return meetingRoom; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/meeting_room/v1/resource/MeetingRoom.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/meeting_room/v1/resource/MeetingRoom.java new file mode 100644 index 000000000..a94df5d34 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/meeting_room/v1/resource/MeetingRoom.java @@ -0,0 +1,29 @@ +// Code generated by lark suite 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 com.lark.oapi.service.meeting_room.v1.resource; + +import com.lark.oapi.core.Config; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class MeetingRoom { + private static final Logger log = LoggerFactory.getLogger(MeetingRoom.class); + private final Config config; + + public MeetingRoom(Config config) { + this.config = config; + } + + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/okr/OkrService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/okr/OkrService.java new file mode 100644 index 000000000..14b6a2c81 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/okr/OkrService.java @@ -0,0 +1,59 @@ +// Code generated by lark suite 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 com.lark.oapi.service.okr; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.okr.v1.V1; +import com.lark.oapi.service.okr.v1.resource.*; + +public class OkrService { + private final V1 v1; + private final Image image; // 图片 + private final Okr okr; // OKR + private final Period period; // OKR周期 + private final ProgressRecord progressRecord; // OKR进展记录 + private final UserOkr userOkr; // 用户OKR + + public OkrService(Config config) { + this.v1 = new V1(config); + this.image = new Image(config); + this.okr = new Okr(config); + this.period = new Period(config); + this.progressRecord = new ProgressRecord(config); + this.userOkr = new UserOkr(config); + } + + public V1 v1() { + return v1; + } + + public Image image() { + return image; + } + + public Okr okr() { + return okr; + } + + public Period period() { + return period; + } + + public ProgressRecord progressRecord() { + return progressRecord; + } + + public UserOkr userOkr() { + return userOkr; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/OkrService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/OkrService.java deleted file mode 100644 index fc1eeb6b7..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/OkrService.java +++ /dev/null @@ -1,667 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.okr.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.okr.v1.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class OkrService { - private static final Logger log = LoggerFactory.getLogger(OkrService.class); - private final Image image; // 图片 - private final Okr okr; // OKR - private final Period period; // OKR周期 - private final ProgressRecord progressRecord; // OKR进展记录 - private final UserOkr userOkr; // 用户OKR - - public OkrService(Config config) { - this.image = new Image(config); - this.okr = new Okr(config); - this.period = new Period(config); - this.progressRecord = new ProgressRecord(config); - this.userOkr = new UserOkr(config); - } - - /** - * 图片 - * - * @return - */ - public Image image() { - return image; - } - - /** - * OKR - * - * @return - */ - public Okr okr() { - return okr; - } - - /** - * OKR周期 - * - * @return - */ - public Period period() { - return period; - } - - /** - * OKR进展记录 - * - * @return - */ - public ProgressRecord progressRecord() { - return progressRecord; - } - - /** - * 用户OKR - * - * @return - */ - public UserOkr userOkr() { - return userOkr; - } - - public static class Image { - private final Config config; - - public Image(Config config) { - this.config = config; - } - - /** - * 上传图片,上传图片 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/image/upload ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/UploadImageSample.java ; - */ - public UploadImageResp upload(UploadImageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/okr/v1/images/upload" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UploadImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadImageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/images/upload" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 上传图片,上传图片 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/image/upload ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/UploadImageSample.java ; - */ - public UploadImageResp upload(UploadImageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportUpload(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/okr/v1/images/upload" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UploadImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadImageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/images/upload" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Okr { - private final Config config; - - public Okr(Config config) { - this.config = config; - } - - /** - * 批量获取OKR,根据OKR id批量获取OKR - *

使用tenant_access_token需要额外申请权限以应用身份访问OKR信息 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/okr/batch_get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/BatchGetOkrSample.java ; - */ - public BatchGetOkrResp batchGet(BatchGetOkrReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/okr/v1/okrs/batch_get" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchGetOkrResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetOkrResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/okrs/batch_get" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量获取OKR,根据OKR id批量获取OKR - *

使用tenant_access_token需要额外申请权限以应用身份访问OKR信息 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/okr/batch_get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/BatchGetOkrSample.java ; - */ - public BatchGetOkrResp batchGet(BatchGetOkrReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/okr/v1/okrs/batch_get" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchGetOkrResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetOkrResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/okrs/batch_get" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Period { - private final Config config; - - public Period(Config config) { - this.config = config; - } - - /** - * 获取OKR周期列表,获取OKR周期列表 - *

使用tenant_access_token需要额外申请权限以应用身份访问OKR信息 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/period/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/ListPeriodSample.java ; - */ - public ListPeriodResp list(ListPeriodReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/okr/v1/periods" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListPeriodResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPeriodResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/periods" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取OKR周期列表,获取OKR周期列表 - *

使用tenant_access_token需要额外申请权限以应用身份访问OKR信息 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/period/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/ListPeriodSample.java ; - */ - public ListPeriodResp list(ListPeriodReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/okr/v1/periods" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListPeriodResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPeriodResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/periods" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ProgressRecord { - private final Config config; - - public ProgressRecord(Config config) { - this.config = config; - } - - /** - * 创建OKR进展记录,创建OKR进展记录 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/progress_record/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/CreateProgressRecordSample.java ; - */ - public CreateProgressRecordResp create(CreateProgressRecordReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/okr/v1/progress_records" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateProgressRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateProgressRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/progress_records" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建OKR进展记录,创建OKR进展记录 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/progress_record/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/CreateProgressRecordSample.java ; - */ - public CreateProgressRecordResp create(CreateProgressRecordReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/okr/v1/progress_records" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateProgressRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateProgressRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/progress_records" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除OKR进展记录,根据ID删除OKR进展记录 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/progress_record/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/DeleteProgressRecordSample.java ; - */ - public DeleteProgressRecordResp delete(DeleteProgressRecordReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/okr/v1/progress_records/:progress_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteProgressRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteProgressRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/progress_records/:progress_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除OKR进展记录,根据ID删除OKR进展记录 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/progress_record/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/DeleteProgressRecordSample.java ; - */ - public DeleteProgressRecordResp delete(DeleteProgressRecordReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/okr/v1/progress_records/:progress_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteProgressRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteProgressRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/progress_records/:progress_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取OKR进展记录,根据ID获取OKR进展记录详情 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/progress_record/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/GetProgressRecordSample.java ; - */ - public GetProgressRecordResp get(GetProgressRecordReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/okr/v1/progress_records/:progress_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetProgressRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetProgressRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/progress_records/:progress_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取OKR进展记录,根据ID获取OKR进展记录详情 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/progress_record/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/GetProgressRecordSample.java ; - */ - public GetProgressRecordResp get(GetProgressRecordReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/okr/v1/progress_records/:progress_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetProgressRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetProgressRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/progress_records/:progress_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新OKR进展记录,根据OKR进展记录ID更新进展详情 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/progress_record/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/UpdateProgressRecordSample.java ; - */ - public UpdateProgressRecordResp update(UpdateProgressRecordReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/okr/v1/progress_records/:progress_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UpdateProgressRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateProgressRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/progress_records/:progress_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新OKR进展记录,根据OKR进展记录ID更新进展详情 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/progress_record/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/UpdateProgressRecordSample.java ; - */ - public UpdateProgressRecordResp update(UpdateProgressRecordReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/okr/v1/progress_records/:progress_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UpdateProgressRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateProgressRecordResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/progress_records/:progress_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class UserOkr { - private final Config config; - - public UserOkr(Config config) { - this.config = config; - } - - /** - * 获取用户的OKR列表,根据用户的id获取OKR列表 - *

使用tenant_access_token需要额外申请权限以应用身份访问OKR信息 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/user-okr/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/ListUserOkrSample.java ; - */ - public ListUserOkrResp list(ListUserOkrReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/okr/v1/users/:user_id/okrs" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListUserOkrResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListUserOkrResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/users/:user_id/okrs" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取用户的OKR列表,根据用户的id获取OKR列表 - *

使用tenant_access_token需要额外申请权限以应用身份访问OKR信息 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/user-okr/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/ListUserOkrSample.java ; - */ - public ListUserOkrResp list(ListUserOkrReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/okr/v1/users/:user_id/okrs" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListUserOkrResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListUserOkrResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/users/:user_id/okrs" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/V1.java new file mode 100644 index 000000000..0414a4646 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/V1.java @@ -0,0 +1,53 @@ +// Code generated by lark suite 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 com.lark.oapi.service.okr.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.okr.v1.resource.*; + +public class V1 { + private final Image image; // 图片 + private final Okr okr; // OKR + private final Period period; // OKR周期 + private final ProgressRecord progressRecord; // OKR进展记录 + private final UserOkr userOkr; // 用户OKR + + public V1(Config config) { + this.image = new Image(config); + this.okr = new Okr(config); + this.period = new Period(config); + this.progressRecord = new ProgressRecord(config); + this.userOkr = new UserOkr(config); + } + + public Image image() { + return image; + } + + public Okr okr() { + return okr; + } + + public Period period() { + return period; + } + + public ProgressRecord progressRecord() { + return progressRecord; + } + + public UserOkr userOkr() { + return userOkr; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/resource/Image.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/resource/Image.java new file mode 100644 index 000000000..ef398d881 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/resource/Image.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.okr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.okr.v1.model.UploadImageReq; +import com.lark.oapi.service.okr.v1.model.UploadImageResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Image { + private static final Logger log = LoggerFactory.getLogger(Image.class); + private final Config config; + + public Image(Config config) { + this.config = config; + } + + + /** + * 上传图片,上传图片 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/image/upload ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/UploadImageSample.java ; + */ + public UploadImageResp upload(UploadImageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/okr/v1/images/upload" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UploadImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadImageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/images/upload" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 上传图片,上传图片 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/image/upload ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/UploadImageSample.java ; + */ + public UploadImageResp upload(UploadImageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/okr/v1/images/upload" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UploadImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadImageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/images/upload" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/resource/Okr.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/resource/Okr.java new file mode 100644 index 000000000..5692c5100 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/resource/Okr.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.okr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.okr.v1.model.BatchGetOkrReq; +import com.lark.oapi.service.okr.v1.model.BatchGetOkrResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Okr { + private static final Logger log = LoggerFactory.getLogger(Okr.class); + private final Config config; + + public Okr(Config config) { + this.config = config; + } + + + /** + * 批量获取OKR,根据OKR id批量获取OKR + *

使用tenant_access_token需要额外申请权限以应用身份访问OKR信息 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/okr/batch_get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/BatchGetOkrSample.java ; + */ + public BatchGetOkrResp batchGet(BatchGetOkrReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/okr/v1/okrs/batch_get" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchGetOkrResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetOkrResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/okrs/batch_get" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量获取OKR,根据OKR id批量获取OKR + *

使用tenant_access_token需要额外申请权限以应用身份访问OKR信息 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/okr/batch_get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/BatchGetOkrSample.java ; + */ + public BatchGetOkrResp batchGet(BatchGetOkrReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/okr/v1/okrs/batch_get" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchGetOkrResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchGetOkrResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/okrs/batch_get" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/resource/Period.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/resource/Period.java new file mode 100644 index 000000000..6a2d4ba16 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/resource/Period.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.okr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.okr.v1.model.ListPeriodReq; +import com.lark.oapi.service.okr.v1.model.ListPeriodResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Period { + private static final Logger log = LoggerFactory.getLogger(Period.class); + private final Config config; + + public Period(Config config) { + this.config = config; + } + + + /** + * 获取OKR周期列表,获取OKR周期列表 + *

使用tenant_access_token需要额外申请权限以应用身份访问OKR信息 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/period/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/ListPeriodSample.java ; + */ + public ListPeriodResp list(ListPeriodReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/okr/v1/periods" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListPeriodResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPeriodResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/periods" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取OKR周期列表,获取OKR周期列表 + *

使用tenant_access_token需要额外申请权限以应用身份访问OKR信息 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/period/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/ListPeriodSample.java ; + */ + public ListPeriodResp list(ListPeriodReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/okr/v1/periods" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListPeriodResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListPeriodResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/periods" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/resource/ProgressRecord.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/resource/ProgressRecord.java new file mode 100644 index 000000000..17413cf7d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/resource/ProgressRecord.java @@ -0,0 +1,302 @@ +// Code generated by lark suite 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 com.lark.oapi.service.okr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.okr.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ProgressRecord { + private static final Logger log = LoggerFactory.getLogger(ProgressRecord.class); + private final Config config; + + public ProgressRecord(Config config) { + this.config = config; + } + + + /** + * 创建OKR进展记录,创建OKR进展记录 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/progress_record/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/CreateProgressRecordSample.java ; + */ + public CreateProgressRecordResp create(CreateProgressRecordReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/okr/v1/progress_records" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateProgressRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateProgressRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/progress_records" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建OKR进展记录,创建OKR进展记录 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/progress_record/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/CreateProgressRecordSample.java ; + */ + public CreateProgressRecordResp create(CreateProgressRecordReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/okr/v1/progress_records" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateProgressRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateProgressRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/progress_records" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除OKR进展记录,根据ID删除OKR进展记录 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/progress_record/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/DeleteProgressRecordSample.java ; + */ + public DeleteProgressRecordResp delete(DeleteProgressRecordReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/okr/v1/progress_records/:progress_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteProgressRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteProgressRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/progress_records/:progress_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除OKR进展记录,根据ID删除OKR进展记录 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/progress_record/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/DeleteProgressRecordSample.java ; + */ + public DeleteProgressRecordResp delete(DeleteProgressRecordReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/okr/v1/progress_records/:progress_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteProgressRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteProgressRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/progress_records/:progress_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取OKR进展记录,根据ID获取OKR进展记录详情 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/progress_record/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/GetProgressRecordSample.java ; + */ + public GetProgressRecordResp get(GetProgressRecordReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/okr/v1/progress_records/:progress_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetProgressRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetProgressRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/progress_records/:progress_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取OKR进展记录,根据ID获取OKR进展记录详情 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/progress_record/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/GetProgressRecordSample.java ; + */ + public GetProgressRecordResp get(GetProgressRecordReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/okr/v1/progress_records/:progress_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetProgressRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetProgressRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/progress_records/:progress_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新OKR进展记录,根据OKR进展记录ID更新进展详情 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/progress_record/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/UpdateProgressRecordSample.java ; + */ + public UpdateProgressRecordResp update(UpdateProgressRecordReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/okr/v1/progress_records/:progress_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UpdateProgressRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateProgressRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/progress_records/:progress_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新OKR进展记录,根据OKR进展记录ID更新进展详情 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/progress_record/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/UpdateProgressRecordSample.java ; + */ + public UpdateProgressRecordResp update(UpdateProgressRecordReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/okr/v1/progress_records/:progress_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UpdateProgressRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateProgressRecordResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/progress_records/:progress_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/resource/UserOkr.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/resource/UserOkr.java new file mode 100644 index 000000000..ea0ee122c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/okr/v1/resource/UserOkr.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.okr.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.okr.v1.model.ListUserOkrReq; +import com.lark.oapi.service.okr.v1.model.ListUserOkrResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class UserOkr { + private static final Logger log = LoggerFactory.getLogger(UserOkr.class); + private final Config config; + + public UserOkr(Config config) { + this.config = config; + } + + + /** + * 获取用户的OKR列表,根据用户的id获取OKR列表 + *

使用tenant_access_token需要额外申请权限以应用身份访问OKR信息 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/user-okr/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/ListUserOkrSample.java ; + */ + public ListUserOkrResp list(ListUserOkrReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/okr/v1/users/:user_id/okrs" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListUserOkrResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListUserOkrResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/users/:user_id/okrs" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取用户的OKR列表,根据用户的id获取OKR列表 + *

使用tenant_access_token需要额外申请权限以应用身份访问OKR信息 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/user-okr/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/ListUserOkrSample.java ; + */ + public ListUserOkrResp list(ListUserOkrReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/okr/v1/users/:user_id/okrs" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListUserOkrResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListUserOkrResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/okr/v1/users/:user_id/okrs" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/optical_char_recognition/OpticalCharRecognitionService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/optical_char_recognition/OpticalCharRecognitionService.java new file mode 100644 index 000000000..d8eb671b9 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/optical_char_recognition/OpticalCharRecognitionService.java @@ -0,0 +1,35 @@ +// Code generated by lark suite 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 com.lark.oapi.service.optical_char_recognition; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.optical_char_recognition.v1.V1; +import com.lark.oapi.service.optical_char_recognition.v1.resource.Image; + +public class OpticalCharRecognitionService { + private final V1 v1; + private final Image image; // 图片识别 + + public OpticalCharRecognitionService(Config config) { + this.v1 = new V1(config); + this.image = new Image(config); + } + + public V1 v1() { + return v1; + } + + public Image image() { + return image; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/optical_char_recognition/v1/OpticalCharRecognitionService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/optical_char_recognition/v1/OpticalCharRecognitionService.java deleted file mode 100644 index 03e1708f5..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/optical_char_recognition/v1/OpticalCharRecognitionService.java +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.optical_char_recognition.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.optical_char_recognition.v1.model.BasicRecognizeImageReq; -import com.lark.oapi.service.optical_char_recognition.v1.model.BasicRecognizeImageResp; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class OpticalCharRecognitionService { - private static final Logger log = LoggerFactory.getLogger(OpticalCharRecognitionService.class); - private final Image image; // 图片识别 - - public OpticalCharRecognitionService(Config config) { - this.image = new Image(config); - } - - /** - * 图片识别 - * - * @return - */ - public Image image() { - return image; - } - - public static class Image { - private final Config config; - - public Image(Config config) { - this.config = config; - } - - /** - * 基础图片识别 (OCR),可识别图片中的文字,按图片中的区域划分,分段返回文本列表 - *

单租户限流:20QPS,同租户下的应用没有限流,共享本租户的 20QPS 限流 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/optical_char_recognition-v1/image/basic_recognize ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/optical_char_recognitionv1/BasicRecognizeImageSample.java ; - */ - public BasicRecognizeImageResp basicRecognize(BasicRecognizeImageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/optical_char_recognition/v1/image/basic_recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BasicRecognizeImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BasicRecognizeImageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/optical_char_recognition/v1/image/basic_recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 基础图片识别 (OCR),可识别图片中的文字,按图片中的区域划分,分段返回文本列表 - *

单租户限流:20QPS,同租户下的应用没有限流,共享本租户的 20QPS 限流 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/optical_char_recognition-v1/image/basic_recognize ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/optical_char_recognitionv1/BasicRecognizeImageSample.java ; - */ - public BasicRecognizeImageResp basicRecognize(BasicRecognizeImageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/optical_char_recognition/v1/image/basic_recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BasicRecognizeImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BasicRecognizeImageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/optical_char_recognition/v1/image/basic_recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/optical_char_recognition/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/optical_char_recognition/v1/V1.java new file mode 100644 index 000000000..5477769e2 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/optical_char_recognition/v1/V1.java @@ -0,0 +1,29 @@ +// Code generated by lark suite 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 com.lark.oapi.service.optical_char_recognition.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.optical_char_recognition.v1.resource.Image; + +public class V1 { + private final Image image; // 图片识别 + + public V1(Config config) { + this.image = new Image(config); + } + + public Image image() { + return image; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/optical_char_recognition/v1/resource/Image.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/optical_char_recognition/v1/resource/Image.java new file mode 100644 index 000000000..2013086ae --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/optical_char_recognition/v1/resource/Image.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.optical_char_recognition.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.optical_char_recognition.v1.model.BasicRecognizeImageReq; +import com.lark.oapi.service.optical_char_recognition.v1.model.BasicRecognizeImageResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Image { + private static final Logger log = LoggerFactory.getLogger(Image.class); + private final Config config; + + public Image(Config config) { + this.config = config; + } + + + /** + * 基础图片识别 (OCR),可识别图片中的文字,按图片中的区域划分,分段返回文本列表 + *

单租户限流:20QPS,同租户下的应用没有限流,共享本租户的 20QPS 限流 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/optical_char_recognition-v1/image/basic_recognize ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/optical_char_recognitionv1/BasicRecognizeImageSample.java ; + */ + public BasicRecognizeImageResp basicRecognize(BasicRecognizeImageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/optical_char_recognition/v1/image/basic_recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BasicRecognizeImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BasicRecognizeImageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/optical_char_recognition/v1/image/basic_recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 基础图片识别 (OCR),可识别图片中的文字,按图片中的区域划分,分段返回文本列表 + *

单租户限流:20QPS,同租户下的应用没有限流,共享本租户的 20QPS 限流 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/optical_char_recognition-v1/image/basic_recognize ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/optical_char_recognitionv1/BasicRecognizeImageSample.java ; + */ + public BasicRecognizeImageResp basicRecognize(BasicRecognizeImageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/optical_char_recognition/v1/image/basic_recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BasicRecognizeImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BasicRecognizeImageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/optical_char_recognition/v1/image/basic_recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/passport/PassportService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/passport/PassportService.java new file mode 100644 index 000000000..2ef19fda0 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/passport/PassportService.java @@ -0,0 +1,35 @@ +// Code generated by lark suite 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 com.lark.oapi.service.passport; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.passport.v1.V1; +import com.lark.oapi.service.passport.v1.resource.Session; + +public class PassportService { + private final V1 v1; + private final Session session; // 登录态 + + public PassportService(Config config) { + this.v1 = new V1(config); + this.session = new Session(config); + } + + public V1 v1() { + return v1; + } + + public Session session() { + return session; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/passport/v1/PassportService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/passport/v1/PassportService.java deleted file mode 100644 index e45c62314..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/passport/v1/PassportService.java +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.passport.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.passport.v1.model.QuerySessionReq; -import com.lark.oapi.service.passport.v1.model.QuerySessionResp; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class PassportService { - private static final Logger log = LoggerFactory.getLogger(PassportService.class); - private final Session session; // 登录态 - - public PassportService(Config config) { - this.session = new Session(config); - } - - /** - * 登录态 - * - * @return - */ - public Session session() { - return session; - } - - public static class Session { - private final Config config; - - public Session(Config config) { - this.config = config; - } - - /** - * 批量获取用户登录信息(脱敏),该接口用于查询用户的登录信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/passport-v1/session/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/passportv1/QuerySessionSample.java ; - */ - public QuerySessionResp query(QuerySessionReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/passport/v1/sessions/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QuerySessionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QuerySessionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/passport/v1/sessions/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量获取用户登录信息(脱敏),该接口用于查询用户的登录信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/passport-v1/session/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/passportv1/QuerySessionSample.java ; - */ - public QuerySessionResp query(QuerySessionReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/passport/v1/sessions/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QuerySessionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QuerySessionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/passport/v1/sessions/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/passport/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/passport/v1/V1.java new file mode 100644 index 000000000..5f44448ab --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/passport/v1/V1.java @@ -0,0 +1,29 @@ +// Code generated by lark suite 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 com.lark.oapi.service.passport.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.passport.v1.resource.Session; + +public class V1 { + private final Session session; // 登录态 + + public V1(Config config) { + this.session = new Session(config); + } + + public Session session() { + return session; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/passport/v1/resource/Session.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/passport/v1/resource/Session.java new file mode 100644 index 000000000..e41c60ca1 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/passport/v1/resource/Session.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.passport.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.passport.v1.model.QuerySessionReq; +import com.lark.oapi.service.passport.v1.model.QuerySessionResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Session { + private static final Logger log = LoggerFactory.getLogger(Session.class); + private final Config config; + + public Session(Config config) { + this.config = config; + } + + + /** + * 批量获取用户登录信息(脱敏),该接口用于查询用户的登录信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/passport-v1/session/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/passportv1/QuerySessionSample.java ; + */ + public QuerySessionResp query(QuerySessionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/passport/v1/sessions/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QuerySessionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QuerySessionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/passport/v1/sessions/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量获取用户登录信息(脱敏),该接口用于查询用户的登录信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/passport-v1/session/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/passportv1/QuerySessionSample.java ; + */ + public QuerySessionResp query(QuerySessionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/passport/v1/sessions/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QuerySessionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QuerySessionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/passport/v1/sessions/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/personal_settings/PersonalSettingsService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/personal_settings/PersonalSettingsService.java new file mode 100644 index 000000000..78d7c0b88 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/personal_settings/PersonalSettingsService.java @@ -0,0 +1,35 @@ +// Code generated by lark suite 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 com.lark.oapi.service.personal_settings; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.personal_settings.v1.V1; +import com.lark.oapi.service.personal_settings.v1.resource.SystemStatus; + +public class PersonalSettingsService { + private final V1 v1; + private final SystemStatus systemStatus; // 系统状态 + + public PersonalSettingsService(Config config) { + this.v1 = new V1(config); + this.systemStatus = new SystemStatus(config); + } + + public V1 v1() { + return v1; + } + + public SystemStatus systemStatus() { + return systemStatus; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/personal_settings/v1/PersonalSettingsService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/personal_settings/v1/PersonalSettingsService.java deleted file mode 100644 index 14666f2cb..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/personal_settings/v1/PersonalSettingsService.java +++ /dev/null @@ -1,457 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.personal_settings.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.personal_settings.v1.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class PersonalSettingsService { - private static final Logger log = LoggerFactory.getLogger(PersonalSettingsService.class); - private final SystemStatus systemStatus; // 系统状态 - - public PersonalSettingsService(Config config) { - this.systemStatus = new SystemStatus(config); - } - - /** - * 系统状态 - * - * @return - */ - public SystemStatus systemStatus() { - return systemStatus; - } - - public static class SystemStatus { - private final Config config; - - public SystemStatus(Config config) { - this.config = config; - } - - /** - * 批量关闭系统状态,批量关闭用户系统状态可用 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/batch_close ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/BatchCloseSystemStatusSample.java ; - */ - public BatchCloseSystemStatusResp batchClose(BatchCloseSystemStatusReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_close" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchCloseSystemStatusResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCloseSystemStatusResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_close" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量关闭系统状态,批量关闭用户系统状态可用 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/batch_close ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/BatchCloseSystemStatusSample.java ; - */ - public BatchCloseSystemStatusResp batchClose(BatchCloseSystemStatusReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_close" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchCloseSystemStatusResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCloseSystemStatusResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_close" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量开启系统状态,批量开启用户系统状态可用 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/batch_open ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/BatchOpenSystemStatusSample.java ; - */ - public BatchOpenSystemStatusResp batchOpen(BatchOpenSystemStatusReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_open" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchOpenSystemStatusResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchOpenSystemStatusResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_open" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量开启系统状态,批量开启用户系统状态可用 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/batch_open ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/BatchOpenSystemStatusSample.java ; - */ - public BatchOpenSystemStatusResp batchOpen(BatchOpenSystemStatusReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_open" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - BatchOpenSystemStatusResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchOpenSystemStatusResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_open" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建系统状态,创建租户维度的系统状态。 - *

注意事项:;- 操作的数据为租户维度数据,请小心操作。;- 每个租户最多创建10个系统状态。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/CreateSystemStatusSample.java ; - */ - public CreateSystemStatusResp create(CreateSystemStatusReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/personal_settings/v1/system_statuses" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateSystemStatusResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSystemStatusResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/personal_settings/v1/system_statuses" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建系统状态,创建租户维度的系统状态。 - *

注意事项:;- 操作的数据为租户维度数据,请小心操作。;- 每个租户最多创建10个系统状态。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/CreateSystemStatusSample.java ; - */ - public CreateSystemStatusResp create(CreateSystemStatusReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/personal_settings/v1/system_statuses" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateSystemStatusResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSystemStatusResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/personal_settings/v1/system_statuses" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除系统状态,删除租户维度的系统状态。 - *

注意事项:;- 操作的数据为租户维度数据,请小心操作。 ;- 删除系统状态后,并不影响正在使用该状态用户下系统状态的客户端展示。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/DeleteSystemStatusSample.java ; - */ - public DeleteSystemStatusResp delete(DeleteSystemStatusReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/personal_settings/v1/system_statuses/:system_status_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteSystemStatusResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSystemStatusResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/personal_settings/v1/system_statuses/:system_status_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除系统状态,删除租户维度的系统状态。 - *

注意事项:;- 操作的数据为租户维度数据,请小心操作。 ;- 删除系统状态后,并不影响正在使用该状态用户下系统状态的客户端展示。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/DeleteSystemStatusSample.java ; - */ - public DeleteSystemStatusResp delete(DeleteSystemStatusReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/personal_settings/v1/system_statuses/:system_status_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteSystemStatusResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSystemStatusResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/personal_settings/v1/system_statuses/:system_status_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取系统状态,获取租户下所有系统状态 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/ListSystemStatusSample.java ; - */ - public ListSystemStatusResp list(ListSystemStatusReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/personal_settings/v1/system_statuses" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListSystemStatusResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListSystemStatusResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/personal_settings/v1/system_statuses" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取系统状态,获取租户下所有系统状态 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/ListSystemStatusSample.java ; - */ - public ListSystemStatusResp list(ListSystemStatusReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/personal_settings/v1/system_statuses" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListSystemStatusResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListSystemStatusResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/personal_settings/v1/system_statuses" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改系统状态,修改租户维度系统状态。 - *

注意事项:;- 操作的数据为租户维度数据,请小心操作。 ;- 修改系统状态后,并不影响正在使用的用户。该用户的系统状态可用时间到期后,再次被开启可用的时候,用户客户端才会同步到更新后的系统状态。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/PatchSystemStatusSample.java ; - */ - public PatchSystemStatusResp patch(PatchSystemStatusReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/personal_settings/v1/system_statuses/:system_status_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchSystemStatusResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchSystemStatusResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/personal_settings/v1/system_statuses/:system_status_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改系统状态,修改租户维度系统状态。 - *

注意事项:;- 操作的数据为租户维度数据,请小心操作。 ;- 修改系统状态后,并不影响正在使用的用户。该用户的系统状态可用时间到期后,再次被开启可用的时候,用户客户端才会同步到更新后的系统状态。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/PatchSystemStatusSample.java ; - */ - public PatchSystemStatusResp patch(PatchSystemStatusReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/personal_settings/v1/system_statuses/:system_status_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchSystemStatusResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchSystemStatusResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/personal_settings/v1/system_statuses/:system_status_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/personal_settings/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/personal_settings/v1/V1.java new file mode 100644 index 000000000..9769db1da --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/personal_settings/v1/V1.java @@ -0,0 +1,29 @@ +// Code generated by lark suite 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 com.lark.oapi.service.personal_settings.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.personal_settings.v1.resource.SystemStatus; + +public class V1 { + private final SystemStatus systemStatus; // 系统状态 + + public V1(Config config) { + this.systemStatus = new SystemStatus(config); + } + + public SystemStatus systemStatus() { + return systemStatus; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/personal_settings/v1/resource/SystemStatus.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/personal_settings/v1/resource/SystemStatus.java new file mode 100644 index 000000000..866769fc9 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/personal_settings/v1/resource/SystemStatus.java @@ -0,0 +1,440 @@ +// Code generated by lark suite 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 com.lark.oapi.service.personal_settings.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.personal_settings.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class SystemStatus { + private static final Logger log = LoggerFactory.getLogger(SystemStatus.class); + private final Config config; + + public SystemStatus(Config config) { + this.config = config; + } + + + /** + * 批量关闭系统状态,批量关闭用户系统状态可用 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/batch_close ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/BatchCloseSystemStatusSample.java ; + */ + public BatchCloseSystemStatusResp batchClose(BatchCloseSystemStatusReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_close" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchCloseSystemStatusResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCloseSystemStatusResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_close" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量关闭系统状态,批量关闭用户系统状态可用 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/batch_close ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/BatchCloseSystemStatusSample.java ; + */ + public BatchCloseSystemStatusResp batchClose(BatchCloseSystemStatusReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_close" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchCloseSystemStatusResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchCloseSystemStatusResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_close" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量开启系统状态,批量开启用户系统状态可用 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/batch_open ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/BatchOpenSystemStatusSample.java ; + */ + public BatchOpenSystemStatusResp batchOpen(BatchOpenSystemStatusReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_open" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchOpenSystemStatusResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchOpenSystemStatusResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_open" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量开启系统状态,批量开启用户系统状态可用 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/batch_open ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/BatchOpenSystemStatusSample.java ; + */ + public BatchOpenSystemStatusResp batchOpen(BatchOpenSystemStatusReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_open" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + BatchOpenSystemStatusResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchOpenSystemStatusResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_open" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建系统状态,创建租户维度的系统状态。 + *

注意事项:;- 操作的数据为租户维度数据,请小心操作。;- 每个租户最多创建10个系统状态。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/CreateSystemStatusSample.java ; + */ + public CreateSystemStatusResp create(CreateSystemStatusReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/personal_settings/v1/system_statuses" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateSystemStatusResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSystemStatusResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/personal_settings/v1/system_statuses" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建系统状态,创建租户维度的系统状态。 + *

注意事项:;- 操作的数据为租户维度数据,请小心操作。;- 每个租户最多创建10个系统状态。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/CreateSystemStatusSample.java ; + */ + public CreateSystemStatusResp create(CreateSystemStatusReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/personal_settings/v1/system_statuses" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateSystemStatusResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSystemStatusResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/personal_settings/v1/system_statuses" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除系统状态,删除租户维度的系统状态。 + *

注意事项:;- 操作的数据为租户维度数据,请小心操作。 ;- 删除系统状态后,并不影响正在使用该状态用户下系统状态的客户端展示。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/DeleteSystemStatusSample.java ; + */ + public DeleteSystemStatusResp delete(DeleteSystemStatusReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/personal_settings/v1/system_statuses/:system_status_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteSystemStatusResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSystemStatusResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/personal_settings/v1/system_statuses/:system_status_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除系统状态,删除租户维度的系统状态。 + *

注意事项:;- 操作的数据为租户维度数据,请小心操作。 ;- 删除系统状态后,并不影响正在使用该状态用户下系统状态的客户端展示。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/DeleteSystemStatusSample.java ; + */ + public DeleteSystemStatusResp delete(DeleteSystemStatusReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/personal_settings/v1/system_statuses/:system_status_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteSystemStatusResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSystemStatusResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/personal_settings/v1/system_statuses/:system_status_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取系统状态,获取租户下所有系统状态 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/ListSystemStatusSample.java ; + */ + public ListSystemStatusResp list(ListSystemStatusReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/personal_settings/v1/system_statuses" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListSystemStatusResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListSystemStatusResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/personal_settings/v1/system_statuses" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取系统状态,获取租户下所有系统状态 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/ListSystemStatusSample.java ; + */ + public ListSystemStatusResp list(ListSystemStatusReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/personal_settings/v1/system_statuses" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListSystemStatusResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListSystemStatusResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/personal_settings/v1/system_statuses" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改系统状态,修改租户维度系统状态。 + *

注意事项:;- 操作的数据为租户维度数据,请小心操作。 ;- 修改系统状态后,并不影响正在使用的用户。该用户的系统状态可用时间到期后,再次被开启可用的时候,用户客户端才会同步到更新后的系统状态。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/PatchSystemStatusSample.java ; + */ + public PatchSystemStatusResp patch(PatchSystemStatusReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/personal_settings/v1/system_statuses/:system_status_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchSystemStatusResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchSystemStatusResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/personal_settings/v1/system_statuses/:system_status_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改系统状态,修改租户维度系统状态。 + *

注意事项:;- 操作的数据为租户维度数据,请小心操作。 ;- 修改系统状态后,并不影响正在使用的用户。该用户的系统状态可用时间到期后,再次被开启可用的时候,用户客户端才会同步到更新后的系统状态。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/PatchSystemStatusSample.java ; + */ + public PatchSystemStatusResp patch(PatchSystemStatusReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/personal_settings/v1/system_statuses/:system_status_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchSystemStatusResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchSystemStatusResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/personal_settings/v1/system_statuses/:system_status_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/search/SearchService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/search/SearchService.java new file mode 100644 index 000000000..5037af90b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/search/SearchService.java @@ -0,0 +1,59 @@ +// Code generated by lark suite 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 com.lark.oapi.service.search; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.search.v2.V2; +import com.lark.oapi.service.search.v2.resource.*; + +public class SearchService { + private final V2 v2; + private final App app; // app + private final DataSource dataSource; // 数据源 + private final DataSourceItem dataSourceItem; // 数据项 + private final Message message; // message + private final Schema schema; // 数据范式 + + public SearchService(Config config) { + this.v2 = new V2(config); + this.app = new App(config); + this.dataSource = new DataSource(config); + this.dataSourceItem = new DataSourceItem(config); + this.message = new Message(config); + this.schema = new Schema(config); + } + + public V2 v2() { + return v2; + } + + public App app() { + return app; + } + + public DataSource dataSource() { + return dataSource; + } + + public DataSourceItem dataSourceItem() { + return dataSourceItem; + } + + public Message message() { + return message; + } + + public Schema schema() { + return schema; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/SearchService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/SearchService.java deleted file mode 100644 index e40591226..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/SearchService.java +++ /dev/null @@ -1,1055 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.search.v2; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.search.v2.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class SearchService { - private static final Logger log = LoggerFactory.getLogger(SearchService.class); - private final App app; // app - private final DataSource dataSource; // 数据源 - private final DataSourceItem dataSourceItem; // 数据项 - private final Message message; // message - private final Schema schema; // 数据范式 - - public SearchService(Config config) { - this.app = new App(config); - this.dataSource = new DataSource(config); - this.dataSourceItem = new DataSourceItem(config); - this.message = new Message(config); - this.schema = new Schema(config); - } - - /** - * app - * - * @return - */ - public App app() { - return app; - } - - /** - * 数据源 - * - * @return - */ - public DataSource dataSource() { - return dataSource; - } - - /** - * 数据项 - * - * @return - */ - public DataSourceItem dataSourceItem() { - return dataSourceItem; - } - - /** - * message - * - * @return - */ - public Message message() { - return message; - } - - /** - * 数据范式 - * - * @return - */ - public Schema schema() { - return schema; - } - - public static class App { - private final Config config; - - public App(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=search&resource=app&version=v2 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateAppSample.java ; - */ - public CreateAppResp create(CreateAppReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/search/v2/app" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - CreateAppResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/app" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=search&resource=app&version=v2 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateAppSample.java ; - */ - public CreateAppResp create(CreateAppReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/search/v2/app" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - CreateAppResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/app" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class DataSource { - private final Config config; - - public DataSource(Config config) { - this.config = config; - } - - /** - * 创建数据源,创建一个数据源 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateDataSourceSample.java ; - */ - public CreateDataSourceResp create(CreateDataSourceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/search/v2/data_sources" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateDataSourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDataSourceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建数据源,创建一个数据源 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateDataSourceSample.java ; - */ - public CreateDataSourceResp create(CreateDataSourceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/search/v2/data_sources" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateDataSourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDataSourceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除数据源,删除一个已存在的数据源 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/DeleteDataSourceSample.java ; - */ - public DeleteDataSourceResp delete(DeleteDataSourceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/search/v2/data_sources/:data_source_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteDataSourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteDataSourceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources/:data_source_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除数据源,删除一个已存在的数据源 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/DeleteDataSourceSample.java ; - */ - public DeleteDataSourceResp delete(DeleteDataSourceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/search/v2/data_sources/:data_source_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteDataSourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteDataSourceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources/:data_source_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取数据源,获取已经创建的数据源 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/GetDataSourceSample.java ; - */ - public GetDataSourceResp get(GetDataSourceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/search/v2/data_sources/:data_source_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetDataSourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDataSourceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources/:data_source_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取数据源,获取已经创建的数据源 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/GetDataSourceSample.java ; - */ - public GetDataSourceResp get(GetDataSourceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/search/v2/data_sources/:data_source_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetDataSourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDataSourceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources/:data_source_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量获取数据源,批量获取创建的数据源信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/ListDataSourceSample.java ; - */ - public ListDataSourceResp list(ListDataSourceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/search/v2/data_sources" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListDataSourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDataSourceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量获取数据源,批量获取创建的数据源信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/ListDataSourceSample.java ; - */ - public ListDataSourceResp list(ListDataSourceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/search/v2/data_sources" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListDataSourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDataSourceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改数据源,更新一个已经存在的数据源 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/PatchDataSourceSample.java ; - */ - public PatchDataSourceResp patch(PatchDataSourceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/search/v2/data_sources/:data_source_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchDataSourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchDataSourceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources/:data_source_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改数据源,更新一个已经存在的数据源 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/PatchDataSourceSample.java ; - */ - public PatchDataSourceResp patch(PatchDataSourceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/search/v2/data_sources/:data_source_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchDataSourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchDataSourceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources/:data_source_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class DataSourceItem { - private final Config config; - - public DataSourceItem(Config config) { - this.config = config; - } - - /** - * 索引数据项,索引一条数据记录 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source-item/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateDataSourceItemSample.java ; - */ - public CreateDataSourceItemResp create(CreateDataSourceItemReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/search/v2/data_sources/:data_source_id/items" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateDataSourceItemResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDataSourceItemResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources/:data_source_id/items" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 索引数据项,索引一条数据记录 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source-item/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateDataSourceItemSample.java ; - */ - public CreateDataSourceItemResp create(CreateDataSourceItemReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/search/v2/data_sources/:data_source_id/items" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateDataSourceItemResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDataSourceItemResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources/:data_source_id/items" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除数据项,删除数据项 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source-item/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/DeleteDataSourceItemSample.java ; - */ - public DeleteDataSourceItemResp delete(DeleteDataSourceItemReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/search/v2/data_sources/:data_source_id/items/:item_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteDataSourceItemResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteDataSourceItemResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources/:data_source_id/items/:item_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除数据项,删除数据项 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source-item/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/DeleteDataSourceItemSample.java ; - */ - public DeleteDataSourceItemResp delete(DeleteDataSourceItemReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/search/v2/data_sources/:data_source_id/items/:item_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteDataSourceItemResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteDataSourceItemResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources/:data_source_id/items/:item_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取数据项,获取单个数据记录 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source-item/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/GetDataSourceItemSample.java ; - */ - public GetDataSourceItemResp get(GetDataSourceItemReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/search/v2/data_sources/:data_source_id/items/:item_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetDataSourceItemResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDataSourceItemResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources/:data_source_id/items/:item_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取数据项,获取单个数据记录 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source-item/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/GetDataSourceItemSample.java ; - */ - public GetDataSourceItemResp get(GetDataSourceItemReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/search/v2/data_sources/:data_source_id/items/:item_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetDataSourceItemResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDataSourceItemResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources/:data_source_id/items/:item_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Message { - private final Config config; - - public Message(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=search&resource=message&version=v2 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateMessageSample.java ; - */ - public CreateMessageResp create(CreateMessageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/search/v2/message" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - CreateMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/message" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=search&resource=message&version=v2 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateMessageSample.java ; - */ - public CreateMessageResp create(CreateMessageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/search/v2/message" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - CreateMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMessageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/message" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Schema { - private final Config config; - - public Schema(Config config) { - this.config = config; - } - - /** - * 创建数据范式,创建一个数据范式 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/schema/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateSchemaSample.java ; - */ - public CreateSchemaResp create(CreateSchemaReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/search/v2/schemas" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSchemaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/schemas" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建数据范式,创建一个数据范式 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/schema/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateSchemaSample.java ; - */ - public CreateSchemaResp create(CreateSchemaReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/search/v2/schemas" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSchemaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/schemas" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除数据范式,删除已存在的数据范式 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/schema/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/DeleteSchemaSample.java ; - */ - public DeleteSchemaResp delete(DeleteSchemaReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/search/v2/schemas/:schema_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSchemaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/schemas/:schema_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除数据范式,删除已存在的数据范式 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/schema/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/DeleteSchemaSample.java ; - */ - public DeleteSchemaResp delete(DeleteSchemaReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/search/v2/schemas/:schema_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSchemaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/schemas/:schema_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取数据范式,获取单个数据范式 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/schema/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/GetSchemaSample.java ; - */ - public GetSchemaResp get(GetSchemaReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/search/v2/schemas/:schema_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSchemaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/schemas/:schema_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取数据范式,获取单个数据范式 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/schema/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/GetSchemaSample.java ; - */ - public GetSchemaResp get(GetSchemaReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/search/v2/schemas/:schema_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSchemaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/schemas/:schema_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改数据范式,修改数据范式 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/schema/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/PatchSchemaSample.java ; - */ - public PatchSchemaResp patch(PatchSchemaReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/search/v2/schemas/:schema_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchSchemaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/schemas/:schema_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改数据范式,修改数据范式 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/schema/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/PatchSchemaSample.java ; - */ - public PatchSchemaResp patch(PatchSchemaReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/search/v2/schemas/:schema_id" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - PatchSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchSchemaResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/schemas/:schema_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/V2.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/V2.java new file mode 100644 index 000000000..3e8e5749b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/V2.java @@ -0,0 +1,53 @@ +// Code generated by lark suite 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 com.lark.oapi.service.search.v2; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.search.v2.resource.*; + +public class V2 { + private final App app; // app + private final DataSource dataSource; // 数据源 + private final DataSourceItem dataSourceItem; // 数据项 + private final Message message; // message + private final Schema schema; // 数据范式 + + public V2(Config config) { + this.app = new App(config); + this.dataSource = new DataSource(config); + this.dataSourceItem = new DataSourceItem(config); + this.message = new Message(config); + this.schema = new Schema(config); + } + + public App app() { + return app; + } + + public DataSource dataSource() { + return dataSource; + } + + public DataSourceItem dataSourceItem() { + return dataSourceItem; + } + + public Message message() { + return message; + } + + public Schema schema() { + return schema; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/model/SeperatePassage.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/model/SeperatePassage.java new file mode 100644 index 000000000..9b6588f68 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/model/SeperatePassage.java @@ -0,0 +1,185 @@ +// Code generated by lark suite 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 com.lark.oapi.service.search.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class SeperatePassage { + /** + * passage_id + *

示例值:6953165194634772508 + */ + @SerializedName("passage_id") + private String passageId; + /** + * obj_id + *

示例值:6953165194634772508 + */ + @SerializedName("obj_id") + private String objId; + /** + * 内容 + *

示例值:这是一段passage + */ + @SerializedName("content") + private String content; + /** + * passage的token数量 + *

示例值:12 + */ + @SerializedName("num_tokens") + private Integer numTokens; + + // builder 开始 + public SeperatePassage() { + } + + public SeperatePassage(Builder builder) { + /** + * passage_id + *

示例值:6953165194634772508 + */ + this.passageId = builder.passageId; + /** + * obj_id + *

示例值:6953165194634772508 + */ + this.objId = builder.objId; + /** + * 内容 + *

示例值:这是一段passage + */ + this.content = builder.content; + /** + * passage的token数量 + *

示例值:12 + */ + this.numTokens = builder.numTokens; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getPassageId() { + return this.passageId; + } + + public void setPassageId(String passageId) { + this.passageId = passageId; + } + + public String getObjId() { + return this.objId; + } + + public void setObjId(String objId) { + this.objId = objId; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public Integer getNumTokens() { + return this.numTokens; + } + + public void setNumTokens(Integer numTokens) { + this.numTokens = numTokens; + } + + public static class Builder { + /** + * passage_id + *

示例值:6953165194634772508 + */ + private String passageId; + /** + * obj_id + *

示例值:6953165194634772508 + */ + private String objId; + /** + * 内容 + *

示例值:这是一段passage + */ + private String content; + /** + * passage的token数量 + *

示例值:12 + */ + private Integer numTokens; + + /** + * passage_id + *

示例值:6953165194634772508 + * + * @param passageId + * @return + */ + public Builder passageId(String passageId) { + this.passageId = passageId; + return this; + } + + + /** + * obj_id + *

示例值:6953165194634772508 + * + * @param objId + * @return + */ + public Builder objId(String objId) { + this.objId = objId; + return this; + } + + + /** + * 内容 + *

示例值:这是一段passage + * + * @param content + * @return + */ + public Builder content(String content) { + this.content = content; + return this; + } + + + /** + * passage的token数量 + *

示例值:12 + * + * @param numTokens + * @return + */ + public Builder numTokens(Integer numTokens) { + this.numTokens = numTokens; + return this; + } + + + public SeperatePassage build() { + return new SeperatePassage(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/resource/App.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/resource/App.java new file mode 100644 index 000000000..5ea6308b0 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/resource/App.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.search.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.search.v2.model.CreateAppReq; +import com.lark.oapi.service.search.v2.model.CreateAppResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class App { + private static final Logger log = LoggerFactory.getLogger(App.class); + private final Config config; + + public App(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=search&resource=app&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateAppSample.java ; + */ + public CreateAppResp create(CreateAppReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/search/v2/app" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + CreateAppResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/app" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=search&resource=app&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateAppSample.java ; + */ + public CreateAppResp create(CreateAppReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/search/v2/app" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + CreateAppResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateAppResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/app" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/resource/DataSource.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/resource/DataSource.java new file mode 100644 index 000000000..92e0da9a4 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/resource/DataSource.java @@ -0,0 +1,368 @@ +// Code generated by lark suite 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 com.lark.oapi.service.search.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.search.v2.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class DataSource { + private static final Logger log = LoggerFactory.getLogger(DataSource.class); + private final Config config; + + public DataSource(Config config) { + this.config = config; + } + + + /** + * 创建数据源,创建一个数据源 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateDataSourceSample.java ; + */ + public CreateDataSourceResp create(CreateDataSourceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/search/v2/data_sources" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateDataSourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDataSourceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建数据源,创建一个数据源 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateDataSourceSample.java ; + */ + public CreateDataSourceResp create(CreateDataSourceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/search/v2/data_sources" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateDataSourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDataSourceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除数据源,删除一个已存在的数据源 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/DeleteDataSourceSample.java ; + */ + public DeleteDataSourceResp delete(DeleteDataSourceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/search/v2/data_sources/:data_source_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteDataSourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteDataSourceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources/:data_source_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除数据源,删除一个已存在的数据源 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/DeleteDataSourceSample.java ; + */ + public DeleteDataSourceResp delete(DeleteDataSourceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/search/v2/data_sources/:data_source_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteDataSourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteDataSourceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources/:data_source_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取数据源,获取已经创建的数据源 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/GetDataSourceSample.java ; + */ + public GetDataSourceResp get(GetDataSourceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/search/v2/data_sources/:data_source_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetDataSourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDataSourceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources/:data_source_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取数据源,获取已经创建的数据源 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/GetDataSourceSample.java ; + */ + public GetDataSourceResp get(GetDataSourceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/search/v2/data_sources/:data_source_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetDataSourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDataSourceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources/:data_source_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量获取数据源,批量获取创建的数据源信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/ListDataSourceSample.java ; + */ + public ListDataSourceResp list(ListDataSourceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/search/v2/data_sources" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListDataSourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDataSourceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量获取数据源,批量获取创建的数据源信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/ListDataSourceSample.java ; + */ + public ListDataSourceResp list(ListDataSourceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/search/v2/data_sources" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListDataSourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDataSourceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改数据源,更新一个已经存在的数据源 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/PatchDataSourceSample.java ; + */ + public PatchDataSourceResp patch(PatchDataSourceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/search/v2/data_sources/:data_source_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchDataSourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchDataSourceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources/:data_source_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改数据源,更新一个已经存在的数据源 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/PatchDataSourceSample.java ; + */ + public PatchDataSourceResp patch(PatchDataSourceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/search/v2/data_sources/:data_source_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchDataSourceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchDataSourceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources/:data_source_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/resource/DataSourceItem.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/resource/DataSourceItem.java new file mode 100644 index 000000000..17f138a65 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/resource/DataSourceItem.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.search.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.search.v2.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class DataSourceItem { + private static final Logger log = LoggerFactory.getLogger(DataSourceItem.class); + private final Config config; + + public DataSourceItem(Config config) { + this.config = config; + } + + + /** + * 索引数据项,索引一条数据记录 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source-item/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateDataSourceItemSample.java ; + */ + public CreateDataSourceItemResp create(CreateDataSourceItemReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/search/v2/data_sources/:data_source_id/items" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateDataSourceItemResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDataSourceItemResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources/:data_source_id/items" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 索引数据项,索引一条数据记录 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source-item/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateDataSourceItemSample.java ; + */ + public CreateDataSourceItemResp create(CreateDataSourceItemReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/search/v2/data_sources/:data_source_id/items" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateDataSourceItemResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateDataSourceItemResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources/:data_source_id/items" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除数据项,删除数据项 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source-item/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/DeleteDataSourceItemSample.java ; + */ + public DeleteDataSourceItemResp delete(DeleteDataSourceItemReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/search/v2/data_sources/:data_source_id/items/:item_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteDataSourceItemResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteDataSourceItemResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources/:data_source_id/items/:item_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除数据项,删除数据项 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source-item/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/DeleteDataSourceItemSample.java ; + */ + public DeleteDataSourceItemResp delete(DeleteDataSourceItemReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/search/v2/data_sources/:data_source_id/items/:item_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteDataSourceItemResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteDataSourceItemResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources/:data_source_id/items/:item_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取数据项,获取单个数据记录 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source-item/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/GetDataSourceItemSample.java ; + */ + public GetDataSourceItemResp get(GetDataSourceItemReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/search/v2/data_sources/:data_source_id/items/:item_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetDataSourceItemResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDataSourceItemResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources/:data_source_id/items/:item_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取数据项,获取单个数据记录 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source-item/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/GetDataSourceItemSample.java ; + */ + public GetDataSourceItemResp get(GetDataSourceItemReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/search/v2/data_sources/:data_source_id/items/:item_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetDataSourceItemResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDataSourceItemResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/data_sources/:data_source_id/items/:item_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/resource/Message.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/resource/Message.java new file mode 100644 index 000000000..1be0dee79 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/resource/Message.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.search.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.search.v2.model.CreateMessageReq; +import com.lark.oapi.service.search.v2.model.CreateMessageResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Message { + private static final Logger log = LoggerFactory.getLogger(Message.class); + private final Config config; + + public Message(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=search&resource=message&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateMessageSample.java ; + */ + public CreateMessageResp create(CreateMessageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/search/v2/message" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + CreateMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/message" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=search&resource=message&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateMessageSample.java ; + */ + public CreateMessageResp create(CreateMessageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/search/v2/message" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + CreateMessageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateMessageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/message" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/resource/Schema.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/resource/Schema.java new file mode 100644 index 000000000..065a32cbd --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/search/v2/resource/Schema.java @@ -0,0 +1,302 @@ +// Code generated by lark suite 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 com.lark.oapi.service.search.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.search.v2.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Schema { + private static final Logger log = LoggerFactory.getLogger(Schema.class); + private final Config config; + + public Schema(Config config) { + this.config = config; + } + + + /** + * 创建数据范式,创建一个数据范式 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/schema/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateSchemaSample.java ; + */ + public CreateSchemaResp create(CreateSchemaReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/search/v2/schemas" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSchemaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/schemas" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建数据范式,创建一个数据范式 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/schema/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateSchemaSample.java ; + */ + public CreateSchemaResp create(CreateSchemaReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/search/v2/schemas" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSchemaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/schemas" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除数据范式,删除已存在的数据范式 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/schema/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/DeleteSchemaSample.java ; + */ + public DeleteSchemaResp delete(DeleteSchemaReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/search/v2/schemas/:schema_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSchemaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/schemas/:schema_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除数据范式,删除已存在的数据范式 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/schema/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/DeleteSchemaSample.java ; + */ + public DeleteSchemaResp delete(DeleteSchemaReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/search/v2/schemas/:schema_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSchemaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/schemas/:schema_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取数据范式,获取单个数据范式 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/schema/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/GetSchemaSample.java ; + */ + public GetSchemaResp get(GetSchemaReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/search/v2/schemas/:schema_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSchemaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/schemas/:schema_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取数据范式,获取单个数据范式 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/schema/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/GetSchemaSample.java ; + */ + public GetSchemaResp get(GetSchemaReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/search/v2/schemas/:schema_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSchemaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/schemas/:schema_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改数据范式,修改数据范式 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/schema/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/PatchSchemaSample.java ; + */ + public PatchSchemaResp patch(PatchSchemaReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/search/v2/schemas/:schema_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchSchemaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/schemas/:schema_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改数据范式,修改数据范式 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/schema/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/PatchSchemaSample.java ; + */ + public PatchSchemaResp patch(PatchSchemaReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/search/v2/schemas/:schema_id" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + PatchSchemaResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchSchemaResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/search/v2/schemas/:schema_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/SecurityAndComplianceService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/SecurityAndComplianceService.java new file mode 100644 index 000000000..685e4f3af --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/SecurityAndComplianceService.java @@ -0,0 +1,35 @@ +// Code generated by lark suite 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 com.lark.oapi.service.security_and_compliance; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.security_and_compliance.v1.V1; +import com.lark.oapi.service.security_and_compliance.v1.resource.OpenapiLog; + +public class SecurityAndComplianceService { + private final V1 v1; + private final OpenapiLog openapiLog; // openapi_log + + public SecurityAndComplianceService(Config config) { + this.v1 = new V1(config); + this.openapiLog = new OpenapiLog(config); + } + + public V1 v1() { + return v1; + } + + public OpenapiLog openapiLog() { + return openapiLog; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/SecurityAndComplianceService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/SecurityAndComplianceService.java deleted file mode 100644 index b0da047c5..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/SecurityAndComplianceService.java +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.security_and_compliance.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.security_and_compliance.v1.model.ListDataOpenapiLogReq; -import com.lark.oapi.service.security_and_compliance.v1.model.ListDataOpenapiLogResp; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class SecurityAndComplianceService { - private static final Logger log = LoggerFactory.getLogger(SecurityAndComplianceService.class); - private final OpenapiLog openapiLog; // openapi_log - - public SecurityAndComplianceService(Config config) { - this.openapiLog = new OpenapiLog(config); - } - - /** - * openapi_log - * - * @return - */ - public OpenapiLog openapiLog() { - return openapiLog; - } - - public static class OpenapiLog { - private final Config config; - - public OpenapiLog(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list_data&project=security_and_compliance&resource=openapi_log&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/security_and_compliancev1/ListDataOpenapiLogSample.java ; - */ - public ListDataOpenapiLogResp listData(ListDataOpenapiLogReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/security_and_compliance/v1/openapi_logs/list_data" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListDataOpenapiLogResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDataOpenapiLogResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/security_and_compliance/v1/openapi_logs/list_data" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list_data&project=security_and_compliance&resource=openapi_log&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/security_and_compliancev1/ListDataOpenapiLogSample.java ; - */ - public ListDataOpenapiLogResp listData(ListDataOpenapiLogReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/security_and_compliance/v1/openapi_logs/list_data" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListDataOpenapiLogResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDataOpenapiLogResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/security_and_compliance/v1/openapi_logs/list_data" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/V1.java new file mode 100644 index 000000000..781dbc358 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/V1.java @@ -0,0 +1,29 @@ +// Code generated by lark suite 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 com.lark.oapi.service.security_and_compliance.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.security_and_compliance.v1.resource.OpenapiLog; + +public class V1 { + private final OpenapiLog openapiLog; // openapi_log + + public V1(Config config) { + this.openapiLog = new OpenapiLog(config); + } + + public OpenapiLog openapiLog() { + return openapiLog; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/CreateMigrationEntityLocationEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/CreateMigrationEntityLocationEnum.java new file mode 100644 index 000000000..cf878b26a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/CreateMigrationEntityLocationEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.security_and_compliance.v1.enums; + +/** + * 实体的数据驻留地 + */ +public enum CreateMigrationEntityLocationEnum { + CN("CN"), // 中国 + SG("SG"), // 新加坡 + JP("JP"), // 日本 + ; + private String value; + + CreateMigrationEntityLocationEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/CreateMigrationItemsTaskStatusEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/CreateMigrationItemsTaskStatusEnum.java new file mode 100644 index 000000000..cd8f7291c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/CreateMigrationItemsTaskStatusEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.security_and_compliance.v1.enums; + +/** + * 任务状态。任务创建成功固定返回 create ,若已存在其他待执行任务,则返回已存在任务的状态 + */ +public enum CreateMigrationItemsTaskStatusEnum { + CREATE("create"), // 迁移创建完成 + COMPLETE("complete"), // 迁移已完成 + STOP("stop"), // 迁移已停止 + ; + private String value; + + CreateMigrationItemsTaskStatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/DataArchivingUserStructDataArchivingChatterTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/DataArchivingUserStructDataArchivingChatterTypeEnum.java new file mode 100644 index 000000000..6461c6a9d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/DataArchivingUserStructDataArchivingChatterTypeEnum.java @@ -0,0 +1,35 @@ +// Code generated by lark suite 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 com.lark.oapi.service.security_and_compliance.v1.enums; + +/** + * 类型 + */ +public enum DataArchivingUserStructDataArchivingChatterTypeEnum { + USER("User"), // 用户类型 + BOT("Bot"), // 机器人类型 + SYSTEM("System"), // 系统类型 + AI("AI"), // AI类型 + UNKNOW("Unknow"), // 未知类型 + ; + private String value; + + DataArchivingUserStructDataArchivingChatterTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/DirectoryItemsEntityLocationEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/DirectoryItemsEntityLocationEnum.java new file mode 100644 index 000000000..d7aec5aee --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/DirectoryItemsEntityLocationEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.security_and_compliance.v1.enums; + +/** + * 实体的数据驻留地 + */ +public enum DirectoryItemsEntityLocationEnum { + CN("CN"), // 中国 + SG("SG"), // 新加坡 + JP("JP"), // 日本 + ; + private String value; + + DirectoryItemsEntityLocationEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/DirectoryItemsEntityTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/DirectoryItemsEntityTypeEnum.java new file mode 100644 index 000000000..e42ab8877 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/DirectoryItemsEntityTypeEnum.java @@ -0,0 +1,42 @@ +// Code generated by lark suite 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 com.lark.oapi.service.security_and_compliance.v1.enums; + +/** + * 实体的类型 + */ +public enum DirectoryItemsEntityTypeEnum { + DOCS("docs"), // 旧版文档 + DOCX("docx"), // 新版文档 + SHEETS("sheets"), // 表格 + BASE("base"), // 多维表格 + MINDNOTES("mindnotes"), // 思维笔记 + FILE("file"), // 文件 + SLIDES("slides"), // 幻灯片 + CHAT("chat"), // 会话 + MAILBOX("mailbox"), // 邮箱 + CALENDAR("calendar"), // 日历 + MINUTES("minutes"), // 妙记 + TASK("task"), // 任务 + ; + private String value; + + DirectoryItemsEntityTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/MigrationEntityCreatorTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/MigrationEntityCreatorTypeEnum.java new file mode 100644 index 000000000..752d85d80 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/MigrationEntityCreatorTypeEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.security_and_compliance.v1.enums; + +/** + * 创建者的类型 + */ +public enum MigrationEntityCreatorTypeEnum { + USER("user"), // 用户 + APP("app"), // 应用 + ; + private String value; + + MigrationEntityCreatorTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/MigrationEntityLocationEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/MigrationEntityLocationEnum.java new file mode 100644 index 000000000..db0388333 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/MigrationEntityLocationEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.security_and_compliance.v1.enums; + +/** + * 实体的数据驻留地 + */ +public enum MigrationEntityLocationEnum { + CN("CN"), // 中国 + SG("SG"), // 新加坡 + JP("JP"), // 日本 + ; + private String value; + + MigrationEntityLocationEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/MigrationEntityTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/MigrationEntityTypeEnum.java new file mode 100644 index 000000000..f9fc09183 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/MigrationEntityTypeEnum.java @@ -0,0 +1,42 @@ +// Code generated by lark suite 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 com.lark.oapi.service.security_and_compliance.v1.enums; + +/** + * 实体的类型 + */ +public enum MigrationEntityTypeEnum { + DOCS("docs"), // 旧版文档 + DOCX("docx"), // 新版文档 + SHEETS("sheets"), // 表格 + BASE("base"), // 多维表格 + MINDNOTES("mindnotes"), // 思维笔记 + FILE("file"), // 文件 + SLIDES("slides"), // 幻灯片 + CHAT("chat"), // 会话 + MAILBOX("mailbox"), // 邮箱 + CALENDAR("calendar"), // 日历 + MINUTES("minutes"), // 妙记 + TASK("task"), // 任务 + ; + private String value; + + MigrationEntityTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/MigrationItemsTaskStatusEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/MigrationItemsTaskStatusEnum.java new file mode 100644 index 000000000..e8a503c26 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/enums/MigrationItemsTaskStatusEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.security_and_compliance.v1.enums; + +/** + * 任务状态 + */ +public enum MigrationItemsTaskStatusEnum { + CREATE("create"), // 迁移创建完成 + COMPLETE("complete"), // 迁移已完成 + STOP("stop"), // 迁移已停止,当 entity 找不到时,status 应为 stop,并返回 message 信息 + ; + private String value; + + MigrationItemsTaskStatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/CreateMigrationEntity.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/CreateMigrationEntity.java new file mode 100644 index 000000000..1b9fb6423 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/CreateMigrationEntity.java @@ -0,0 +1,197 @@ +// Code generated by lark suite 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 com.lark.oapi.service.security_and_compliance.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class CreateMigrationEntity { + /** + * 实体的 id + *

示例值:43c58071254443c580712544 + */ + @SerializedName("id") + private String id; + /** + * 实体的类型 + *

示例值:sheets + */ + @SerializedName("type") + private String type; + /** + * 实体的数据驻留地 + *

示例值:SG + */ + @SerializedName("location") + private String location; + /** + * 实体类型为 mailbox 时,返回 mail address,如果没有,则返回空 + *

示例值:xxx@xxx.xx + */ + @SerializedName("mail_address") + private String mailAddress; + + // builder 开始 + public CreateMigrationEntity() { + } + + public CreateMigrationEntity(Builder builder) { + /** + * 实体的 id + *

示例值:43c58071254443c580712544 + */ + this.id = builder.id; + /** + * 实体的类型 + *

示例值:sheets + */ + this.type = builder.type; + /** + * 实体的数据驻留地 + *

示例值:SG + */ + this.location = builder.location; + /** + * 实体类型为 mailbox 时,返回 mail address,如果没有,则返回空 + *

示例值:xxx@xxx.xx + */ + this.mailAddress = builder.mailAddress; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getLocation() { + return this.location; + } + + public void setLocation(String location) { + this.location = location; + } + + public String getMailAddress() { + return this.mailAddress; + } + + public void setMailAddress(String mailAddress) { + this.mailAddress = mailAddress; + } + + public static class Builder { + /** + * 实体的 id + *

示例值:43c58071254443c580712544 + */ + private String id; + /** + * 实体的类型 + *

示例值:sheets + */ + private String type; + /** + * 实体的数据驻留地 + *

示例值:SG + */ + private String location; + /** + * 实体类型为 mailbox 时,返回 mail address,如果没有,则返回空 + *

示例值:xxx@xxx.xx + */ + private String mailAddress; + + /** + * 实体的 id + *

示例值:43c58071254443c580712544 + * + * @param id + * @return + */ + public Builder id(String id) { + this.id = id; + return this; + } + + + /** + * 实体的类型 + *

示例值:sheets + * + * @param type + * @return + */ + public Builder type(String type) { + this.type = type; + return this; + } + + + /** + * 实体的数据驻留地 + *

示例值:SG + * + * @param location + * @return + */ + public Builder location(String location) { + this.location = location; + return this; + } + + /** + * 实体的数据驻留地 + *

示例值:SG + * + * @param location {@link com.lark.oapi.service.security_and_compliance.v1.enums.CreateMigrationEntityLocationEnum} + * @return + */ + public Builder location(com.lark.oapi.service.security_and_compliance.v1.enums.CreateMigrationEntityLocationEnum location) { + this.location = location.getValue(); + return this; + } + + + /** + * 实体类型为 mailbox 时,返回 mail address,如果没有,则返回空 + *

示例值:xxx@xxx.xx + * + * @param mailAddress + * @return + */ + public Builder mailAddress(String mailAddress) { + this.mailAddress = mailAddress; + return this; + } + + + public CreateMigrationEntity build() { + return new CreateMigrationEntity(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/CreateMigrationItems.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/CreateMigrationItems.java new file mode 100644 index 000000000..5ea524073 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/CreateMigrationItems.java @@ -0,0 +1,160 @@ +// Code generated by lark suite 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 com.lark.oapi.service.security_and_compliance.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class CreateMigrationItems { + /** + * 迁移任务的 id + *

示例值:134jsi43d3ssi993d435452 + */ + @SerializedName("task_id") + private String taskId; + /** + * 任务状态。任务创建成功固定返回 create ,若已存在其他待执行任务,则返回已存在任务的状态 + *

示例值:create + */ + @SerializedName("task_status") + private String taskStatus; + /** + * 实体 + *

示例值: + */ + @SerializedName("entity") + private CreateMigrationEntity entity; + + // builder 开始 + public CreateMigrationItems() { + } + + public CreateMigrationItems(Builder builder) { + /** + * 迁移任务的 id + *

示例值:134jsi43d3ssi993d435452 + */ + this.taskId = builder.taskId; + /** + * 任务状态。任务创建成功固定返回 create ,若已存在其他待执行任务,则返回已存在任务的状态 + *

示例值:create + */ + this.taskStatus = builder.taskStatus; + /** + * 实体 + *

示例值: + */ + this.entity = builder.entity; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getTaskId() { + return this.taskId; + } + + public void setTaskId(String taskId) { + this.taskId = taskId; + } + + public String getTaskStatus() { + return this.taskStatus; + } + + public void setTaskStatus(String taskStatus) { + this.taskStatus = taskStatus; + } + + public CreateMigrationEntity getEntity() { + return this.entity; + } + + public void setEntity(CreateMigrationEntity entity) { + this.entity = entity; + } + + public static class Builder { + /** + * 迁移任务的 id + *

示例值:134jsi43d3ssi993d435452 + */ + private String taskId; + /** + * 任务状态。任务创建成功固定返回 create ,若已存在其他待执行任务,则返回已存在任务的状态 + *

示例值:create + */ + private String taskStatus; + /** + * 实体 + *

示例值: + */ + private CreateMigrationEntity entity; + + /** + * 迁移任务的 id + *

示例值:134jsi43d3ssi993d435452 + * + * @param taskId + * @return + */ + public Builder taskId(String taskId) { + this.taskId = taskId; + return this; + } + + + /** + * 任务状态。任务创建成功固定返回 create ,若已存在其他待执行任务,则返回已存在任务的状态 + *

示例值:create + * + * @param taskStatus + * @return + */ + public Builder taskStatus(String taskStatus) { + this.taskStatus = taskStatus; + return this; + } + + /** + * 任务状态。任务创建成功固定返回 create ,若已存在其他待执行任务,则返回已存在任务的状态 + *

示例值:create + * + * @param taskStatus {@link com.lark.oapi.service.security_and_compliance.v1.enums.CreateMigrationItemsTaskStatusEnum} + * @return + */ + public Builder taskStatus(com.lark.oapi.service.security_and_compliance.v1.enums.CreateMigrationItemsTaskStatusEnum taskStatus) { + this.taskStatus = taskStatus.getValue(); + return this; + } + + + /** + * 实体 + *

示例值: + * + * @param entity + * @return + */ + public Builder entity(CreateMigrationEntity entity) { + this.entity = entity; + return this; + } + + + public CreateMigrationItems build() { + return new CreateMigrationItems(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/DataArchivingMessage.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/DataArchivingMessage.java new file mode 100644 index 000000000..656e21509 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/DataArchivingMessage.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.security_and_compliance.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class DataArchivingMessage { + /** + * 序号ID + *

示例值:1 + */ + @SerializedName("seq_id") + private String seqId; + /** + * | 分页数量,单次拉取消息数,最大值1000 示例值:100 | | --- | + *

示例值:100 + */ + @SerializedName("limit") + private Integer limit; + + // builder 开始 + public DataArchivingMessage() { + } + + public DataArchivingMessage(Builder builder) { + /** + * 序号ID + *

示例值:1 + */ + this.seqId = builder.seqId; + /** + * | 分页数量,单次拉取消息数,最大值1000 示例值:100 | | --- | + *

示例值:100 + */ + this.limit = builder.limit; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getSeqId() { + return this.seqId; + } + + public void setSeqId(String seqId) { + this.seqId = seqId; + } + + public Integer getLimit() { + return this.limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public static class Builder { + /** + * 序号ID + *

示例值:1 + */ + private String seqId; + /** + * | 分页数量,单次拉取消息数,最大值1000 示例值:100 | | --- | + *

示例值:100 + */ + private Integer limit; + + /** + * 序号ID + *

示例值:1 + * + * @param seqId + * @return + */ + public Builder seqId(String seqId) { + this.seqId = seqId; + return this; + } + + + /** + * | 分页数量,单次拉取消息数,最大值1000 示例值:100 | | --- | + *

示例值:100 + * + * @param limit + * @return + */ + public Builder limit(Integer limit) { + this.limit = limit; + return this; + } + + + public DataArchivingMessage build() { + return new DataArchivingMessage(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/DataArchivingMessageStruct.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/DataArchivingMessageStruct.java new file mode 100644 index 000000000..d79152a6b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/DataArchivingMessageStruct.java @@ -0,0 +1,555 @@ +// Code generated by lark suite 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 com.lark.oapi.service.security_and_compliance.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class DataArchivingMessageStruct { + /** + * 消息id + *

示例值:om_829acd7aaae80c031837ad1946d7cf9f + */ + @SerializedName("message_id") + private String messageId; + /** + * 消息类型 + *

示例值:1 + */ + @SerializedName("message_type") + private Integer messageType; + /** + * 发送者信息 + *

示例值: + */ + @SerializedName("sender_info") + private DataArchivingUserStruct senderInfo; + /** + * 接受者信息 + *

示例值: + */ + @SerializedName("receiver_ids") + private String[] receiverIds; + /** + * 操作类型 + *

示例值:send + */ + @SerializedName("action_type") + private String actionType; + /** + * 会话ID + *

示例值:oc_1263d7c4d513defb9f5df13214602aa6 + */ + @SerializedName("chat_id") + private String chatId; + /** + * 消息动作时间戳ms + *

示例值:1700191599000 + */ + @SerializedName("action_time") + private String actionTime; + /** + * 是否超大群 + *

示例值:true + */ + @SerializedName("is_super_chat") + private Boolean isSuperChat; + /** + * 是否跨租户群 + *

示例值:true + */ + @SerializedName("is_cross_tenant_chat") + private Boolean isCrossTenantChat; + /** + * 会话名称 + *

示例值:会话名称 + */ + @SerializedName("chat_name") + private String chatName; + /** + * 文本内容 + *

示例值:hello + */ + @SerializedName("content") + private String content; + /** + * 会话类型 + *

示例值:group + */ + @SerializedName("chat_mode") + private String chatMode; + /** + * reaction类型 + *

示例值:FISTBUMP + */ + @SerializedName("reaction_type") + private String reactionType; + /** + * 父id + *

示例值:om_829acd7aaae80c031837ad1946d7cf9f + */ + @SerializedName("parent_msg_id") + private String parentMsgId; + + // builder 开始 + public DataArchivingMessageStruct() { + } + + public DataArchivingMessageStruct(Builder builder) { + /** + * 消息id + *

示例值:om_829acd7aaae80c031837ad1946d7cf9f + */ + this.messageId = builder.messageId; + /** + * 消息类型 + *

示例值:1 + */ + this.messageType = builder.messageType; + /** + * 发送者信息 + *

示例值: + */ + this.senderInfo = builder.senderInfo; + /** + * 接受者信息 + *

示例值: + */ + this.receiverIds = builder.receiverIds; + /** + * 操作类型 + *

示例值:send + */ + this.actionType = builder.actionType; + /** + * 会话ID + *

示例值:oc_1263d7c4d513defb9f5df13214602aa6 + */ + this.chatId = builder.chatId; + /** + * 消息动作时间戳ms + *

示例值:1700191599000 + */ + this.actionTime = builder.actionTime; + /** + * 是否超大群 + *

示例值:true + */ + this.isSuperChat = builder.isSuperChat; + /** + * 是否跨租户群 + *

示例值:true + */ + this.isCrossTenantChat = builder.isCrossTenantChat; + /** + * 会话名称 + *

示例值:会话名称 + */ + this.chatName = builder.chatName; + /** + * 文本内容 + *

示例值:hello + */ + this.content = builder.content; + /** + * 会话类型 + *

示例值:group + */ + this.chatMode = builder.chatMode; + /** + * reaction类型 + *

示例值:FISTBUMP + */ + this.reactionType = builder.reactionType; + /** + * 父id + *

示例值:om_829acd7aaae80c031837ad1946d7cf9f + */ + this.parentMsgId = builder.parentMsgId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getMessageId() { + return this.messageId; + } + + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + public Integer getMessageType() { + return this.messageType; + } + + public void setMessageType(Integer messageType) { + this.messageType = messageType; + } + + public DataArchivingUserStruct getSenderInfo() { + return this.senderInfo; + } + + public void setSenderInfo(DataArchivingUserStruct senderInfo) { + this.senderInfo = senderInfo; + } + + public String[] getReceiverIds() { + return this.receiverIds; + } + + public void setReceiverIds(String[] receiverIds) { + this.receiverIds = receiverIds; + } + + public String getActionType() { + return this.actionType; + } + + public void setActionType(String actionType) { + this.actionType = actionType; + } + + public String getChatId() { + return this.chatId; + } + + public void setChatId(String chatId) { + this.chatId = chatId; + } + + public String getActionTime() { + return this.actionTime; + } + + public void setActionTime(String actionTime) { + this.actionTime = actionTime; + } + + public Boolean getIsSuperChat() { + return this.isSuperChat; + } + + public void setIsSuperChat(Boolean isSuperChat) { + this.isSuperChat = isSuperChat; + } + + public Boolean getIsCrossTenantChat() { + return this.isCrossTenantChat; + } + + public void setIsCrossTenantChat(Boolean isCrossTenantChat) { + this.isCrossTenantChat = isCrossTenantChat; + } + + public String getChatName() { + return this.chatName; + } + + public void setChatName(String chatName) { + this.chatName = chatName; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getChatMode() { + return this.chatMode; + } + + public void setChatMode(String chatMode) { + this.chatMode = chatMode; + } + + public String getReactionType() { + return this.reactionType; + } + + public void setReactionType(String reactionType) { + this.reactionType = reactionType; + } + + public String getParentMsgId() { + return this.parentMsgId; + } + + public void setParentMsgId(String parentMsgId) { + this.parentMsgId = parentMsgId; + } + + public static class Builder { + /** + * 消息id + *

示例值:om_829acd7aaae80c031837ad1946d7cf9f + */ + private String messageId; + /** + * 消息类型 + *

示例值:1 + */ + private Integer messageType; + /** + * 发送者信息 + *

示例值: + */ + private DataArchivingUserStruct senderInfo; + /** + * 接受者信息 + *

示例值: + */ + private String[] receiverIds; + /** + * 操作类型 + *

示例值:send + */ + private String actionType; + /** + * 会话ID + *

示例值:oc_1263d7c4d513defb9f5df13214602aa6 + */ + private String chatId; + /** + * 消息动作时间戳ms + *

示例值:1700191599000 + */ + private String actionTime; + /** + * 是否超大群 + *

示例值:true + */ + private Boolean isSuperChat; + /** + * 是否跨租户群 + *

示例值:true + */ + private Boolean isCrossTenantChat; + /** + * 会话名称 + *

示例值:会话名称 + */ + private String chatName; + /** + * 文本内容 + *

示例值:hello + */ + private String content; + /** + * 会话类型 + *

示例值:group + */ + private String chatMode; + /** + * reaction类型 + *

示例值:FISTBUMP + */ + private String reactionType; + /** + * 父id + *

示例值:om_829acd7aaae80c031837ad1946d7cf9f + */ + private String parentMsgId; + + /** + * 消息id + *

示例值:om_829acd7aaae80c031837ad1946d7cf9f + * + * @param messageId + * @return + */ + public Builder messageId(String messageId) { + this.messageId = messageId; + return this; + } + + + /** + * 消息类型 + *

示例值:1 + * + * @param messageType + * @return + */ + public Builder messageType(Integer messageType) { + this.messageType = messageType; + return this; + } + + + /** + * 发送者信息 + *

示例值: + * + * @param senderInfo + * @return + */ + public Builder senderInfo(DataArchivingUserStruct senderInfo) { + this.senderInfo = senderInfo; + return this; + } + + + /** + * 接受者信息 + *

示例值: + * + * @param receiverIds + * @return + */ + public Builder receiverIds(String[] receiverIds) { + this.receiverIds = receiverIds; + return this; + } + + + /** + * 操作类型 + *

示例值:send + * + * @param actionType + * @return + */ + public Builder actionType(String actionType) { + this.actionType = actionType; + return this; + } + + + /** + * 会话ID + *

示例值:oc_1263d7c4d513defb9f5df13214602aa6 + * + * @param chatId + * @return + */ + public Builder chatId(String chatId) { + this.chatId = chatId; + return this; + } + + + /** + * 消息动作时间戳ms + *

示例值:1700191599000 + * + * @param actionTime + * @return + */ + public Builder actionTime(String actionTime) { + this.actionTime = actionTime; + return this; + } + + + /** + * 是否超大群 + *

示例值:true + * + * @param isSuperChat + * @return + */ + public Builder isSuperChat(Boolean isSuperChat) { + this.isSuperChat = isSuperChat; + return this; + } + + + /** + * 是否跨租户群 + *

示例值:true + * + * @param isCrossTenantChat + * @return + */ + public Builder isCrossTenantChat(Boolean isCrossTenantChat) { + this.isCrossTenantChat = isCrossTenantChat; + return this; + } + + + /** + * 会话名称 + *

示例值:会话名称 + * + * @param chatName + * @return + */ + public Builder chatName(String chatName) { + this.chatName = chatName; + return this; + } + + + /** + * 文本内容 + *

示例值:hello + * + * @param content + * @return + */ + public Builder content(String content) { + this.content = content; + return this; + } + + + /** + * 会话类型 + *

示例值:group + * + * @param chatMode + * @return + */ + public Builder chatMode(String chatMode) { + this.chatMode = chatMode; + return this; + } + + + /** + * reaction类型 + *

示例值:FISTBUMP + * + * @param reactionType + * @return + */ + public Builder reactionType(String reactionType) { + this.reactionType = reactionType; + return this; + } + + + /** + * 父id + *

示例值:om_829acd7aaae80c031837ad1946d7cf9f + * + * @param parentMsgId + * @return + */ + public Builder parentMsgId(String parentMsgId) { + this.parentMsgId = parentMsgId; + return this; + } + + + public DataArchivingMessageStruct build() { + return new DataArchivingMessageStruct(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/DataArchivingUser.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/DataArchivingUser.java new file mode 100644 index 000000000..c4003c10e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/DataArchivingUser.java @@ -0,0 +1,74 @@ +// Code generated by lark suite 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 com.lark.oapi.service.security_and_compliance.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class DataArchivingUser { + /** + * 归档人员列表 + *

示例值: + */ + @SerializedName("user_ids") + private String[] userIds; + + // builder 开始 + public DataArchivingUser() { + } + + public DataArchivingUser(Builder builder) { + /** + * 归档人员列表 + *

示例值: + */ + this.userIds = builder.userIds; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String[] getUserIds() { + return this.userIds; + } + + public void setUserIds(String[] userIds) { + this.userIds = userIds; + } + + public static class Builder { + /** + * 归档人员列表 + *

示例值: + */ + private String[] userIds; + + /** + * 归档人员列表 + *

示例值: + * + * @param userIds + * @return + */ + public Builder userIds(String[] userIds) { + this.userIds = userIds; + return this; + } + + + public DataArchivingUser build() { + return new DataArchivingUser(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/DataArchivingUserStruct.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/DataArchivingUserStruct.java new file mode 100644 index 000000000..0c338cc01 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/DataArchivingUserStruct.java @@ -0,0 +1,160 @@ +// Code generated by lark suite 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 com.lark.oapi.service.security_and_compliance.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class DataArchivingUserStruct { + /** + * 类型 + *

示例值:1 + */ + @SerializedName("type") + private String type; + /** + * 值 + *

示例值:352d9dgb + */ + @SerializedName("id") + private String id; + /** + * 姓名 + *

示例值:莉莉 + */ + @SerializedName("name") + private String name; + + // builder 开始 + public DataArchivingUserStruct() { + } + + public DataArchivingUserStruct(Builder builder) { + /** + * 类型 + *

示例值:1 + */ + this.type = builder.type; + /** + * 值 + *

示例值:352d9dgb + */ + this.id = builder.id; + /** + * 姓名 + *

示例值:莉莉 + */ + this.name = builder.name; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public static class Builder { + /** + * 类型 + *

示例值:1 + */ + private String type; + /** + * 值 + *

示例值:352d9dgb + */ + private String id; + /** + * 姓名 + *

示例值:莉莉 + */ + private String name; + + /** + * 类型 + *

示例值:1 + * + * @param type + * @return + */ + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * 类型 + *

示例值:1 + * + * @param type {@link com.lark.oapi.service.security_and_compliance.v1.enums.DataArchivingUserStructDataArchivingChatterTypeEnum} + * @return + */ + public Builder type(com.lark.oapi.service.security_and_compliance.v1.enums.DataArchivingUserStructDataArchivingChatterTypeEnum type) { + this.type = type.getValue(); + return this; + } + + + /** + * 值 + *

示例值:352d9dgb + * + * @param id + * @return + */ + public Builder id(String id) { + this.id = id; + return this; + } + + + /** + * 姓名 + *

示例值:莉莉 + * + * @param name + * @return + */ + public Builder name(String name) { + this.name = name; + return this; + } + + + public DataArchivingUserStruct build() { + return new DataArchivingUserStruct(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/DirectoryItems.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/DirectoryItems.java new file mode 100644 index 000000000..c8d3014b4 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/DirectoryItems.java @@ -0,0 +1,246 @@ +// Code generated by lark suite 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 com.lark.oapi.service.security_and_compliance.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class DirectoryItems { + /** + * 实体的 id + *

示例值:134jsi43d3ssi993d435452 + */ + @SerializedName("entity_id") + private String entityId; + /** + * 邮箱地址。当通过 mailbox 查询实体时,返回 mail address,如果没有,则返回空。 + *

示例值:xxx@xxx.xx + */ + @SerializedName("mail_address") + private String mailAddress; + /** + * 实体的数据驻留地 + *

示例值:SG + */ + @SerializedName("entity_location") + private String entityLocation; + /** + * 实体创建时间(毫秒级时间戳) + *

示例值:1615380573411 + */ + @SerializedName("entity_create_time") + private String entityCreateTime; + /** + * 实体的类型 + *

示例值:sheets + */ + @SerializedName("entity_type") + private String entityType; + + // builder 开始 + public DirectoryItems() { + } + + public DirectoryItems(Builder builder) { + /** + * 实体的 id + *

示例值:134jsi43d3ssi993d435452 + */ + this.entityId = builder.entityId; + /** + * 邮箱地址。当通过 mailbox 查询实体时,返回 mail address,如果没有,则返回空。 + *

示例值:xxx@xxx.xx + */ + this.mailAddress = builder.mailAddress; + /** + * 实体的数据驻留地 + *

示例值:SG + */ + this.entityLocation = builder.entityLocation; + /** + * 实体创建时间(毫秒级时间戳) + *

示例值:1615380573411 + */ + this.entityCreateTime = builder.entityCreateTime; + /** + * 实体的类型 + *

示例值:sheets + */ + this.entityType = builder.entityType; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getEntityId() { + return this.entityId; + } + + public void setEntityId(String entityId) { + this.entityId = entityId; + } + + public String getMailAddress() { + return this.mailAddress; + } + + public void setMailAddress(String mailAddress) { + this.mailAddress = mailAddress; + } + + public String getEntityLocation() { + return this.entityLocation; + } + + public void setEntityLocation(String entityLocation) { + this.entityLocation = entityLocation; + } + + public String getEntityCreateTime() { + return this.entityCreateTime; + } + + public void setEntityCreateTime(String entityCreateTime) { + this.entityCreateTime = entityCreateTime; + } + + public String getEntityType() { + return this.entityType; + } + + public void setEntityType(String entityType) { + this.entityType = entityType; + } + + public static class Builder { + /** + * 实体的 id + *

示例值:134jsi43d3ssi993d435452 + */ + private String entityId; + /** + * 邮箱地址。当通过 mailbox 查询实体时,返回 mail address,如果没有,则返回空。 + *

示例值:xxx@xxx.xx + */ + private String mailAddress; + /** + * 实体的数据驻留地 + *

示例值:SG + */ + private String entityLocation; + /** + * 实体创建时间(毫秒级时间戳) + *

示例值:1615380573411 + */ + private String entityCreateTime; + /** + * 实体的类型 + *

示例值:sheets + */ + private String entityType; + + /** + * 实体的 id + *

示例值:134jsi43d3ssi993d435452 + * + * @param entityId + * @return + */ + public Builder entityId(String entityId) { + this.entityId = entityId; + return this; + } + + + /** + * 邮箱地址。当通过 mailbox 查询实体时,返回 mail address,如果没有,则返回空。 + *

示例值:xxx@xxx.xx + * + * @param mailAddress + * @return + */ + public Builder mailAddress(String mailAddress) { + this.mailAddress = mailAddress; + return this; + } + + + /** + * 实体的数据驻留地 + *

示例值:SG + * + * @param entityLocation + * @return + */ + public Builder entityLocation(String entityLocation) { + this.entityLocation = entityLocation; + return this; + } + + /** + * 实体的数据驻留地 + *

示例值:SG + * + * @param entityLocation {@link com.lark.oapi.service.security_and_compliance.v1.enums.DirectoryItemsEntityLocationEnum} + * @return + */ + public Builder entityLocation(com.lark.oapi.service.security_and_compliance.v1.enums.DirectoryItemsEntityLocationEnum entityLocation) { + this.entityLocation = entityLocation.getValue(); + return this; + } + + + /** + * 实体创建时间(毫秒级时间戳) + *

示例值:1615380573411 + * + * @param entityCreateTime + * @return + */ + public Builder entityCreateTime(String entityCreateTime) { + this.entityCreateTime = entityCreateTime; + return this; + } + + + /** + * 实体的类型 + *

示例值:sheets + * + * @param entityType + * @return + */ + public Builder entityType(String entityType) { + this.entityType = entityType; + return this; + } + + /** + * 实体的类型 + *

示例值:sheets + * + * @param entityType {@link com.lark.oapi.service.security_and_compliance.v1.enums.DirectoryItemsEntityTypeEnum} + * @return + */ + public Builder entityType(com.lark.oapi.service.security_and_compliance.v1.enums.DirectoryItemsEntityTypeEnum entityType) { + this.entityType = entityType.getValue(); + return this; + } + + + public DirectoryItems build() { + return new DirectoryItems(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/GwResponse.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/GwResponse.java index 6950d2022..522431127 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/GwResponse.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/GwResponse.java @@ -24,7 +24,7 @@ public class GwResponse { private Integer statusCode; /** * 返回头 - *

示例值:{"Vary": "gzip"} + *

示例值:{\"Vary\": [\"gzip\"]} */ @SerializedName("header") private String header; @@ -41,7 +41,7 @@ public GwResponse(Builder builder) { this.statusCode = builder.statusCode; /** * 返回头 - *

示例值:{"Vary": "gzip"} + *

示例值:{\"Vary\": [\"gzip\"]} */ this.header = builder.header; } @@ -74,7 +74,7 @@ public static class Builder { private Integer statusCode; /** * 返回头 - *

示例值:{"Vary": "gzip"} + *

示例值:{\"Vary\": [\"gzip\"]} */ private String header; @@ -93,7 +93,7 @@ public Builder statusCode(Integer statusCode) { /** * 返回头 - *

示例值:{"Vary": "gzip"} + *

示例值:{\"Vary\": [\"gzip\"]} * * @param header * @return diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/MigrationEntity.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/MigrationEntity.java new file mode 100644 index 000000000..7bb3aea38 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/MigrationEntity.java @@ -0,0 +1,332 @@ +// Code generated by lark suite 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 com.lark.oapi.service.security_and_compliance.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class MigrationEntity { + /** + * 迁移的实体 id + *

示例值:43c58071254443c580712544 + */ + @SerializedName("id") + private String id; + /** + * 实体的数据驻留地 + *

示例值:SG + */ + @SerializedName("location") + private String location; + /** + * 实体的类型 + *

示例值:sheets + */ + @SerializedName("type") + private String type; + /** + * 创建者的 id + *

示例值:4443c580712544 + */ + @SerializedName("creator_id") + private String creatorId; + /** + * 创建者的类型 + *

示例值:user + */ + @SerializedName("creator_type") + private String creatorType; + /** + * 实体创建时间(毫秒级时间戳) + *

示例值:1615380573411 + */ + @SerializedName("create_time") + private String createTime; + /** + * 实体类型为 mailbox 时,返回 mail address,如果没有,则返回空 + *

示例值:xxx@xxx.xx + */ + @SerializedName("mail_address") + private String mailAddress; + + // builder 开始 + public MigrationEntity() { + } + + public MigrationEntity(Builder builder) { + /** + * 迁移的实体 id + *

示例值:43c58071254443c580712544 + */ + this.id = builder.id; + /** + * 实体的数据驻留地 + *

示例值:SG + */ + this.location = builder.location; + /** + * 实体的类型 + *

示例值:sheets + */ + this.type = builder.type; + /** + * 创建者的 id + *

示例值:4443c580712544 + */ + this.creatorId = builder.creatorId; + /** + * 创建者的类型 + *

示例值:user + */ + this.creatorType = builder.creatorType; + /** + * 实体创建时间(毫秒级时间戳) + *

示例值:1615380573411 + */ + this.createTime = builder.createTime; + /** + * 实体类型为 mailbox 时,返回 mail address,如果没有,则返回空 + *

示例值:xxx@xxx.xx + */ + this.mailAddress = builder.mailAddress; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLocation() { + return this.location; + } + + public void setLocation(String location) { + this.location = location; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getCreatorId() { + return this.creatorId; + } + + public void setCreatorId(String creatorId) { + this.creatorId = creatorId; + } + + public String getCreatorType() { + return this.creatorType; + } + + public void setCreatorType(String creatorType) { + this.creatorType = creatorType; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getMailAddress() { + return this.mailAddress; + } + + public void setMailAddress(String mailAddress) { + this.mailAddress = mailAddress; + } + + public static class Builder { + /** + * 迁移的实体 id + *

示例值:43c58071254443c580712544 + */ + private String id; + /** + * 实体的数据驻留地 + *

示例值:SG + */ + private String location; + /** + * 实体的类型 + *

示例值:sheets + */ + private String type; + /** + * 创建者的 id + *

示例值:4443c580712544 + */ + private String creatorId; + /** + * 创建者的类型 + *

示例值:user + */ + private String creatorType; + /** + * 实体创建时间(毫秒级时间戳) + *

示例值:1615380573411 + */ + private String createTime; + /** + * 实体类型为 mailbox 时,返回 mail address,如果没有,则返回空 + *

示例值:xxx@xxx.xx + */ + private String mailAddress; + + /** + * 迁移的实体 id + *

示例值:43c58071254443c580712544 + * + * @param id + * @return + */ + public Builder id(String id) { + this.id = id; + return this; + } + + + /** + * 实体的数据驻留地 + *

示例值:SG + * + * @param location + * @return + */ + public Builder location(String location) { + this.location = location; + return this; + } + + /** + * 实体的数据驻留地 + *

示例值:SG + * + * @param location {@link com.lark.oapi.service.security_and_compliance.v1.enums.MigrationEntityLocationEnum} + * @return + */ + public Builder location(com.lark.oapi.service.security_and_compliance.v1.enums.MigrationEntityLocationEnum location) { + this.location = location.getValue(); + return this; + } + + + /** + * 实体的类型 + *

示例值:sheets + * + * @param type + * @return + */ + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * 实体的类型 + *

示例值:sheets + * + * @param type {@link com.lark.oapi.service.security_and_compliance.v1.enums.MigrationEntityTypeEnum} + * @return + */ + public Builder type(com.lark.oapi.service.security_and_compliance.v1.enums.MigrationEntityTypeEnum type) { + this.type = type.getValue(); + return this; + } + + + /** + * 创建者的 id + *

示例值:4443c580712544 + * + * @param creatorId + * @return + */ + public Builder creatorId(String creatorId) { + this.creatorId = creatorId; + return this; + } + + + /** + * 创建者的类型 + *

示例值:user + * + * @param creatorType + * @return + */ + public Builder creatorType(String creatorType) { + this.creatorType = creatorType; + return this; + } + + /** + * 创建者的类型 + *

示例值:user + * + * @param creatorType {@link com.lark.oapi.service.security_and_compliance.v1.enums.MigrationEntityCreatorTypeEnum} + * @return + */ + public Builder creatorType(com.lark.oapi.service.security_and_compliance.v1.enums.MigrationEntityCreatorTypeEnum creatorType) { + this.creatorType = creatorType.getValue(); + return this; + } + + + /** + * 实体创建时间(毫秒级时间戳) + *

示例值:1615380573411 + * + * @param createTime + * @return + */ + public Builder createTime(String createTime) { + this.createTime = createTime; + return this; + } + + + /** + * 实体类型为 mailbox 时,返回 mail address,如果没有,则返回空 + *

示例值:xxx@xxx.xx + * + * @param mailAddress + * @return + */ + public Builder mailAddress(String mailAddress) { + this.mailAddress = mailAddress; + return this; + } + + + public MigrationEntity build() { + return new MigrationEntity(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/MigrationItems.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/MigrationItems.java new file mode 100644 index 000000000..f9635c65d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/model/MigrationItems.java @@ -0,0 +1,197 @@ +// Code generated by lark suite 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 com.lark.oapi.service.security_and_compliance.v1.model; + +import com.google.gson.annotations.SerializedName; + +public class MigrationItems { + /** + * 迁移任务的 id + *

示例值:DUoTvpjqEMgzaDU5CmfpPhx2ncp8nh+EGtQtXXQDiBdxp7QBYwI55YnfCM7Pmoxirb9V8k9CMaqLESoXLX7ny7qj7mNlbhHBMcvzsuemDpSN5aF9TmzNEJHtcmtEfdCr + */ + @SerializedName("task_id") + private String taskId; + /** + * 任务状态 + *

示例值:create + */ + @SerializedName("task_status") + private String taskStatus; + /** + * 实体。当 entity 因为物理删除等原因找不到了,则不返回 entity 这个 obejct。 + *

示例值: + */ + @SerializedName("entity") + private MigrationEntity entity; + /** + * 只有当 task status 为 stop 时,返回 entity 找不到的信息。 + *

示例值:Entity not exist. + */ + @SerializedName("message") + private String message; + + // builder 开始 + public MigrationItems() { + } + + public MigrationItems(Builder builder) { + /** + * 迁移任务的 id + *

示例值:DUoTvpjqEMgzaDU5CmfpPhx2ncp8nh+EGtQtXXQDiBdxp7QBYwI55YnfCM7Pmoxirb9V8k9CMaqLESoXLX7ny7qj7mNlbhHBMcvzsuemDpSN5aF9TmzNEJHtcmtEfdCr + */ + this.taskId = builder.taskId; + /** + * 任务状态 + *

示例值:create + */ + this.taskStatus = builder.taskStatus; + /** + * 实体。当 entity 因为物理删除等原因找不到了,则不返回 entity 这个 obejct。 + *

示例值: + */ + this.entity = builder.entity; + /** + * 只有当 task status 为 stop 时,返回 entity 找不到的信息。 + *

示例值:Entity not exist. + */ + this.message = builder.message; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getTaskId() { + return this.taskId; + } + + public void setTaskId(String taskId) { + this.taskId = taskId; + } + + public String getTaskStatus() { + return this.taskStatus; + } + + public void setTaskStatus(String taskStatus) { + this.taskStatus = taskStatus; + } + + public MigrationEntity getEntity() { + return this.entity; + } + + public void setEntity(MigrationEntity entity) { + this.entity = entity; + } + + public String getMessage() { + return this.message; + } + + public void setMessage(String message) { + this.message = message; + } + + public static class Builder { + /** + * 迁移任务的 id + *

示例值:DUoTvpjqEMgzaDU5CmfpPhx2ncp8nh+EGtQtXXQDiBdxp7QBYwI55YnfCM7Pmoxirb9V8k9CMaqLESoXLX7ny7qj7mNlbhHBMcvzsuemDpSN5aF9TmzNEJHtcmtEfdCr + */ + private String taskId; + /** + * 任务状态 + *

示例值:create + */ + private String taskStatus; + /** + * 实体。当 entity 因为物理删除等原因找不到了,则不返回 entity 这个 obejct。 + *

示例值: + */ + private MigrationEntity entity; + /** + * 只有当 task status 为 stop 时,返回 entity 找不到的信息。 + *

示例值:Entity not exist. + */ + private String message; + + /** + * 迁移任务的 id + *

示例值:DUoTvpjqEMgzaDU5CmfpPhx2ncp8nh+EGtQtXXQDiBdxp7QBYwI55YnfCM7Pmoxirb9V8k9CMaqLESoXLX7ny7qj7mNlbhHBMcvzsuemDpSN5aF9TmzNEJHtcmtEfdCr + * + * @param taskId + * @return + */ + public Builder taskId(String taskId) { + this.taskId = taskId; + return this; + } + + + /** + * 任务状态 + *

示例值:create + * + * @param taskStatus + * @return + */ + public Builder taskStatus(String taskStatus) { + this.taskStatus = taskStatus; + return this; + } + + /** + * 任务状态 + *

示例值:create + * + * @param taskStatus {@link com.lark.oapi.service.security_and_compliance.v1.enums.MigrationItemsTaskStatusEnum} + * @return + */ + public Builder taskStatus(com.lark.oapi.service.security_and_compliance.v1.enums.MigrationItemsTaskStatusEnum taskStatus) { + this.taskStatus = taskStatus.getValue(); + return this; + } + + + /** + * 实体。当 entity 因为物理删除等原因找不到了,则不返回 entity 这个 obejct。 + *

示例值: + * + * @param entity + * @return + */ + public Builder entity(MigrationEntity entity) { + this.entity = entity; + return this; + } + + + /** + * 只有当 task status 为 stop 时,返回 entity 找不到的信息。 + *

示例值:Entity not exist. + * + * @param message + * @return + */ + public Builder message(String message) { + this.message = message; + return this; + } + + + public MigrationItems build() { + return new MigrationItems(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/resource/OpenapiLog.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/resource/OpenapiLog.java new file mode 100644 index 000000000..96db28d58 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/security_and_compliance/v1/resource/OpenapiLog.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.security_and_compliance.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.security_and_compliance.v1.model.ListDataOpenapiLogReq; +import com.lark.oapi.service.security_and_compliance.v1.model.ListDataOpenapiLogResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class OpenapiLog { + private static final Logger log = LoggerFactory.getLogger(OpenapiLog.class); + private final Config config; + + public OpenapiLog(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list_data&project=security_and_compliance&resource=openapi_log&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/security_and_compliancev1/ListDataOpenapiLogSample.java ; + */ + public ListDataOpenapiLogResp listData(ListDataOpenapiLogReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/security_and_compliance/v1/openapi_logs/list_data" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListDataOpenapiLogResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDataOpenapiLogResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/security_and_compliance/v1/openapi_logs/list_data" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list_data&project=security_and_compliance&resource=openapi_log&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/security_and_compliancev1/ListDataOpenapiLogSample.java ; + */ + public ListDataOpenapiLogResp listData(ListDataOpenapiLogReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/security_and_compliance/v1/openapi_logs/list_data" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListDataOpenapiLogResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListDataOpenapiLogResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/security_and_compliance/v1/openapi_logs/list_data" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/SheetsService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/SheetsService.java new file mode 100644 index 000000000..48f6de6f8 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/SheetsService.java @@ -0,0 +1,65 @@ +// Code generated by lark suite 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 com.lark.oapi.service.sheets; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.sheets.v3.V3; +import com.lark.oapi.service.sheets.v3.resource.*; + +public class SheetsService { + private final V3 v3; + private final Spreadsheet spreadsheet; // 表格 + private final SpreadsheetSheet spreadsheetSheet; // 工作表 + private final SpreadsheetSheetFilter spreadsheetSheetFilter; // 筛选 + private final SpreadsheetSheetFilterView spreadsheetSheetFilterView; // 筛选视图 + private final SpreadsheetSheetFilterViewCondition spreadsheetSheetFilterViewCondition; // 筛选条件 + private final SpreadsheetSheetFloatImage spreadsheetSheetFloatImage; // 浮动图片 + + public SheetsService(Config config) { + this.v3 = new V3(config); + this.spreadsheet = new Spreadsheet(config); + this.spreadsheetSheet = new SpreadsheetSheet(config); + this.spreadsheetSheetFilter = new SpreadsheetSheetFilter(config); + this.spreadsheetSheetFilterView = new SpreadsheetSheetFilterView(config); + this.spreadsheetSheetFilterViewCondition = new SpreadsheetSheetFilterViewCondition(config); + this.spreadsheetSheetFloatImage = new SpreadsheetSheetFloatImage(config); + } + + public V3 v3() { + return v3; + } + + public Spreadsheet spreadsheet() { + return spreadsheet; + } + + public SpreadsheetSheet spreadsheetSheet() { + return spreadsheetSheet; + } + + public SpreadsheetSheetFilter spreadsheetSheetFilter() { + return spreadsheetSheetFilter; + } + + public SpreadsheetSheetFilterView spreadsheetSheetFilterView() { + return spreadsheetSheetFilterView; + } + + public SpreadsheetSheetFilterViewCondition spreadsheetSheetFilterViewCondition() { + return spreadsheetSheetFilterViewCondition; + } + + public SpreadsheetSheetFloatImage spreadsheetSheetFloatImage() { + return spreadsheetSheetFloatImage; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/SheetsService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/SheetsService.java deleted file mode 100644 index 6f2a8a6b3..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/SheetsService.java +++ /dev/null @@ -1,1956 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.sheets.v3; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.sheets.v3.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class SheetsService { - private static final Logger log = LoggerFactory.getLogger(SheetsService.class); - private final Spreadsheet spreadsheet; // 表格 - private final SpreadsheetSheet spreadsheetSheet; // 工作表 - private final SpreadsheetSheetFilter spreadsheetSheetFilter; // 筛选 - private final SpreadsheetSheetFilterView spreadsheetSheetFilterView; // 筛选视图 - private final SpreadsheetSheetFilterViewCondition spreadsheetSheetFilterViewCondition; // 筛选条件 - private final SpreadsheetSheetFloatImage spreadsheetSheetFloatImage; // 浮动图片 - - public SheetsService(Config config) { - this.spreadsheet = new Spreadsheet(config); - this.spreadsheetSheet = new SpreadsheetSheet(config); - this.spreadsheetSheetFilter = new SpreadsheetSheetFilter(config); - this.spreadsheetSheetFilterView = new SpreadsheetSheetFilterView(config); - this.spreadsheetSheetFilterViewCondition = new SpreadsheetSheetFilterViewCondition(config); - this.spreadsheetSheetFloatImage = new SpreadsheetSheetFloatImage(config); - } - - /** - * 表格 - * - * @return - */ - public Spreadsheet spreadsheet() { - return spreadsheet; - } - - /** - * 工作表 - * - * @return - */ - public SpreadsheetSheet spreadsheetSheet() { - return spreadsheetSheet; - } - - /** - * 筛选 - * - * @return - */ - public SpreadsheetSheetFilter spreadsheetSheetFilter() { - return spreadsheetSheetFilter; - } - - /** - * 筛选视图 - * - * @return - */ - public SpreadsheetSheetFilterView spreadsheetSheetFilterView() { - return spreadsheetSheetFilterView; - } - - /** - * 筛选条件 - * - * @return - */ - public SpreadsheetSheetFilterViewCondition spreadsheetSheetFilterViewCondition() { - return spreadsheetSheetFilterViewCondition; - } - - /** - * 浮动图片 - * - * @return - */ - public SpreadsheetSheetFloatImage spreadsheetSheetFloatImage() { - return spreadsheetSheetFloatImage; - } - - public static class Spreadsheet { - private final Config config; - - public Spreadsheet(Config config) { - this.config = config; - } - - /** - * 创建表格,在指定目录下创建表格 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSample.java ; - */ - public CreateSpreadsheetResp create(CreateSpreadsheetReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/sheets/v3/spreadsheets" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateSpreadsheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpreadsheetResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建表格,在指定目录下创建表格 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSample.java ; - */ - public CreateSpreadsheetResp create(CreateSpreadsheetReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/sheets/v3/spreadsheets" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateSpreadsheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpreadsheetResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取电子表格信息,该接口用于获取电子表格的基础信息。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSample.java ; - */ - public GetSpreadsheetResp get(GetSpreadsheetReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetSpreadsheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpreadsheetResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取电子表格信息,该接口用于获取电子表格的基础信息。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSample.java ; - */ - public GetSpreadsheetResp get(GetSpreadsheetReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetSpreadsheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpreadsheetResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改电子表格属性,该接口用于修改电子表格的属性 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/PatchSpreadsheetSample.java ; - */ - public PatchSpreadsheetResp patch(PatchSpreadsheetReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchSpreadsheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchSpreadsheetResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 修改电子表格属性,该接口用于修改电子表格的属性 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/PatchSpreadsheetSample.java ; - */ - public PatchSpreadsheetResp patch(PatchSpreadsheetReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchSpreadsheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchSpreadsheetResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class SpreadsheetSheet { - private final Config config; - - public SpreadsheetSheet(Config config) { - this.config = config; - } - - /** - * 查找单元格,在指定范围内查找符合查找条件的单元格。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/find ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/FindSpreadsheetSheetSample.java ; - */ - public FindSpreadsheetSheetResp find(FindSpreadsheetSheetReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/find" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - FindSpreadsheetSheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, FindSpreadsheetSheetResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/find" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查找单元格,在指定范围内查找符合查找条件的单元格。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/find ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/FindSpreadsheetSheetSample.java ; - */ - public FindSpreadsheetSheetResp find(FindSpreadsheetSheetReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/find" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - FindSpreadsheetSheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, FindSpreadsheetSheetResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/find" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询工作表,该接口用于通过工作表ID查询工作表属性信息。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetSample.java ; - */ - public GetSpreadsheetSheetResp get(GetSpreadsheetSheetReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetSpreadsheetSheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpreadsheetSheetResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询工作表,该接口用于通过工作表ID查询工作表属性信息。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetSample.java ; - */ - public GetSpreadsheetSheetResp get(GetSpreadsheetSheetReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetSpreadsheetSheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpreadsheetSheetResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 移动行列,该接口用于移动行列,行列被移动到目标位置后,原本在目标位置的行列会对应右移或下移。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/move_dimension ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/MoveDimensionSpreadsheetSheetSample.java ; - */ - public MoveDimensionSpreadsheetSheetResp moveDimension(MoveDimensionSpreadsheetSheetReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/move_dimension" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - MoveDimensionSpreadsheetSheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MoveDimensionSpreadsheetSheetResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/move_dimension" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 移动行列,该接口用于移动行列,行列被移动到目标位置后,原本在目标位置的行列会对应右移或下移。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/move_dimension ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/MoveDimensionSpreadsheetSheetSample.java ; - */ - public MoveDimensionSpreadsheetSheetResp moveDimension(MoveDimensionSpreadsheetSheetReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/move_dimension" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - MoveDimensionSpreadsheetSheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MoveDimensionSpreadsheetSheetResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/move_dimension" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取工作表,该接口用于获取电子表格下所有工作表及其属性。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetSample.java ; - */ - public QuerySpreadsheetSheetResp query(QuerySpreadsheetSheetReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/query" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - QuerySpreadsheetSheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QuerySpreadsheetSheetResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取工作表,该接口用于获取电子表格下所有工作表及其属性。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetSample.java ; - */ - public QuerySpreadsheetSheetResp query(QuerySpreadsheetSheetReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/query" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - QuerySpreadsheetSheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QuerySpreadsheetSheetResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 替换单元格,按照指定的条件查找子表的某个范围内的数据符合条件的单元格并替换值,返回替换成功的单元格位置。一次请求最多允许替换5000个单元格,如果超过请将range缩小范围再操作。请求体中的 range、find、replaccement 字段必填。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/replace ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/ReplaceSpreadsheetSheetSample.java ; - */ - public ReplaceSpreadsheetSheetResp replace(ReplaceSpreadsheetSheetReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/replace" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ReplaceSpreadsheetSheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ReplaceSpreadsheetSheetResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/replace" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 替换单元格,按照指定的条件查找子表的某个范围内的数据符合条件的单元格并替换值,返回替换成功的单元格位置。一次请求最多允许替换5000个单元格,如果超过请将range缩小范围再操作。请求体中的 range、find、replaccement 字段必填。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/replace ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/ReplaceSpreadsheetSheetSample.java ; - */ - public ReplaceSpreadsheetSheetResp replace(ReplaceSpreadsheetSheetReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/replace" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ReplaceSpreadsheetSheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ReplaceSpreadsheetSheetResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/replace" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class SpreadsheetSheetFilter { - private final Config config; - - public SpreadsheetSheetFilter(Config config) { - this.config = config; - } - - /** - * 创建筛选,在子表内创建筛选。 - *

参数值可参考[筛选指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/filter-user-guide) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFilterSample.java ; - */ - public CreateSpreadsheetSheetFilterResp create(CreateSpreadsheetSheetFilterReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateSpreadsheetSheetFilterResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpreadsheetSheetFilterResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建筛选,在子表内创建筛选。 - *

参数值可参考[筛选指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/filter-user-guide) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFilterSample.java ; - */ - public CreateSpreadsheetSheetFilterResp create(CreateSpreadsheetSheetFilterReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateSpreadsheetSheetFilterResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpreadsheetSheetFilterResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除筛选,删除子表的筛选 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFilterSample.java ; - */ - public DeleteSpreadsheetSheetFilterResp delete(DeleteSpreadsheetSheetFilterReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteSpreadsheetSheetFilterResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSpreadsheetSheetFilterResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除筛选,删除子表的筛选 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFilterSample.java ; - */ - public DeleteSpreadsheetSheetFilterResp delete(DeleteSpreadsheetSheetFilterReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteSpreadsheetSheetFilterResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSpreadsheetSheetFilterResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取筛选,获取子表的详细筛选信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFilterSample.java ; - */ - public GetSpreadsheetSheetFilterResp get(GetSpreadsheetSheetFilterReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetSpreadsheetSheetFilterResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpreadsheetSheetFilterResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取筛选,获取子表的详细筛选信息 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFilterSample.java ; - */ - public GetSpreadsheetSheetFilterResp get(GetSpreadsheetSheetFilterReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetSpreadsheetSheetFilterResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpreadsheetSheetFilterResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新筛选,更新子表筛选范围中的列筛选条件。 - *

参数值可参考[筛选指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/filter-user-guide) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/UpdateSpreadsheetSheetFilterSample.java ; - */ - public UpdateSpreadsheetSheetFilterResp update(UpdateSpreadsheetSheetFilterReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UpdateSpreadsheetSheetFilterResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateSpreadsheetSheetFilterResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新筛选,更新子表筛选范围中的列筛选条件。 - *

参数值可参考[筛选指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/filter-user-guide) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/UpdateSpreadsheetSheetFilterSample.java ; - */ - public UpdateSpreadsheetSheetFilterResp update(UpdateSpreadsheetSheetFilterReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UpdateSpreadsheetSheetFilterResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateSpreadsheetSheetFilterResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class SpreadsheetSheetFilterView { - private final Config config; - - public SpreadsheetSheetFilterView(Config config) { - this.config = config; - } - - /** - * 创建筛选视图,根据传入的参数创建一个筛选视图。Id 和 名字可选,不填的话会默认生成;range 必填。Id 长度为10,由 0-9、a-z、A-Z 组合生成。名字长度不超过100。单个子表内的筛选视图个数不超过 150。 - *

筛选范围的设置参考:[筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFilterViewSample.java ; - */ - public CreateSpreadsheetSheetFilterViewResp create(CreateSpreadsheetSheetFilterViewReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateSpreadsheetSheetFilterViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpreadsheetSheetFilterViewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建筛选视图,根据传入的参数创建一个筛选视图。Id 和 名字可选,不填的话会默认生成;range 必填。Id 长度为10,由 0-9、a-z、A-Z 组合生成。名字长度不超过100。单个子表内的筛选视图个数不超过 150。 - *

筛选范围的设置参考:[筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFilterViewSample.java ; - */ - public CreateSpreadsheetSheetFilterViewResp create(CreateSpreadsheetSheetFilterViewReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateSpreadsheetSheetFilterViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpreadsheetSheetFilterViewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除筛选视图,删除指定 id 对应的筛选视图。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFilterViewSample.java ; - */ - public DeleteSpreadsheetSheetFilterViewResp delete(DeleteSpreadsheetSheetFilterViewReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteSpreadsheetSheetFilterViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSpreadsheetSheetFilterViewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除筛选视图,删除指定 id 对应的筛选视图。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFilterViewSample.java ; - */ - public DeleteSpreadsheetSheetFilterViewResp delete(DeleteSpreadsheetSheetFilterViewReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteSpreadsheetSheetFilterViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSpreadsheetSheetFilterViewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取筛选视图,获取指定筛选视图 id 的名字和筛选范围。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFilterViewSample.java ; - */ - public GetSpreadsheetSheetFilterViewResp get(GetSpreadsheetSheetFilterViewReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetSpreadsheetSheetFilterViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpreadsheetSheetFilterViewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取筛选视图,获取指定筛选视图 id 的名字和筛选范围。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFilterViewSample.java ; - */ - public GetSpreadsheetSheetFilterViewResp get(GetSpreadsheetSheetFilterViewReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetSpreadsheetSheetFilterViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpreadsheetSheetFilterViewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新筛选视图,更新筛选视图的名字或者筛选范围。名字长度不超过100,不能重复即子表内唯一;筛选范围不超过子表的最大范围。 - *

筛选范围的设置参考:[筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/PatchSpreadsheetSheetFilterViewSample.java ; - */ - public PatchSpreadsheetSheetFilterViewResp patch(PatchSpreadsheetSheetFilterViewReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchSpreadsheetSheetFilterViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchSpreadsheetSheetFilterViewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新筛选视图,更新筛选视图的名字或者筛选范围。名字长度不超过100,不能重复即子表内唯一;筛选范围不超过子表的最大范围。 - *

筛选范围的设置参考:[筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/PatchSpreadsheetSheetFilterViewSample.java ; - */ - public PatchSpreadsheetSheetFilterViewResp patch(PatchSpreadsheetSheetFilterViewReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchSpreadsheetSheetFilterViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchSpreadsheetSheetFilterViewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询筛选视图,查询子表内所有的筛选视图基本信息,包括 id、name 和 range - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetFilterViewSample.java ; - */ - public QuerySpreadsheetSheetFilterViewResp query(QuerySpreadsheetSheetFilterViewReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/query" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - QuerySpreadsheetSheetFilterViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QuerySpreadsheetSheetFilterViewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询筛选视图,查询子表内所有的筛选视图基本信息,包括 id、name 和 range - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetFilterViewSample.java ; - */ - public QuerySpreadsheetSheetFilterViewResp query(QuerySpreadsheetSheetFilterViewReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/query" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - QuerySpreadsheetSheetFilterViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QuerySpreadsheetSheetFilterViewResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class SpreadsheetSheetFilterViewCondition { - private final Config config; - - public SpreadsheetSheetFilterViewCondition(Config config) { - this.config = config; - } - - /** - * 创建筛选条件,在筛选视图的筛选范围的某一列创建筛选条件。 - *

筛选条件参考 [筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFilterViewConditionSample.java ; - */ - public CreateSpreadsheetSheetFilterViewConditionResp create(CreateSpreadsheetSheetFilterViewConditionReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateSpreadsheetSheetFilterViewConditionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpreadsheetSheetFilterViewConditionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建筛选条件,在筛选视图的筛选范围的某一列创建筛选条件。 - *

筛选条件参考 [筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFilterViewConditionSample.java ; - */ - public CreateSpreadsheetSheetFilterViewConditionResp create(CreateSpreadsheetSheetFilterViewConditionReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateSpreadsheetSheetFilterViewConditionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpreadsheetSheetFilterViewConditionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除筛选条件,删除筛选视图的筛选范围某一列的筛选条件。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFilterViewConditionSample.java ; - */ - public DeleteSpreadsheetSheetFilterViewConditionResp delete(DeleteSpreadsheetSheetFilterViewConditionReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteSpreadsheetSheetFilterViewConditionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSpreadsheetSheetFilterViewConditionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除筛选条件,删除筛选视图的筛选范围某一列的筛选条件。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFilterViewConditionSample.java ; - */ - public DeleteSpreadsheetSheetFilterViewConditionResp delete(DeleteSpreadsheetSheetFilterViewConditionReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteSpreadsheetSheetFilterViewConditionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSpreadsheetSheetFilterViewConditionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取筛选条件,获取筛选视图某列的筛选条件信息。 - *

筛选条件含义参考 [筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFilterViewConditionSample.java ; - */ - public GetSpreadsheetSheetFilterViewConditionResp get(GetSpreadsheetSheetFilterViewConditionReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetSpreadsheetSheetFilterViewConditionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpreadsheetSheetFilterViewConditionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取筛选条件,获取筛选视图某列的筛选条件信息。 - *

筛选条件含义参考 [筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFilterViewConditionSample.java ; - */ - public GetSpreadsheetSheetFilterViewConditionResp get(GetSpreadsheetSheetFilterViewConditionReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetSpreadsheetSheetFilterViewConditionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpreadsheetSheetFilterViewConditionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询筛选条件,查询一个筛选视图的所有筛选条件,返回筛选视图的筛选范围内的筛选条件。 - *

筛选条件含义可参考 [筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetFilterViewConditionSample.java ; - */ - public QuerySpreadsheetSheetFilterViewConditionResp query(QuerySpreadsheetSheetFilterViewConditionReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/query" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - QuerySpreadsheetSheetFilterViewConditionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QuerySpreadsheetSheetFilterViewConditionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询筛选条件,查询一个筛选视图的所有筛选条件,返回筛选视图的筛选范围内的筛选条件。 - *

筛选条件含义可参考 [筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetFilterViewConditionSample.java ; - */ - public QuerySpreadsheetSheetFilterViewConditionResp query(QuerySpreadsheetSheetFilterViewConditionReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/query" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - QuerySpreadsheetSheetFilterViewConditionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QuerySpreadsheetSheetFilterViewConditionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新筛选条件,更新筛选视图范围的某列的筛选条件,condition id 即为列的字母号。 - *

筛选条件参数可参考 [筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/UpdateSpreadsheetSheetFilterViewConditionSample.java ; - */ - public UpdateSpreadsheetSheetFilterViewConditionResp update(UpdateSpreadsheetSheetFilterViewConditionReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UpdateSpreadsheetSheetFilterViewConditionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateSpreadsheetSheetFilterViewConditionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新筛选条件,更新筛选视图范围的某列的筛选条件,condition id 即为列的字母号。 - *

筛选条件参数可参考 [筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/UpdateSpreadsheetSheetFilterViewConditionSample.java ; - */ - public UpdateSpreadsheetSheetFilterViewConditionResp update(UpdateSpreadsheetSheetFilterViewConditionReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UpdateSpreadsheetSheetFilterViewConditionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateSpreadsheetSheetFilterViewConditionResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class SpreadsheetSheetFloatImage { - private final Config config; - - public SpreadsheetSheetFloatImage(Config config) { - this.config = config; - } - - /** - * 创建浮动图片,根据传入的参数创建一张浮动图片。Float_image_token ([上传图片至表格后得到](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_all))和range(只支持一个单元格) 必填。Float_image_id 可选,不填的话会默认生成,长度为10,由 0-9、a-z、A-Z 组合生成。表格内不重复的图片(浮动图片+单元格图片)总数不超过4000。width 和 height 为图片展示的宽高,可选,不填的话会使用图片的真实宽高。offset_x 和 offset_y 为图片左上角距离所在单元格左上角的偏移,可选,默认为 0。 - *

浮动图片的设置参考:[浮动图片指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/float-image-user-guide) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFloatImageSample.java ; - */ - public CreateSpreadsheetSheetFloatImageResp create(CreateSpreadsheetSheetFloatImageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateSpreadsheetSheetFloatImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpreadsheetSheetFloatImageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建浮动图片,根据传入的参数创建一张浮动图片。Float_image_token ([上传图片至表格后得到](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_all))和range(只支持一个单元格) 必填。Float_image_id 可选,不填的话会默认生成,长度为10,由 0-9、a-z、A-Z 组合生成。表格内不重复的图片(浮动图片+单元格图片)总数不超过4000。width 和 height 为图片展示的宽高,可选,不填的话会使用图片的真实宽高。offset_x 和 offset_y 为图片左上角距离所在单元格左上角的偏移,可选,默认为 0。 - *

浮动图片的设置参考:[浮动图片指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/float-image-user-guide) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFloatImageSample.java ; - */ - public CreateSpreadsheetSheetFloatImageResp create(CreateSpreadsheetSheetFloatImageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateSpreadsheetSheetFloatImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpreadsheetSheetFloatImageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除浮动图片,删除 float_image_id 对应的浮动图片。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFloatImageSample.java ; - */ - public DeleteSpreadsheetSheetFloatImageResp delete(DeleteSpreadsheetSheetFloatImageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteSpreadsheetSheetFloatImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSpreadsheetSheetFloatImageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除浮动图片,删除 float_image_id 对应的浮动图片。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFloatImageSample.java ; - */ - public DeleteSpreadsheetSheetFloatImageResp delete(DeleteSpreadsheetSheetFloatImageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteSpreadsheetSheetFloatImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSpreadsheetSheetFloatImageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取浮动图片,根据 float_image_id 获取对应浮动图片的信息。 - *

浮动图片参考:[浮动图片指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/float-image-user-guide) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFloatImageSample.java ; - */ - public GetSpreadsheetSheetFloatImageResp get(GetSpreadsheetSheetFloatImageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetSpreadsheetSheetFloatImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpreadsheetSheetFloatImageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取浮动图片,根据 float_image_id 获取对应浮动图片的信息。 - *

浮动图片参考:[浮动图片指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/float-image-user-guide) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFloatImageSample.java ; - */ - public GetSpreadsheetSheetFloatImageResp get(GetSpreadsheetSheetFloatImageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetSpreadsheetSheetFloatImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpreadsheetSheetFloatImageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新浮动图片,更新已有的浮动图片位置和宽高,包括 range、width、height、offset_x 和 offset_y,不包括 float_image_id 和 float_image_token。 - *

浮动图片更新参考:[浮动图片指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/float-image-user-guide) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/PatchSpreadsheetSheetFloatImageSample.java ; - */ - public PatchSpreadsheetSheetFloatImageResp patch(PatchSpreadsheetSheetFloatImageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchSpreadsheetSheetFloatImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchSpreadsheetSheetFloatImageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新浮动图片,更新已有的浮动图片位置和宽高,包括 range、width、height、offset_x 和 offset_y,不包括 float_image_id 和 float_image_token。 - *

浮动图片更新参考:[浮动图片指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/float-image-user-guide) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/PatchSpreadsheetSheetFloatImageSample.java ; - */ - public PatchSpreadsheetSheetFloatImageResp patch(PatchSpreadsheetSheetFloatImageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchSpreadsheetSheetFloatImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchSpreadsheetSheetFloatImageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询浮动图片,返回子表内所有的浮动图片信息。 - *

浮动图片参考:[浮动图片指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/float-image-user-guide) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetFloatImageSample.java ; - */ - public QuerySpreadsheetSheetFloatImageResp query(QuerySpreadsheetSheetFloatImageReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/query" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - QuerySpreadsheetSheetFloatImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QuerySpreadsheetSheetFloatImageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询浮动图片,返回子表内所有的浮动图片信息。 - *

浮动图片参考:[浮动图片指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/float-image-user-guide) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetFloatImageSample.java ; - */ - public QuerySpreadsheetSheetFloatImageResp query(QuerySpreadsheetSheetFloatImageReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/query" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - QuerySpreadsheetSheetFloatImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QuerySpreadsheetSheetFloatImageResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/V3.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/V3.java new file mode 100644 index 000000000..d2b33db38 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/V3.java @@ -0,0 +1,59 @@ +// Code generated by lark suite 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 com.lark.oapi.service.sheets.v3; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.sheets.v3.resource.*; + +public class V3 { + private final Spreadsheet spreadsheet; // 表格 + private final SpreadsheetSheet spreadsheetSheet; // 工作表 + private final SpreadsheetSheetFilter spreadsheetSheetFilter; // 筛选 + private final SpreadsheetSheetFilterView spreadsheetSheetFilterView; // 筛选视图 + private final SpreadsheetSheetFilterViewCondition spreadsheetSheetFilterViewCondition; // 筛选条件 + private final SpreadsheetSheetFloatImage spreadsheetSheetFloatImage; // 浮动图片 + + public V3(Config config) { + this.spreadsheet = new Spreadsheet(config); + this.spreadsheetSheet = new SpreadsheetSheet(config); + this.spreadsheetSheetFilter = new SpreadsheetSheetFilter(config); + this.spreadsheetSheetFilterView = new SpreadsheetSheetFilterView(config); + this.spreadsheetSheetFilterViewCondition = new SpreadsheetSheetFilterViewCondition(config); + this.spreadsheetSheetFloatImage = new SpreadsheetSheetFloatImage(config); + } + + public Spreadsheet spreadsheet() { + return spreadsheet; + } + + public SpreadsheetSheet spreadsheetSheet() { + return spreadsheetSheet; + } + + public SpreadsheetSheetFilter spreadsheetSheetFilter() { + return spreadsheetSheetFilter; + } + + public SpreadsheetSheetFilterView spreadsheetSheetFilterView() { + return spreadsheetSheetFilterView; + } + + public SpreadsheetSheetFilterViewCondition spreadsheetSheetFilterViewCondition() { + return spreadsheetSheetFilterViewCondition; + } + + public SpreadsheetSheetFloatImage spreadsheetSheetFloatImage() { + return spreadsheetSheetFloatImage; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/resource/Spreadsheet.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/resource/Spreadsheet.java new file mode 100644 index 000000000..0cce045ee --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/resource/Spreadsheet.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.sheets.v3.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.sheets.v3.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Spreadsheet { + private static final Logger log = LoggerFactory.getLogger(Spreadsheet.class); + private final Config config; + + public Spreadsheet(Config config) { + this.config = config; + } + + + /** + * 创建表格,在指定目录下创建表格 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSample.java ; + */ + public CreateSpreadsheetResp create(CreateSpreadsheetReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/sheets/v3/spreadsheets" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateSpreadsheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpreadsheetResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建表格,在指定目录下创建表格 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSample.java ; + */ + public CreateSpreadsheetResp create(CreateSpreadsheetReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/sheets/v3/spreadsheets" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateSpreadsheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpreadsheetResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取电子表格信息,该接口用于获取电子表格的基础信息。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSample.java ; + */ + public GetSpreadsheetResp get(GetSpreadsheetReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetSpreadsheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpreadsheetResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取电子表格信息,该接口用于获取电子表格的基础信息。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSample.java ; + */ + public GetSpreadsheetResp get(GetSpreadsheetReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetSpreadsheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpreadsheetResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改电子表格属性,该接口用于修改电子表格的属性 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/PatchSpreadsheetSample.java ; + */ + public PatchSpreadsheetResp patch(PatchSpreadsheetReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchSpreadsheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchSpreadsheetResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 修改电子表格属性,该接口用于修改电子表格的属性 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/PatchSpreadsheetSample.java ; + */ + public PatchSpreadsheetResp patch(PatchSpreadsheetReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchSpreadsheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchSpreadsheetResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/resource/SpreadsheetSheet.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/resource/SpreadsheetSheet.java new file mode 100644 index 000000000..9f5399a3e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/resource/SpreadsheetSheet.java @@ -0,0 +1,368 @@ +// Code generated by lark suite 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 com.lark.oapi.service.sheets.v3.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.sheets.v3.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class SpreadsheetSheet { + private static final Logger log = LoggerFactory.getLogger(SpreadsheetSheet.class); + private final Config config; + + public SpreadsheetSheet(Config config) { + this.config = config; + } + + + /** + * 查找单元格,在指定范围内查找符合查找条件的单元格。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/find ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/FindSpreadsheetSheetSample.java ; + */ + public FindSpreadsheetSheetResp find(FindSpreadsheetSheetReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/find" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + FindSpreadsheetSheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, FindSpreadsheetSheetResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/find" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查找单元格,在指定范围内查找符合查找条件的单元格。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/find ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/FindSpreadsheetSheetSample.java ; + */ + public FindSpreadsheetSheetResp find(FindSpreadsheetSheetReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/find" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + FindSpreadsheetSheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, FindSpreadsheetSheetResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/find" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询工作表,该接口用于通过工作表ID查询工作表属性信息。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetSample.java ; + */ + public GetSpreadsheetSheetResp get(GetSpreadsheetSheetReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetSpreadsheetSheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpreadsheetSheetResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询工作表,该接口用于通过工作表ID查询工作表属性信息。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetSample.java ; + */ + public GetSpreadsheetSheetResp get(GetSpreadsheetSheetReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetSpreadsheetSheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpreadsheetSheetResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 移动行列,该接口用于移动行列,行列被移动到目标位置后,原本在目标位置的行列会对应右移或下移。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/move_dimension ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/MoveDimensionSpreadsheetSheetSample.java ; + */ + public MoveDimensionSpreadsheetSheetResp moveDimension(MoveDimensionSpreadsheetSheetReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/move_dimension" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + MoveDimensionSpreadsheetSheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MoveDimensionSpreadsheetSheetResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/move_dimension" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 移动行列,该接口用于移动行列,行列被移动到目标位置后,原本在目标位置的行列会对应右移或下移。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/move_dimension ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/MoveDimensionSpreadsheetSheetSample.java ; + */ + public MoveDimensionSpreadsheetSheetResp moveDimension(MoveDimensionSpreadsheetSheetReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/move_dimension" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + MoveDimensionSpreadsheetSheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MoveDimensionSpreadsheetSheetResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/move_dimension" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取工作表,该接口用于获取电子表格下所有工作表及其属性。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetSample.java ; + */ + public QuerySpreadsheetSheetResp query(QuerySpreadsheetSheetReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/query" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + QuerySpreadsheetSheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QuerySpreadsheetSheetResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取工作表,该接口用于获取电子表格下所有工作表及其属性。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetSample.java ; + */ + public QuerySpreadsheetSheetResp query(QuerySpreadsheetSheetReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/query" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + QuerySpreadsheetSheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QuerySpreadsheetSheetResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 替换单元格,按照指定的条件查找子表的某个范围内的数据符合条件的单元格并替换值,返回替换成功的单元格位置。一次请求最多允许替换5000个单元格,如果超过请将range缩小范围再操作。请求体中的 range、find、replaccement 字段必填。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/replace ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/ReplaceSpreadsheetSheetSample.java ; + */ + public ReplaceSpreadsheetSheetResp replace(ReplaceSpreadsheetSheetReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/replace" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ReplaceSpreadsheetSheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ReplaceSpreadsheetSheetResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/replace" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 替换单元格,按照指定的条件查找子表的某个范围内的数据符合条件的单元格并替换值,返回替换成功的单元格位置。一次请求最多允许替换5000个单元格,如果超过请将range缩小范围再操作。请求体中的 range、find、replaccement 字段必填。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/replace ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/ReplaceSpreadsheetSheetSample.java ; + */ + public ReplaceSpreadsheetSheetResp replace(ReplaceSpreadsheetSheetReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/replace" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ReplaceSpreadsheetSheetResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ReplaceSpreadsheetSheetResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/replace" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/resource/SpreadsheetSheetFilter.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/resource/SpreadsheetSheetFilter.java new file mode 100644 index 000000000..35ee4eadb --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/resource/SpreadsheetSheetFilter.java @@ -0,0 +1,306 @@ +// Code generated by lark suite 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 com.lark.oapi.service.sheets.v3.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.sheets.v3.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class SpreadsheetSheetFilter { + private static final Logger log = LoggerFactory.getLogger(SpreadsheetSheetFilter.class); + private final Config config; + + public SpreadsheetSheetFilter(Config config) { + this.config = config; + } + + + /** + * 创建筛选,在子表内创建筛选。 + *

参数值可参考[筛选指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/filter-user-guide) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFilterSample.java ; + */ + public CreateSpreadsheetSheetFilterResp create(CreateSpreadsheetSheetFilterReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateSpreadsheetSheetFilterResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpreadsheetSheetFilterResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建筛选,在子表内创建筛选。 + *

参数值可参考[筛选指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/filter-user-guide) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFilterSample.java ; + */ + public CreateSpreadsheetSheetFilterResp create(CreateSpreadsheetSheetFilterReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateSpreadsheetSheetFilterResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpreadsheetSheetFilterResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除筛选,删除子表的筛选 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFilterSample.java ; + */ + public DeleteSpreadsheetSheetFilterResp delete(DeleteSpreadsheetSheetFilterReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteSpreadsheetSheetFilterResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSpreadsheetSheetFilterResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除筛选,删除子表的筛选 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFilterSample.java ; + */ + public DeleteSpreadsheetSheetFilterResp delete(DeleteSpreadsheetSheetFilterReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteSpreadsheetSheetFilterResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSpreadsheetSheetFilterResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取筛选,获取子表的详细筛选信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFilterSample.java ; + */ + public GetSpreadsheetSheetFilterResp get(GetSpreadsheetSheetFilterReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetSpreadsheetSheetFilterResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpreadsheetSheetFilterResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取筛选,获取子表的详细筛选信息 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFilterSample.java ; + */ + public GetSpreadsheetSheetFilterResp get(GetSpreadsheetSheetFilterReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetSpreadsheetSheetFilterResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpreadsheetSheetFilterResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新筛选,更新子表筛选范围中的列筛选条件。 + *

参数值可参考[筛选指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/filter-user-guide) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/UpdateSpreadsheetSheetFilterSample.java ; + */ + public UpdateSpreadsheetSheetFilterResp update(UpdateSpreadsheetSheetFilterReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UpdateSpreadsheetSheetFilterResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateSpreadsheetSheetFilterResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新筛选,更新子表筛选范围中的列筛选条件。 + *

参数值可参考[筛选指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/filter-user-guide) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/UpdateSpreadsheetSheetFilterSample.java ; + */ + public UpdateSpreadsheetSheetFilterResp update(UpdateSpreadsheetSheetFilterReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UpdateSpreadsheetSheetFilterResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateSpreadsheetSheetFilterResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/resource/SpreadsheetSheetFilterView.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/resource/SpreadsheetSheetFilterView.java new file mode 100644 index 000000000..0c6107d04 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/resource/SpreadsheetSheetFilterView.java @@ -0,0 +1,372 @@ +// Code generated by lark suite 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 com.lark.oapi.service.sheets.v3.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.sheets.v3.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class SpreadsheetSheetFilterView { + private static final Logger log = LoggerFactory.getLogger(SpreadsheetSheetFilterView.class); + private final Config config; + + public SpreadsheetSheetFilterView(Config config) { + this.config = config; + } + + + /** + * 创建筛选视图,根据传入的参数创建一个筛选视图。Id 和 名字可选,不填的话会默认生成;range 必填。Id 长度为10,由 0-9、a-z、A-Z 组合生成。名字长度不超过100。单个子表内的筛选视图个数不超过 150。 + *

筛选范围的设置参考:[筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFilterViewSample.java ; + */ + public CreateSpreadsheetSheetFilterViewResp create(CreateSpreadsheetSheetFilterViewReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateSpreadsheetSheetFilterViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpreadsheetSheetFilterViewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建筛选视图,根据传入的参数创建一个筛选视图。Id 和 名字可选,不填的话会默认生成;range 必填。Id 长度为10,由 0-9、a-z、A-Z 组合生成。名字长度不超过100。单个子表内的筛选视图个数不超过 150。 + *

筛选范围的设置参考:[筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFilterViewSample.java ; + */ + public CreateSpreadsheetSheetFilterViewResp create(CreateSpreadsheetSheetFilterViewReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateSpreadsheetSheetFilterViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpreadsheetSheetFilterViewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除筛选视图,删除指定 id 对应的筛选视图。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFilterViewSample.java ; + */ + public DeleteSpreadsheetSheetFilterViewResp delete(DeleteSpreadsheetSheetFilterViewReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteSpreadsheetSheetFilterViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSpreadsheetSheetFilterViewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除筛选视图,删除指定 id 对应的筛选视图。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFilterViewSample.java ; + */ + public DeleteSpreadsheetSheetFilterViewResp delete(DeleteSpreadsheetSheetFilterViewReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteSpreadsheetSheetFilterViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSpreadsheetSheetFilterViewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取筛选视图,获取指定筛选视图 id 的名字和筛选范围。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFilterViewSample.java ; + */ + public GetSpreadsheetSheetFilterViewResp get(GetSpreadsheetSheetFilterViewReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetSpreadsheetSheetFilterViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpreadsheetSheetFilterViewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取筛选视图,获取指定筛选视图 id 的名字和筛选范围。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFilterViewSample.java ; + */ + public GetSpreadsheetSheetFilterViewResp get(GetSpreadsheetSheetFilterViewReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetSpreadsheetSheetFilterViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpreadsheetSheetFilterViewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新筛选视图,更新筛选视图的名字或者筛选范围。名字长度不超过100,不能重复即子表内唯一;筛选范围不超过子表的最大范围。 + *

筛选范围的设置参考:[筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/PatchSpreadsheetSheetFilterViewSample.java ; + */ + public PatchSpreadsheetSheetFilterViewResp patch(PatchSpreadsheetSheetFilterViewReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchSpreadsheetSheetFilterViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchSpreadsheetSheetFilterViewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新筛选视图,更新筛选视图的名字或者筛选范围。名字长度不超过100,不能重复即子表内唯一;筛选范围不超过子表的最大范围。 + *

筛选范围的设置参考:[筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/PatchSpreadsheetSheetFilterViewSample.java ; + */ + public PatchSpreadsheetSheetFilterViewResp patch(PatchSpreadsheetSheetFilterViewReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchSpreadsheetSheetFilterViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchSpreadsheetSheetFilterViewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询筛选视图,查询子表内所有的筛选视图基本信息,包括 id、name 和 range + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetFilterViewSample.java ; + */ + public QuerySpreadsheetSheetFilterViewResp query(QuerySpreadsheetSheetFilterViewReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/query" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + QuerySpreadsheetSheetFilterViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QuerySpreadsheetSheetFilterViewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询筛选视图,查询子表内所有的筛选视图基本信息,包括 id、name 和 range + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetFilterViewSample.java ; + */ + public QuerySpreadsheetSheetFilterViewResp query(QuerySpreadsheetSheetFilterViewReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/query" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + QuerySpreadsheetSheetFilterViewResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QuerySpreadsheetSheetFilterViewResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/resource/SpreadsheetSheetFilterViewCondition.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/resource/SpreadsheetSheetFilterViewCondition.java new file mode 100644 index 000000000..2d39edd61 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/resource/SpreadsheetSheetFilterViewCondition.java @@ -0,0 +1,376 @@ +// Code generated by lark suite 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 com.lark.oapi.service.sheets.v3.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.sheets.v3.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class SpreadsheetSheetFilterViewCondition { + private static final Logger log = LoggerFactory.getLogger(SpreadsheetSheetFilterViewCondition.class); + private final Config config; + + public SpreadsheetSheetFilterViewCondition(Config config) { + this.config = config; + } + + + /** + * 创建筛选条件,在筛选视图的筛选范围的某一列创建筛选条件。 + *

筛选条件参考 [筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFilterViewConditionSample.java ; + */ + public CreateSpreadsheetSheetFilterViewConditionResp create(CreateSpreadsheetSheetFilterViewConditionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateSpreadsheetSheetFilterViewConditionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpreadsheetSheetFilterViewConditionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建筛选条件,在筛选视图的筛选范围的某一列创建筛选条件。 + *

筛选条件参考 [筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFilterViewConditionSample.java ; + */ + public CreateSpreadsheetSheetFilterViewConditionResp create(CreateSpreadsheetSheetFilterViewConditionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateSpreadsheetSheetFilterViewConditionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpreadsheetSheetFilterViewConditionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除筛选条件,删除筛选视图的筛选范围某一列的筛选条件。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFilterViewConditionSample.java ; + */ + public DeleteSpreadsheetSheetFilterViewConditionResp delete(DeleteSpreadsheetSheetFilterViewConditionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteSpreadsheetSheetFilterViewConditionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSpreadsheetSheetFilterViewConditionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除筛选条件,删除筛选视图的筛选范围某一列的筛选条件。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFilterViewConditionSample.java ; + */ + public DeleteSpreadsheetSheetFilterViewConditionResp delete(DeleteSpreadsheetSheetFilterViewConditionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteSpreadsheetSheetFilterViewConditionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSpreadsheetSheetFilterViewConditionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取筛选条件,获取筛选视图某列的筛选条件信息。 + *

筛选条件含义参考 [筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFilterViewConditionSample.java ; + */ + public GetSpreadsheetSheetFilterViewConditionResp get(GetSpreadsheetSheetFilterViewConditionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetSpreadsheetSheetFilterViewConditionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpreadsheetSheetFilterViewConditionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取筛选条件,获取筛选视图某列的筛选条件信息。 + *

筛选条件含义参考 [筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFilterViewConditionSample.java ; + */ + public GetSpreadsheetSheetFilterViewConditionResp get(GetSpreadsheetSheetFilterViewConditionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetSpreadsheetSheetFilterViewConditionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpreadsheetSheetFilterViewConditionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询筛选条件,查询一个筛选视图的所有筛选条件,返回筛选视图的筛选范围内的筛选条件。 + *

筛选条件含义可参考 [筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetFilterViewConditionSample.java ; + */ + public QuerySpreadsheetSheetFilterViewConditionResp query(QuerySpreadsheetSheetFilterViewConditionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/query" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + QuerySpreadsheetSheetFilterViewConditionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QuerySpreadsheetSheetFilterViewConditionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询筛选条件,查询一个筛选视图的所有筛选条件,返回筛选视图的筛选范围内的筛选条件。 + *

筛选条件含义可参考 [筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetFilterViewConditionSample.java ; + */ + public QuerySpreadsheetSheetFilterViewConditionResp query(QuerySpreadsheetSheetFilterViewConditionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/query" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + QuerySpreadsheetSheetFilterViewConditionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QuerySpreadsheetSheetFilterViewConditionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新筛选条件,更新筛选视图范围的某列的筛选条件,condition id 即为列的字母号。 + *

筛选条件参数可参考 [筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/UpdateSpreadsheetSheetFilterViewConditionSample.java ; + */ + public UpdateSpreadsheetSheetFilterViewConditionResp update(UpdateSpreadsheetSheetFilterViewConditionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UpdateSpreadsheetSheetFilterViewConditionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateSpreadsheetSheetFilterViewConditionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新筛选条件,更新筛选视图范围的某列的筛选条件,condition id 即为列的字母号。 + *

筛选条件参数可参考 [筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/UpdateSpreadsheetSheetFilterViewConditionSample.java ; + */ + public UpdateSpreadsheetSheetFilterViewConditionResp update(UpdateSpreadsheetSheetFilterViewConditionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UpdateSpreadsheetSheetFilterViewConditionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateSpreadsheetSheetFilterViewConditionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/resource/SpreadsheetSheetFloatImage.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/resource/SpreadsheetSheetFloatImage.java new file mode 100644 index 000000000..c70fe1d8c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/sheets/v3/resource/SpreadsheetSheetFloatImage.java @@ -0,0 +1,376 @@ +// Code generated by lark suite 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 com.lark.oapi.service.sheets.v3.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.sheets.v3.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class SpreadsheetSheetFloatImage { + private static final Logger log = LoggerFactory.getLogger(SpreadsheetSheetFloatImage.class); + private final Config config; + + public SpreadsheetSheetFloatImage(Config config) { + this.config = config; + } + + + /** + * 创建浮动图片,根据传入的参数创建一张浮动图片。Float_image_token ([上传图片至表格后得到](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_all))和range(只支持一个单元格) 必填。Float_image_id 可选,不填的话会默认生成,长度为10,由 0-9、a-z、A-Z 组合生成。表格内不重复的图片(浮动图片+单元格图片)总数不超过4000。width 和 height 为图片展示的宽高,可选,不填的话会使用图片的真实宽高。offset_x 和 offset_y 为图片左上角距离所在单元格左上角的偏移,可选,默认为 0。 + *

浮动图片的设置参考:[浮动图片指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/float-image-user-guide) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFloatImageSample.java ; + */ + public CreateSpreadsheetSheetFloatImageResp create(CreateSpreadsheetSheetFloatImageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateSpreadsheetSheetFloatImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpreadsheetSheetFloatImageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建浮动图片,根据传入的参数创建一张浮动图片。Float_image_token ([上传图片至表格后得到](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_all))和range(只支持一个单元格) 必填。Float_image_id 可选,不填的话会默认生成,长度为10,由 0-9、a-z、A-Z 组合生成。表格内不重复的图片(浮动图片+单元格图片)总数不超过4000。width 和 height 为图片展示的宽高,可选,不填的话会使用图片的真实宽高。offset_x 和 offset_y 为图片左上角距离所在单元格左上角的偏移,可选,默认为 0。 + *

浮动图片的设置参考:[浮动图片指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/float-image-user-guide) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFloatImageSample.java ; + */ + public CreateSpreadsheetSheetFloatImageResp create(CreateSpreadsheetSheetFloatImageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateSpreadsheetSheetFloatImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpreadsheetSheetFloatImageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除浮动图片,删除 float_image_id 对应的浮动图片。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFloatImageSample.java ; + */ + public DeleteSpreadsheetSheetFloatImageResp delete(DeleteSpreadsheetSheetFloatImageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteSpreadsheetSheetFloatImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSpreadsheetSheetFloatImageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除浮动图片,删除 float_image_id 对应的浮动图片。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFloatImageSample.java ; + */ + public DeleteSpreadsheetSheetFloatImageResp delete(DeleteSpreadsheetSheetFloatImageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteSpreadsheetSheetFloatImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSpreadsheetSheetFloatImageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取浮动图片,根据 float_image_id 获取对应浮动图片的信息。 + *

浮动图片参考:[浮动图片指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/float-image-user-guide) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFloatImageSample.java ; + */ + public GetSpreadsheetSheetFloatImageResp get(GetSpreadsheetSheetFloatImageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetSpreadsheetSheetFloatImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpreadsheetSheetFloatImageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取浮动图片,根据 float_image_id 获取对应浮动图片的信息。 + *

浮动图片参考:[浮动图片指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/float-image-user-guide) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFloatImageSample.java ; + */ + public GetSpreadsheetSheetFloatImageResp get(GetSpreadsheetSheetFloatImageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetSpreadsheetSheetFloatImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpreadsheetSheetFloatImageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新浮动图片,更新已有的浮动图片位置和宽高,包括 range、width、height、offset_x 和 offset_y,不包括 float_image_id 和 float_image_token。 + *

浮动图片更新参考:[浮动图片指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/float-image-user-guide) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/PatchSpreadsheetSheetFloatImageSample.java ; + */ + public PatchSpreadsheetSheetFloatImageResp patch(PatchSpreadsheetSheetFloatImageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchSpreadsheetSheetFloatImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchSpreadsheetSheetFloatImageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新浮动图片,更新已有的浮动图片位置和宽高,包括 range、width、height、offset_x 和 offset_y,不包括 float_image_id 和 float_image_token。 + *

浮动图片更新参考:[浮动图片指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/float-image-user-guide) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/PatchSpreadsheetSheetFloatImageSample.java ; + */ + public PatchSpreadsheetSheetFloatImageResp patch(PatchSpreadsheetSheetFloatImageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchSpreadsheetSheetFloatImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchSpreadsheetSheetFloatImageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询浮动图片,返回子表内所有的浮动图片信息。 + *

浮动图片参考:[浮动图片指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/float-image-user-guide) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetFloatImageSample.java ; + */ + public QuerySpreadsheetSheetFloatImageResp query(QuerySpreadsheetSheetFloatImageReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/query" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + QuerySpreadsheetSheetFloatImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QuerySpreadsheetSheetFloatImageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询浮动图片,返回子表内所有的浮动图片信息。 + *

浮动图片参考:[浮动图片指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/float-image-user-guide) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetFloatImageSample.java ; + */ + public QuerySpreadsheetSheetFloatImageResp query(QuerySpreadsheetSheetFloatImageReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/query" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + QuerySpreadsheetSheetFloatImageResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QuerySpreadsheetSheetFloatImageResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/speech_to_text/SpeechToTextService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/speech_to_text/SpeechToTextService.java new file mode 100644 index 000000000..e61dbae9f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/speech_to_text/SpeechToTextService.java @@ -0,0 +1,35 @@ +// Code generated by lark suite 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 com.lark.oapi.service.speech_to_text; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.speech_to_text.v1.V1; +import com.lark.oapi.service.speech_to_text.v1.resource.Speech; + +public class SpeechToTextService { + private final V1 v1; + private final Speech speech; // 语音识别 + + public SpeechToTextService(Config config) { + this.v1 = new V1(config); + this.speech = new Speech(config); + } + + public V1 v1() { + return v1; + } + + public Speech speech() { + return speech; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/speech_to_text/v1/SpeechToTextService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/speech_to_text/v1/SpeechToTextService.java deleted file mode 100644 index 1043eba45..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/speech_to_text/v1/SpeechToTextService.java +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.speech_to_text.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.speech_to_text.v1.model.FileRecognizeSpeechReq; -import com.lark.oapi.service.speech_to_text.v1.model.FileRecognizeSpeechResp; -import com.lark.oapi.service.speech_to_text.v1.model.StreamRecognizeSpeechReq; -import com.lark.oapi.service.speech_to_text.v1.model.StreamRecognizeSpeechResp; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class SpeechToTextService { - private static final Logger log = LoggerFactory.getLogger(SpeechToTextService.class); - private final Speech speech; // 语音识别 - - public SpeechToTextService(Config config) { - this.speech = new Speech(config); - } - - /** - * 语音识别 - * - * @return - */ - public Speech speech() { - return speech; - } - - public static class Speech { - private final Config config; - - public Speech(Config config) { - this.config = config; - } - - /** - * 语音文件识别 (ASR),语音文件识别接口,上传整段语音文件进行一次性识别。接口适合 60 秒以内音频识别 - *

单租户限流:20QPS,同租户下的应用没有限流,共享本租户的 20QPS 限流 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/speech_to_text-v1/speech/file_recognize ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/speech_to_textv1/FileRecognizeSpeechSample.java ; - */ - public FileRecognizeSpeechResp fileRecognize(FileRecognizeSpeechReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/speech_to_text/v1/speech/file_recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - FileRecognizeSpeechResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, FileRecognizeSpeechResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/speech_to_text/v1/speech/file_recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 语音文件识别 (ASR),语音文件识别接口,上传整段语音文件进行一次性识别。接口适合 60 秒以内音频识别 - *

单租户限流:20QPS,同租户下的应用没有限流,共享本租户的 20QPS 限流 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/speech_to_text-v1/speech/file_recognize ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/speech_to_textv1/FileRecognizeSpeechSample.java ; - */ - public FileRecognizeSpeechResp fileRecognize(FileRecognizeSpeechReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/speech_to_text/v1/speech/file_recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - FileRecognizeSpeechResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, FileRecognizeSpeechResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/speech_to_text/v1/speech/file_recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 语音流式识别 (ASR),语音流式接口,将整个音频文件分片进行传入模型。能够实时返回数据。建议每个音频分片的大小为 100-200ms - *

单租户限流:20 路(一个 stream_id 称为一路会话),同租户下的应用没有限流,共享本租户的 20路限流 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/speech_to_text-v1/speech/stream_recognize ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/speech_to_textv1/StreamRecognizeSpeechSample.java ; - */ - public StreamRecognizeSpeechResp streamRecognize(StreamRecognizeSpeechReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/speech_to_text/v1/speech/stream_recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - StreamRecognizeSpeechResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, StreamRecognizeSpeechResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/speech_to_text/v1/speech/stream_recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 语音流式识别 (ASR),语音流式接口,将整个音频文件分片进行传入模型。能够实时返回数据。建议每个音频分片的大小为 100-200ms - *

单租户限流:20 路(一个 stream_id 称为一路会话),同租户下的应用没有限流,共享本租户的 20路限流 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/speech_to_text-v1/speech/stream_recognize ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/speech_to_textv1/StreamRecognizeSpeechSample.java ; - */ - public StreamRecognizeSpeechResp streamRecognize(StreamRecognizeSpeechReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/speech_to_text/v1/speech/stream_recognize" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - StreamRecognizeSpeechResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, StreamRecognizeSpeechResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/speech_to_text/v1/speech/stream_recognize" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/speech_to_text/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/speech_to_text/v1/V1.java new file mode 100644 index 000000000..ae5f4b9e3 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/speech_to_text/v1/V1.java @@ -0,0 +1,29 @@ +// Code generated by lark suite 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 com.lark.oapi.service.speech_to_text.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.speech_to_text.v1.resource.Speech; + +public class V1 { + private final Speech speech; // 语音识别 + + public V1(Config config) { + this.speech = new Speech(config); + } + + public Speech speech() { + return speech; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/speech_to_text/v1/resource/Speech.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/speech_to_text/v1/resource/Speech.java new file mode 100644 index 000000000..15770d4d5 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/speech_to_text/v1/resource/Speech.java @@ -0,0 +1,177 @@ +// Code generated by lark suite 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 com.lark.oapi.service.speech_to_text.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.speech_to_text.v1.model.FileRecognizeSpeechReq; +import com.lark.oapi.service.speech_to_text.v1.model.FileRecognizeSpeechResp; +import com.lark.oapi.service.speech_to_text.v1.model.StreamRecognizeSpeechReq; +import com.lark.oapi.service.speech_to_text.v1.model.StreamRecognizeSpeechResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Speech { + private static final Logger log = LoggerFactory.getLogger(Speech.class); + private final Config config; + + public Speech(Config config) { + this.config = config; + } + + + /** + * 语音文件识别 (ASR),语音文件识别接口,上传整段语音文件进行一次性识别。接口适合 60 秒以内音频识别 + *

单租户限流:20QPS,同租户下的应用没有限流,共享本租户的 20QPS 限流 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/speech_to_text-v1/speech/file_recognize ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/speech_to_textv1/FileRecognizeSpeechSample.java ; + */ + public FileRecognizeSpeechResp fileRecognize(FileRecognizeSpeechReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/speech_to_text/v1/speech/file_recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + FileRecognizeSpeechResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, FileRecognizeSpeechResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/speech_to_text/v1/speech/file_recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 语音文件识别 (ASR),语音文件识别接口,上传整段语音文件进行一次性识别。接口适合 60 秒以内音频识别 + *

单租户限流:20QPS,同租户下的应用没有限流,共享本租户的 20QPS 限流 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/speech_to_text-v1/speech/file_recognize ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/speech_to_textv1/FileRecognizeSpeechSample.java ; + */ + public FileRecognizeSpeechResp fileRecognize(FileRecognizeSpeechReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/speech_to_text/v1/speech/file_recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + FileRecognizeSpeechResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, FileRecognizeSpeechResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/speech_to_text/v1/speech/file_recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 语音流式识别 (ASR),语音流式接口,将整个音频文件分片进行传入模型。能够实时返回数据。建议每个音频分片的大小为 100-200ms + *

单租户限流:20 路(一个 stream_id 称为一路会话),同租户下的应用没有限流,共享本租户的 20路限流 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/speech_to_text-v1/speech/stream_recognize ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/speech_to_textv1/StreamRecognizeSpeechSample.java ; + */ + public StreamRecognizeSpeechResp streamRecognize(StreamRecognizeSpeechReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/speech_to_text/v1/speech/stream_recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + StreamRecognizeSpeechResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, StreamRecognizeSpeechResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/speech_to_text/v1/speech/stream_recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 语音流式识别 (ASR),语音流式接口,将整个音频文件分片进行传入模型。能够实时返回数据。建议每个音频分片的大小为 100-200ms + *

单租户限流:20 路(一个 stream_id 称为一路会话),同租户下的应用没有限流,共享本租户的 20路限流 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/speech_to_text-v1/speech/stream_recognize ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/speech_to_textv1/StreamRecognizeSpeechSample.java ; + */ + public StreamRecognizeSpeechResp streamRecognize(StreamRecognizeSpeechReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/speech_to_text/v1/speech/stream_recognize" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + StreamRecognizeSpeechResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, StreamRecognizeSpeechResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/speech_to_text/v1/speech/stream_recognize" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/TaskService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/TaskService.java new file mode 100644 index 000000000..0ddb7854b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/TaskService.java @@ -0,0 +1,91 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task; + +import com.lark.oapi.core.Config; +import com.lark.oapi.event.IEventHandler; +import com.lark.oapi.service.task.v1.V1; +import com.lark.oapi.service.task.v1.model.P2TaskCommentUpdatedV1; +import com.lark.oapi.service.task.v1.model.P2TaskUpdateTenantV1; +import com.lark.oapi.service.task.v1.model.P2TaskUpdatedV1; +import com.lark.oapi.service.task.v1.resource.*; +import com.lark.oapi.service.task.v2.V2; + +public class TaskService { + private final V1 v1; + private final Task task; // 任务 + private final TaskCollaborator taskCollaborator; // 执行者 + private final TaskComment taskComment; // 评论 + private final TaskFollower taskFollower; // 关注人 + private final TaskReminder taskReminder; // 提醒 + private final V2 v2; + + public TaskService(Config config) { + this.v1 = new V1(config); + this.task = new Task(config); + this.taskCollaborator = new TaskCollaborator(config); + this.taskComment = new TaskComment(config); + this.taskFollower = new TaskFollower(config); + this.taskReminder = new TaskReminder(config); + this.v2 = new V2(config); + } + + public V1 v1() { + return v1; + } + + public Task task() { + return task; + } + + public TaskCollaborator taskCollaborator() { + return taskCollaborator; + } + + public TaskComment taskComment() { + return taskComment; + } + + public TaskFollower taskFollower() { + return taskFollower; + } + + public TaskReminder taskReminder() { + return taskReminder; + } + + public V2 v2() { + return v2; + } + + public abstract static class P2TaskUpdateTenantV1Handler implements IEventHandler { + @Override + public P2TaskUpdateTenantV1 getEvent() { + return new P2TaskUpdateTenantV1(); + } + } + + public abstract static class P2TaskUpdatedV1Handler implements IEventHandler { + @Override + public P2TaskUpdatedV1 getEvent() { + return new P2TaskUpdatedV1(); + } + } + + public abstract static class P2TaskCommentUpdatedV1Handler implements IEventHandler { + @Override + public P2TaskCommentUpdatedV1 getEvent() { + return new P2TaskCommentUpdatedV1(); + } + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/TaskService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/TaskService.java deleted file mode 100644 index 1780eb088..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/TaskService.java +++ /dev/null @@ -1,1670 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.task.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.event.IEventHandler; -import com.lark.oapi.service.task.v1.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class TaskService { - private static final Logger log = LoggerFactory.getLogger(TaskService.class); - private final Task task; // 任务 - private final TaskCollaborator taskCollaborator; // 执行者 - private final TaskComment taskComment; // 评论 - private final TaskFollower taskFollower; // 关注人 - private final TaskReminder taskReminder; // 提醒 - - public TaskService(Config config) { - this.task = new Task(config); - this.taskCollaborator = new TaskCollaborator(config); - this.taskComment = new TaskComment(config); - this.taskFollower = new TaskFollower(config); - this.taskReminder = new TaskReminder(config); - } - - /** - * 任务 - * - * @return - */ - public Task task() { - return task; - } - - /** - * 执行者 - * - * @return - */ - public TaskCollaborator taskCollaborator() { - return taskCollaborator; - } - - /** - * 评论 - * - * @return - */ - public TaskComment taskComment() { - return taskComment; - } - - /** - * 关注人 - * - * @return - */ - public TaskFollower taskFollower() { - return taskFollower; - } - - /** - * 提醒 - * - * @return - */ - public TaskReminder taskReminder() { - return taskReminder; - } - - public static class Task { - private final Config config; - - public Task(Config config) { - this.config = config; - } - - /** - * 批量删除执行者,该接口用于批量删除执行者 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/batch_delete_collaborator ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/BatchDeleteCollaboratorTaskSample.java ; - */ - public BatchDeleteCollaboratorTaskResp batchDeleteCollaborator(BatchDeleteCollaboratorTaskReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/task/v1/tasks/:task_id/batch_delete_collaborator" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - BatchDeleteCollaboratorTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteCollaboratorTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/batch_delete_collaborator" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量删除执行者,该接口用于批量删除执行者 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/batch_delete_collaborator ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/BatchDeleteCollaboratorTaskSample.java ; - */ - public BatchDeleteCollaboratorTaskResp batchDeleteCollaborator(BatchDeleteCollaboratorTaskReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/task/v1/tasks/:task_id/batch_delete_collaborator" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - BatchDeleteCollaboratorTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteCollaboratorTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/batch_delete_collaborator" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量删除关注人,该接口用于批量删除关注人 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/batch_delete_follower ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/BatchDeleteFollowerTaskSample.java ; - */ - public BatchDeleteFollowerTaskResp batchDeleteFollower(BatchDeleteFollowerTaskReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/task/v1/tasks/:task_id/batch_delete_follower" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - BatchDeleteFollowerTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteFollowerTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/batch_delete_follower" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量删除关注人,该接口用于批量删除关注人 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/batch_delete_follower ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/BatchDeleteFollowerTaskSample.java ; - */ - public BatchDeleteFollowerTaskResp batchDeleteFollower(BatchDeleteFollowerTaskReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/task/v1/tasks/:task_id/batch_delete_follower" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - BatchDeleteFollowerTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteFollowerTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/batch_delete_follower" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 完成任务,该接口用于将任务状态修改为“已完成”。;完成任务是指整个任务全部完成,而不支持执行者分别完成任务,执行成功后,任务对所有关联用户都变为完成状态。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/complete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CompleteTaskSample.java ; - */ - public CompleteTaskResp complete(CompleteTaskReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/task/v1/tasks/:task_id/complete" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CompleteTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CompleteTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/complete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 完成任务,该接口用于将任务状态修改为“已完成”。;完成任务是指整个任务全部完成,而不支持执行者分别完成任务,执行成功后,任务对所有关联用户都变为完成状态。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/complete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CompleteTaskSample.java ; - */ - public CompleteTaskResp complete(CompleteTaskReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/task/v1/tasks/:task_id/complete" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CompleteTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CompleteTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/complete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建任务,该接口可以创建一个任务,支持填写任务的基本信息,包括任务的标题,描述及协作者等。;在此基础上,创建任务时可以设置截止时间和重复规则,将任务设置为定期执行的重复任务。通过添加协作者,则可以让其他用户协同完成该任务。;此外,接口也提供了一些支持自定义内容的字段,调用方可以实现定制化效果,如完成任务后跳转到指定结束界面。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskSample.java ; - */ - public CreateTaskResp create(CreateTaskReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/task/v1/tasks" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建任务,该接口可以创建一个任务,支持填写任务的基本信息,包括任务的标题,描述及协作者等。;在此基础上,创建任务时可以设置截止时间和重复规则,将任务设置为定期执行的重复任务。通过添加协作者,则可以让其他用户协同完成该任务。;此外,接口也提供了一些支持自定义内容的字段,调用方可以实现定制化效果,如完成任务后跳转到指定结束界面。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskSample.java ; - */ - public CreateTaskResp create(CreateTaskReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/task/v1/tasks" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除任务,该接口用于删除任务 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskSample.java ; - */ - public DeleteTaskResp delete(DeleteTaskReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/task/v1/tasks/:task_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除任务,该接口用于删除任务 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskSample.java ; - */ - public DeleteTaskResp delete(DeleteTaskReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/task/v1/tasks/:task_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取任务详情,该接口用于获取任务详情,包括任务标题、描述、时间、来源等信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/GetTaskSample.java ; - */ - public GetTaskResp get(GetTaskReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/task/v1/tasks/:task_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取任务详情,该接口用于获取任务详情,包括任务标题、描述、时间、来源等信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/GetTaskSample.java ; - */ - public GetTaskResp get(GetTaskReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/task/v1/tasks/:task_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取任务列表,以分页的方式获取任务列表。当使用user_access_token时,获取与该用户身份相关的所有任务。当使用tenant_access_token时,获取以该应用身份通过“创建任务“接口创建的所有任务(并非获取该应用所在租户下所有用户创建的任务)。;本接口支持通过任务创建时间以及任务的完成状态对任务进行过滤。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskSample.java ; - */ - public ListTaskResp list(ListTaskReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/task/v1/tasks" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取任务列表,以分页的方式获取任务列表。当使用user_access_token时,获取与该用户身份相关的所有任务。当使用tenant_access_token时,获取以该应用身份通过“创建任务“接口创建的所有任务(并非获取该应用所在租户下所有用户创建的任务)。;本接口支持通过任务创建时间以及任务的完成状态对任务进行过滤。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskSample.java ; - */ - public ListTaskResp list(ListTaskReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/task/v1/tasks" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新任务,该接口用于修改任务的标题、描述、时间、来源等相关信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/PatchTaskSample.java ; - */ - public PatchTaskResp patch(PatchTaskReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/task/v1/tasks/:task_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新任务,该接口用于修改任务的标题、描述、时间、来源等相关信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/PatchTaskSample.java ; - */ - public PatchTaskResp patch(PatchTaskReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/task/v1/tasks/:task_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 取消完成任务,该接口用于取消任务的已完成状态 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/uncomplete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/UncompleteTaskSample.java ; - */ - public UncompleteTaskResp uncomplete(UncompleteTaskReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/task/v1/tasks/:task_id/uncomplete" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UncompleteTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UncompleteTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/uncomplete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 取消完成任务,该接口用于取消任务的已完成状态 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/uncomplete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/UncompleteTaskSample.java ; - */ - public UncompleteTaskResp uncomplete(UncompleteTaskReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/task/v1/tasks/:task_id/uncomplete" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UncompleteTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UncompleteTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/uncomplete" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class TaskCollaborator { - private final Config config; - - public TaskCollaborator(Config config) { - this.config = config; - } - - /** - * 新增执行者,该接口用于新增任务执行者,一次性可以添加多个执行者。;只有任务的创建者和执行者才能添加执行者,关注人无权限添加。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-collaborator/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskCollaboratorSample.java ; - */ - public CreateTaskCollaboratorResp create(CreateTaskCollaboratorReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/task/v1/tasks/:task_id/collaborators" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateTaskCollaboratorResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTaskCollaboratorResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/collaborators" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 新增执行者,该接口用于新增任务执行者,一次性可以添加多个执行者。;只有任务的创建者和执行者才能添加执行者,关注人无权限添加。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-collaborator/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskCollaboratorSample.java ; - */ - public CreateTaskCollaboratorResp create(CreateTaskCollaboratorReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/task/v1/tasks/:task_id/collaborators" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateTaskCollaboratorResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTaskCollaboratorResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/collaborators" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除执行者,该接口用于删除任务执行者 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-collaborator/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskCollaboratorSample.java ; - */ - public DeleteTaskCollaboratorResp delete(DeleteTaskCollaboratorReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/task/v1/tasks/:task_id/collaborators/:collaborator_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteTaskCollaboratorResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTaskCollaboratorResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/collaborators/:collaborator_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除执行者,该接口用于删除任务执行者 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-collaborator/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskCollaboratorSample.java ; - */ - public DeleteTaskCollaboratorResp delete(DeleteTaskCollaboratorReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/task/v1/tasks/:task_id/collaborators/:collaborator_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteTaskCollaboratorResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTaskCollaboratorResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/collaborators/:collaborator_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取一个任务的执行者列表,该接口用于查询任务执行者列表,支持分页,最大值为50 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-collaborator/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskCollaboratorSample.java ; - */ - public ListTaskCollaboratorResp list(ListTaskCollaboratorReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/task/v1/tasks/:task_id/collaborators" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListTaskCollaboratorResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTaskCollaboratorResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/collaborators" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取一个任务的执行者列表,该接口用于查询任务执行者列表,支持分页,最大值为50 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-collaborator/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskCollaboratorSample.java ; - */ - public ListTaskCollaboratorResp list(ListTaskCollaboratorReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/task/v1/tasks/:task_id/collaborators" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListTaskCollaboratorResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTaskCollaboratorResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/collaborators" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class TaskComment { - private final Config config; - - public TaskComment(Config config) { - this.config = config; - } - - /** - * 创建评论,该接口用于创建和回复任务的评论。当parent_id字段为0时,为创建评论;当parent_id不为0时,为回复某条评论 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskCommentSample.java ; - */ - public CreateTaskCommentResp create(CreateTaskCommentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/task/v1/tasks/:task_id/comments" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateTaskCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTaskCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/comments" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建评论,该接口用于创建和回复任务的评论。当parent_id字段为0时,为创建评论;当parent_id不为0时,为回复某条评论 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskCommentSample.java ; - */ - public CreateTaskCommentResp create(CreateTaskCommentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/task/v1/tasks/:task_id/comments" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateTaskCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTaskCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/comments" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除评论,该接口用于通过评论ID删除评论 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskCommentSample.java ; - */ - public DeleteTaskCommentResp delete(DeleteTaskCommentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/task/v1/tasks/:task_id/comments/:comment_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteTaskCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTaskCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/comments/:comment_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除评论,该接口用于通过评论ID删除评论 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskCommentSample.java ; - */ - public DeleteTaskCommentResp delete(DeleteTaskCommentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/task/v1/tasks/:task_id/comments/:comment_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteTaskCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTaskCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/comments/:comment_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取评论详情,该接口用于通过评论ID获取评论详情 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/GetTaskCommentSample.java ; - */ - public GetTaskCommentResp get(GetTaskCommentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/task/v1/tasks/:task_id/comments/:comment_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetTaskCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTaskCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/comments/:comment_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取评论详情,该接口用于通过评论ID获取评论详情 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/GetTaskCommentSample.java ; - */ - public GetTaskCommentResp get(GetTaskCommentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/task/v1/tasks/:task_id/comments/:comment_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetTaskCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTaskCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/comments/:comment_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取评论列表,该接口用于查询任务评论列表,支持分页,最大值为100 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskCommentSample.java ; - */ - public ListTaskCommentResp list(ListTaskCommentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/task/v1/tasks/:task_id/comments" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListTaskCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTaskCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/comments" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取评论列表,该接口用于查询任务评论列表,支持分页,最大值为100 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskCommentSample.java ; - */ - public ListTaskCommentResp list(ListTaskCommentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/task/v1/tasks/:task_id/comments" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListTaskCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTaskCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/comments" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新评论,该接口用于更新评论内容 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/UpdateTaskCommentSample.java ; - */ - public UpdateTaskCommentResp update(UpdateTaskCommentReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/task/v1/tasks/:task_id/comments/:comment_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UpdateTaskCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateTaskCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/comments/:comment_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新评论,该接口用于更新评论内容 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/UpdateTaskCommentSample.java ; - */ - public UpdateTaskCommentResp update(UpdateTaskCommentReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/task/v1/tasks/:task_id/comments/:comment_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UpdateTaskCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateTaskCommentResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/comments/:comment_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class TaskFollower { - private final Config config; - - public TaskFollower(Config config) { - this.config = config; - } - - /** - * 新增关注人,该接口用于创建任务关注人。可以一次性添加多位关注人。关注人ID要使用表示用户的ID。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-follower/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskFollowerSample.java ; - */ - public CreateTaskFollowerResp create(CreateTaskFollowerReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/task/v1/tasks/:task_id/followers" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateTaskFollowerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTaskFollowerResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/followers" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 新增关注人,该接口用于创建任务关注人。可以一次性添加多位关注人。关注人ID要使用表示用户的ID。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-follower/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskFollowerSample.java ; - */ - public CreateTaskFollowerResp create(CreateTaskFollowerReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/task/v1/tasks/:task_id/followers" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateTaskFollowerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTaskFollowerResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/followers" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除关注人,该接口用于删除任务关注人 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-follower/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskFollowerSample.java ; - */ - public DeleteTaskFollowerResp delete(DeleteTaskFollowerReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/task/v1/tasks/:task_id/followers/:follower_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteTaskFollowerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTaskFollowerResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/followers/:follower_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除关注人,该接口用于删除任务关注人 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-follower/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskFollowerSample.java ; - */ - public DeleteTaskFollowerResp delete(DeleteTaskFollowerReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/task/v1/tasks/:task_id/followers/:follower_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteTaskFollowerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTaskFollowerResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/followers/:follower_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取任务关注人列表,该接口用于查询任务关注人列表,支持分页,最大值为50 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-follower/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskFollowerSample.java ; - */ - public ListTaskFollowerResp list(ListTaskFollowerReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/task/v1/tasks/:task_id/followers" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListTaskFollowerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTaskFollowerResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/followers" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取任务关注人列表,该接口用于查询任务关注人列表,支持分页,最大值为50 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-follower/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskFollowerSample.java ; - */ - public ListTaskFollowerResp list(ListTaskFollowerReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/task/v1/tasks/:task_id/followers" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListTaskFollowerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTaskFollowerResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/followers" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class TaskReminder { - private final Config config; - - public TaskReminder(Config config) { - this.config = config; - } - - /** - * 新增提醒时间,该接口用于创建任务的提醒时间。提醒时间在截止时间基础上做偏移,但是偏移后的结果不能早于当前时间。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-reminder/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskReminderSample.java ; - */ - public CreateTaskReminderResp create(CreateTaskReminderReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/task/v1/tasks/:task_id/reminders" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateTaskReminderResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTaskReminderResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/reminders" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 新增提醒时间,该接口用于创建任务的提醒时间。提醒时间在截止时间基础上做偏移,但是偏移后的结果不能早于当前时间。 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-reminder/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskReminderSample.java ; - */ - public CreateTaskReminderResp create(CreateTaskReminderReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/task/v1/tasks/:task_id/reminders" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateTaskReminderResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTaskReminderResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/reminders" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除提醒时间,删除提醒时间,返回结果状态 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-reminder/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskReminderSample.java ; - */ - public DeleteTaskReminderResp delete(DeleteTaskReminderReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/task/v1/tasks/:task_id/reminders/:reminder_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteTaskReminderResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTaskReminderResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/reminders/:reminder_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除提醒时间,删除提醒时间,返回结果状态 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-reminder/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskReminderSample.java ; - */ - public DeleteTaskReminderResp delete(DeleteTaskReminderReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/task/v1/tasks/:task_id/reminders/:reminder_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteTaskReminderResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTaskReminderResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/reminders/:reminder_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询提醒时间列表,返回提醒时间列表,支持分页,最大值为50 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-reminder/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskReminderSample.java ; - */ - public ListTaskReminderResp list(ListTaskReminderReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/task/v1/tasks/:task_id/reminders" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListTaskReminderResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTaskReminderResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/reminders" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询提醒时间列表,返回提醒时间列表,支持分页,最大值为50 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-reminder/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskReminderSample.java ; - */ - public ListTaskReminderResp list(ListTaskReminderReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/task/v1/tasks/:task_id/reminders" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListTaskReminderResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTaskReminderResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/reminders" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public abstract static class P2TaskUpdateTenantV1Handler implements IEventHandler { - @Override - public P2TaskUpdateTenantV1 getEvent() { - return new P2TaskUpdateTenantV1(); - } - } - - public abstract static class P2TaskUpdatedV1Handler implements IEventHandler { - @Override - public P2TaskUpdatedV1 getEvent() { - return new P2TaskUpdatedV1(); - } - } - - public abstract static class P2TaskCommentUpdatedV1Handler implements IEventHandler { - @Override - public P2TaskCommentUpdatedV1 getEvent() { - return new P2TaskCommentUpdatedV1(); - } - } -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/V1.java new file mode 100644 index 000000000..70d729df5 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/V1.java @@ -0,0 +1,53 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.task.v1.resource.*; + +public class V1 { + private final Task task; // 任务 + private final TaskCollaborator taskCollaborator; // 执行者 + private final TaskComment taskComment; // 评论 + private final TaskFollower taskFollower; // 关注人 + private final TaskReminder taskReminder; // 提醒 + + public V1(Config config) { + this.task = new Task(config); + this.taskCollaborator = new TaskCollaborator(config); + this.taskComment = new TaskComment(config); + this.taskFollower = new TaskFollower(config); + this.taskReminder = new TaskReminder(config); + } + + public Task task() { + return task; + } + + public TaskCollaborator taskCollaborator() { + return taskCollaborator; + } + + public TaskComment taskComment() { + return taskComment; + } + + public TaskFollower taskFollower() { + return taskFollower; + } + + public TaskReminder taskReminder() { + return taskReminder; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/model/DeleteTaskCollaboratorReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/model/DeleteTaskCollaboratorReq.java index 5fbcd8442..f9dc23961 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/model/DeleteTaskCollaboratorReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/model/DeleteTaskCollaboratorReq.java @@ -43,6 +43,7 @@ public class DeleteTaskCollaboratorReq { // builder 开始 public DeleteTaskCollaboratorReq() { } + public DeleteTaskCollaboratorReq(Builder builder) { /** * 此次调用中使用的用户ID的类型 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/model/DeleteTaskFollowerReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/model/DeleteTaskFollowerReq.java index 9cb4d9c0d..93aad5a38 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/model/DeleteTaskFollowerReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/model/DeleteTaskFollowerReq.java @@ -43,6 +43,7 @@ public class DeleteTaskFollowerReq { // builder 开始 public DeleteTaskFollowerReq() { } + public DeleteTaskFollowerReq(Builder builder) { /** * 此次调用中使用的用户ID的类型 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/model/GetTaskCommentReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/model/GetTaskCommentReq.java index 125936ab2..5564ee51b 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/model/GetTaskCommentReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/model/GetTaskCommentReq.java @@ -43,6 +43,7 @@ public class GetTaskCommentReq { // builder 开始 public GetTaskCommentReq() { } + public GetTaskCommentReq(Builder builder) { /** * 此次调用中使用的用户ID的类型 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/model/UpdateTaskCommentReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/model/UpdateTaskCommentReq.java index bf7352fc2..3fd594e36 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/model/UpdateTaskCommentReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/model/UpdateTaskCommentReq.java @@ -42,6 +42,7 @@ public class UpdateTaskCommentReq { private String commentId; @Body private UpdateTaskCommentReqBody body; + // builder 开始 public UpdateTaskCommentReq() { } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/resource/Task.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/resource/Task.java new file mode 100644 index 000000000..ef8545588 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/resource/Task.java @@ -0,0 +1,632 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.task.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Task { + private static final Logger log = LoggerFactory.getLogger(Task.class); + private final Config config; + + public Task(Config config) { + this.config = config; + } + + + /** + * 批量删除执行者,该接口用于批量删除执行者 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/batch_delete_collaborator ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/BatchDeleteCollaboratorTaskSample.java ; + */ + public BatchDeleteCollaboratorTaskResp batchDeleteCollaborator(BatchDeleteCollaboratorTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v1/tasks/:task_id/batch_delete_collaborator" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + BatchDeleteCollaboratorTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteCollaboratorTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/batch_delete_collaborator" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量删除执行者,该接口用于批量删除执行者 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/batch_delete_collaborator ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/BatchDeleteCollaboratorTaskSample.java ; + */ + public BatchDeleteCollaboratorTaskResp batchDeleteCollaborator(BatchDeleteCollaboratorTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v1/tasks/:task_id/batch_delete_collaborator" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + BatchDeleteCollaboratorTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteCollaboratorTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/batch_delete_collaborator" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量删除关注人,该接口用于批量删除关注人 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/batch_delete_follower ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/BatchDeleteFollowerTaskSample.java ; + */ + public BatchDeleteFollowerTaskResp batchDeleteFollower(BatchDeleteFollowerTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v1/tasks/:task_id/batch_delete_follower" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + BatchDeleteFollowerTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteFollowerTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/batch_delete_follower" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量删除关注人,该接口用于批量删除关注人 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/batch_delete_follower ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/BatchDeleteFollowerTaskSample.java ; + */ + public BatchDeleteFollowerTaskResp batchDeleteFollower(BatchDeleteFollowerTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v1/tasks/:task_id/batch_delete_follower" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + BatchDeleteFollowerTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteFollowerTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/batch_delete_follower" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 完成任务,该接口用于将任务状态修改为“已完成”。;完成任务是指整个任务全部完成,而不支持执行者分别完成任务,执行成功后,任务对所有关联用户都变为完成状态。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/complete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CompleteTaskSample.java ; + */ + public CompleteTaskResp complete(CompleteTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v1/tasks/:task_id/complete" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CompleteTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CompleteTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/complete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 完成任务,该接口用于将任务状态修改为“已完成”。;完成任务是指整个任务全部完成,而不支持执行者分别完成任务,执行成功后,任务对所有关联用户都变为完成状态。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/complete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CompleteTaskSample.java ; + */ + public CompleteTaskResp complete(CompleteTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v1/tasks/:task_id/complete" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CompleteTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CompleteTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/complete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建任务,该接口可以创建一个任务,支持填写任务的基本信息,包括任务的标题,描述及协作者等。;在此基础上,创建任务时可以设置截止时间和重复规则,将任务设置为定期执行的重复任务。通过添加协作者,则可以让其他用户协同完成该任务。;此外,接口也提供了一些支持自定义内容的字段,调用方可以实现定制化效果,如完成任务后跳转到指定结束界面。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskSample.java ; + */ + public CreateTaskResp create(CreateTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v1/tasks" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建任务,该接口可以创建一个任务,支持填写任务的基本信息,包括任务的标题,描述及协作者等。;在此基础上,创建任务时可以设置截止时间和重复规则,将任务设置为定期执行的重复任务。通过添加协作者,则可以让其他用户协同完成该任务。;此外,接口也提供了一些支持自定义内容的字段,调用方可以实现定制化效果,如完成任务后跳转到指定结束界面。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskSample.java ; + */ + public CreateTaskResp create(CreateTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v1/tasks" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除任务,该接口用于删除任务 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskSample.java ; + */ + public DeleteTaskResp delete(DeleteTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/task/v1/tasks/:task_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除任务,该接口用于删除任务 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskSample.java ; + */ + public DeleteTaskResp delete(DeleteTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/task/v1/tasks/:task_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取任务详情,该接口用于获取任务详情,包括任务标题、描述、时间、来源等信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/GetTaskSample.java ; + */ + public GetTaskResp get(GetTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v1/tasks/:task_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取任务详情,该接口用于获取任务详情,包括任务标题、描述、时间、来源等信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/GetTaskSample.java ; + */ + public GetTaskResp get(GetTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v1/tasks/:task_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取任务列表,以分页的方式获取任务列表。当使用user_access_token时,获取与该用户身份相关的所有任务。当使用tenant_access_token时,获取以该应用身份通过“创建任务“接口创建的所有任务(并非获取该应用所在租户下所有用户创建的任务)。;本接口支持通过任务创建时间以及任务的完成状态对任务进行过滤。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskSample.java ; + */ + public ListTaskResp list(ListTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v1/tasks" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取任务列表,以分页的方式获取任务列表。当使用user_access_token时,获取与该用户身份相关的所有任务。当使用tenant_access_token时,获取以该应用身份通过“创建任务“接口创建的所有任务(并非获取该应用所在租户下所有用户创建的任务)。;本接口支持通过任务创建时间以及任务的完成状态对任务进行过滤。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskSample.java ; + */ + public ListTaskResp list(ListTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v1/tasks" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新任务,该接口用于修改任务的标题、描述、时间、来源等相关信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/PatchTaskSample.java ; + */ + public PatchTaskResp patch(PatchTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/task/v1/tasks/:task_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新任务,该接口用于修改任务的标题、描述、时间、来源等相关信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/PatchTaskSample.java ; + */ + public PatchTaskResp patch(PatchTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/task/v1/tasks/:task_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 取消完成任务,该接口用于取消任务的已完成状态 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/uncomplete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/UncompleteTaskSample.java ; + */ + public UncompleteTaskResp uncomplete(UncompleteTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v1/tasks/:task_id/uncomplete" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UncompleteTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UncompleteTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/uncomplete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 取消完成任务,该接口用于取消任务的已完成状态 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/uncomplete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/UncompleteTaskSample.java ; + */ + public UncompleteTaskResp uncomplete(UncompleteTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v1/tasks/:task_id/uncomplete" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UncompleteTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UncompleteTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/uncomplete" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/resource/TaskCollaborator.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/resource/TaskCollaborator.java new file mode 100644 index 000000000..ded84cfbe --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/resource/TaskCollaborator.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.task.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class TaskCollaborator { + private static final Logger log = LoggerFactory.getLogger(TaskCollaborator.class); + private final Config config; + + public TaskCollaborator(Config config) { + this.config = config; + } + + + /** + * 新增执行者,该接口用于新增任务执行者,一次性可以添加多个执行者。;只有任务的创建者和执行者才能添加执行者,关注人无权限添加。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-collaborator/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskCollaboratorSample.java ; + */ + public CreateTaskCollaboratorResp create(CreateTaskCollaboratorReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v1/tasks/:task_id/collaborators" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateTaskCollaboratorResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTaskCollaboratorResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/collaborators" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 新增执行者,该接口用于新增任务执行者,一次性可以添加多个执行者。;只有任务的创建者和执行者才能添加执行者,关注人无权限添加。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-collaborator/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskCollaboratorSample.java ; + */ + public CreateTaskCollaboratorResp create(CreateTaskCollaboratorReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v1/tasks/:task_id/collaborators" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateTaskCollaboratorResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTaskCollaboratorResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/collaborators" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除执行者,该接口用于删除任务执行者 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-collaborator/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskCollaboratorSample.java ; + */ + public DeleteTaskCollaboratorResp delete(DeleteTaskCollaboratorReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/task/v1/tasks/:task_id/collaborators/:collaborator_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteTaskCollaboratorResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTaskCollaboratorResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/collaborators/:collaborator_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除执行者,该接口用于删除任务执行者 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-collaborator/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskCollaboratorSample.java ; + */ + public DeleteTaskCollaboratorResp delete(DeleteTaskCollaboratorReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/task/v1/tasks/:task_id/collaborators/:collaborator_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteTaskCollaboratorResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTaskCollaboratorResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/collaborators/:collaborator_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取一个任务的执行者列表,该接口用于查询任务执行者列表,支持分页,最大值为50 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-collaborator/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskCollaboratorSample.java ; + */ + public ListTaskCollaboratorResp list(ListTaskCollaboratorReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v1/tasks/:task_id/collaborators" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListTaskCollaboratorResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTaskCollaboratorResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/collaborators" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取一个任务的执行者列表,该接口用于查询任务执行者列表,支持分页,最大值为50 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-collaborator/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskCollaboratorSample.java ; + */ + public ListTaskCollaboratorResp list(ListTaskCollaboratorReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v1/tasks/:task_id/collaborators" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListTaskCollaboratorResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTaskCollaboratorResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/collaborators" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/resource/TaskComment.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/resource/TaskComment.java new file mode 100644 index 000000000..807acc899 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/resource/TaskComment.java @@ -0,0 +1,368 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.task.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class TaskComment { + private static final Logger log = LoggerFactory.getLogger(TaskComment.class); + private final Config config; + + public TaskComment(Config config) { + this.config = config; + } + + + /** + * 创建评论,该接口用于创建和回复任务的评论。当parent_id字段为0时,为创建评论;当parent_id不为0时,为回复某条评论 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskCommentSample.java ; + */ + public CreateTaskCommentResp create(CreateTaskCommentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v1/tasks/:task_id/comments" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateTaskCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTaskCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/comments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建评论,该接口用于创建和回复任务的评论。当parent_id字段为0时,为创建评论;当parent_id不为0时,为回复某条评论 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskCommentSample.java ; + */ + public CreateTaskCommentResp create(CreateTaskCommentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v1/tasks/:task_id/comments" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateTaskCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTaskCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/comments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除评论,该接口用于通过评论ID删除评论 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskCommentSample.java ; + */ + public DeleteTaskCommentResp delete(DeleteTaskCommentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/task/v1/tasks/:task_id/comments/:comment_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteTaskCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTaskCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/comments/:comment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除评论,该接口用于通过评论ID删除评论 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskCommentSample.java ; + */ + public DeleteTaskCommentResp delete(DeleteTaskCommentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/task/v1/tasks/:task_id/comments/:comment_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteTaskCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTaskCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/comments/:comment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取评论详情,该接口用于通过评论ID获取评论详情 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/GetTaskCommentSample.java ; + */ + public GetTaskCommentResp get(GetTaskCommentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v1/tasks/:task_id/comments/:comment_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetTaskCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTaskCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/comments/:comment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取评论详情,该接口用于通过评论ID获取评论详情 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/GetTaskCommentSample.java ; + */ + public GetTaskCommentResp get(GetTaskCommentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v1/tasks/:task_id/comments/:comment_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetTaskCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTaskCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/comments/:comment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取评论列表,该接口用于查询任务评论列表,支持分页,最大值为100 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskCommentSample.java ; + */ + public ListTaskCommentResp list(ListTaskCommentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v1/tasks/:task_id/comments" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListTaskCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTaskCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/comments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取评论列表,该接口用于查询任务评论列表,支持分页,最大值为100 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskCommentSample.java ; + */ + public ListTaskCommentResp list(ListTaskCommentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v1/tasks/:task_id/comments" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListTaskCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTaskCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/comments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新评论,该接口用于更新评论内容 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/UpdateTaskCommentSample.java ; + */ + public UpdateTaskCommentResp update(UpdateTaskCommentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/task/v1/tasks/:task_id/comments/:comment_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UpdateTaskCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateTaskCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/comments/:comment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新评论,该接口用于更新评论内容 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/UpdateTaskCommentSample.java ; + */ + public UpdateTaskCommentResp update(UpdateTaskCommentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/task/v1/tasks/:task_id/comments/:comment_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UpdateTaskCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateTaskCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/comments/:comment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/resource/TaskFollower.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/resource/TaskFollower.java new file mode 100644 index 000000000..8c8c79090 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/resource/TaskFollower.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.task.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class TaskFollower { + private static final Logger log = LoggerFactory.getLogger(TaskFollower.class); + private final Config config; + + public TaskFollower(Config config) { + this.config = config; + } + + + /** + * 新增关注人,该接口用于创建任务关注人。可以一次性添加多位关注人。关注人ID要使用表示用户的ID。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-follower/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskFollowerSample.java ; + */ + public CreateTaskFollowerResp create(CreateTaskFollowerReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v1/tasks/:task_id/followers" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateTaskFollowerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTaskFollowerResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/followers" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 新增关注人,该接口用于创建任务关注人。可以一次性添加多位关注人。关注人ID要使用表示用户的ID。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-follower/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskFollowerSample.java ; + */ + public CreateTaskFollowerResp create(CreateTaskFollowerReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v1/tasks/:task_id/followers" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateTaskFollowerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTaskFollowerResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/followers" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除关注人,该接口用于删除任务关注人 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-follower/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskFollowerSample.java ; + */ + public DeleteTaskFollowerResp delete(DeleteTaskFollowerReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/task/v1/tasks/:task_id/followers/:follower_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteTaskFollowerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTaskFollowerResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/followers/:follower_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除关注人,该接口用于删除任务关注人 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-follower/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskFollowerSample.java ; + */ + public DeleteTaskFollowerResp delete(DeleteTaskFollowerReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/task/v1/tasks/:task_id/followers/:follower_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteTaskFollowerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTaskFollowerResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/followers/:follower_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取任务关注人列表,该接口用于查询任务关注人列表,支持分页,最大值为50 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-follower/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskFollowerSample.java ; + */ + public ListTaskFollowerResp list(ListTaskFollowerReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v1/tasks/:task_id/followers" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListTaskFollowerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTaskFollowerResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/followers" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取任务关注人列表,该接口用于查询任务关注人列表,支持分页,最大值为50 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-follower/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskFollowerSample.java ; + */ + public ListTaskFollowerResp list(ListTaskFollowerReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v1/tasks/:task_id/followers" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListTaskFollowerResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTaskFollowerResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/followers" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/resource/TaskReminder.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/resource/TaskReminder.java new file mode 100644 index 000000000..5c9264f9a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v1/resource/TaskReminder.java @@ -0,0 +1,236 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.task.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class TaskReminder { + private static final Logger log = LoggerFactory.getLogger(TaskReminder.class); + private final Config config; + + public TaskReminder(Config config) { + this.config = config; + } + + + /** + * 新增提醒时间,该接口用于创建任务的提醒时间。提醒时间在截止时间基础上做偏移,但是偏移后的结果不能早于当前时间。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-reminder/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskReminderSample.java ; + */ + public CreateTaskReminderResp create(CreateTaskReminderReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v1/tasks/:task_id/reminders" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateTaskReminderResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTaskReminderResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/reminders" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 新增提醒时间,该接口用于创建任务的提醒时间。提醒时间在截止时间基础上做偏移,但是偏移后的结果不能早于当前时间。 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-reminder/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskReminderSample.java ; + */ + public CreateTaskReminderResp create(CreateTaskReminderReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v1/tasks/:task_id/reminders" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateTaskReminderResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTaskReminderResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/reminders" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除提醒时间,删除提醒时间,返回结果状态 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-reminder/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskReminderSample.java ; + */ + public DeleteTaskReminderResp delete(DeleteTaskReminderReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/task/v1/tasks/:task_id/reminders/:reminder_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteTaskReminderResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTaskReminderResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/reminders/:reminder_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除提醒时间,删除提醒时间,返回结果状态 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-reminder/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskReminderSample.java ; + */ + public DeleteTaskReminderResp delete(DeleteTaskReminderReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/task/v1/tasks/:task_id/reminders/:reminder_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteTaskReminderResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTaskReminderResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/reminders/:reminder_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询提醒时间列表,返回提醒时间列表,支持分页,最大值为50 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-reminder/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskReminderSample.java ; + */ + public ListTaskReminderResp list(ListTaskReminderReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v1/tasks/:task_id/reminders" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListTaskReminderResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTaskReminderResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/reminders" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询提醒时间列表,返回提醒时间列表,支持分页,最大值为50 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-reminder/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskReminderSample.java ; + */ + public ListTaskReminderResp list(ListTaskReminderReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v1/tasks/:task_id/reminders" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListTaskReminderResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTaskReminderResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v1/tasks/:task_id/reminders" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/V2.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/V2.java new file mode 100644 index 000000000..912b1b68b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/V2.java @@ -0,0 +1,77 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.task.v2.resource.*; + +public class V2 { + private final Attachment attachment; // attachment + private final Comment comment; // comment + private final CustomField customField; // custom_field + private final CustomFieldOption customFieldOption; // custom_field.option + private final Section section; // section + private final Task task; // task + private final TaskSubtask taskSubtask; // task.subtask + private final Tasklist tasklist; // tasklist + private final TasklistActivitySubscription tasklistActivitySubscription; // tasklist.activity_subscription + + public V2(Config config) { + this.attachment = new Attachment(config); + this.comment = new Comment(config); + this.customField = new CustomField(config); + this.customFieldOption = new CustomFieldOption(config); + this.section = new Section(config); + this.task = new Task(config); + this.taskSubtask = new TaskSubtask(config); + this.tasklist = new Tasklist(config); + this.tasklistActivitySubscription = new TasklistActivitySubscription(config); + } + + public Attachment attachment() { + return attachment; + } + + public Comment comment() { + return comment; + } + + public CustomField customField() { + return customField; + } + + public CustomFieldOption customFieldOption() { + return customFieldOption; + } + + public Section section() { + return section; + } + + public Task task() { + return task; + } + + public TaskSubtask taskSubtask() { + return taskSubtask; + } + + public Tasklist tasklist() { + return tasklist; + } + + public TasklistActivitySubscription tasklistActivitySubscription() { + return tasklistActivitySubscription; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/CreateCustomFieldTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/CreateCustomFieldTypeEnum.java new file mode 100644 index 000000000..ff64e437a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/CreateCustomFieldTypeEnum.java @@ -0,0 +1,36 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.enums; + +/** + * 自定义字段类型,支持"number", "datetime", "member", "single_select", "multi_select" + */ +public enum CreateCustomFieldTypeEnum { + NUMBER("number"), // 数字 + DATETIME("datetime"), // 日期 + MEMBER("member"), // 成员 + SINGLE_SELECT("single_select"), // 单选 + MULTI_SELECT("multi_select"), // 多选 + TEXT("text"), // 文本 + ; + private String value; + + CreateCustomFieldTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/CreateCustomFieldUserIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/CreateCustomFieldUserIdTypeEnum.java new file mode 100644 index 000000000..50e05ec2e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/CreateCustomFieldUserIdTypeEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.enums; + +/** + * 表示user的ID的类型,支持open_id, user_id, union_id + */ +public enum CreateCustomFieldUserIdTypeEnum { + OPEN_ID("open_id"), // open_id + USER_ID("user_id"), // user_id + UNION_ID("union_id"), // union_id + ; + private String value; + + CreateCustomFieldUserIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/CreateTasklistActivitySubscriptionUserIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/CreateTasklistActivitySubscriptionUserIdTypeEnum.java new file mode 100644 index 000000000..289a6d718 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/CreateTasklistActivitySubscriptionUserIdTypeEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.enums; + +/** + * 用户ID类型 + */ +public enum CreateTasklistActivitySubscriptionUserIdTypeEnum { + OPEN_ID("open_id"), // open_id + UNION_ID("union_id"), // union_id + USER_ID("user_id"), // user_id + ; + private String value; + + CreateTasklistActivitySubscriptionUserIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/GetCustomFieldUserIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/GetCustomFieldUserIdTypeEnum.java new file mode 100644 index 000000000..09e6de84d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/GetCustomFieldUserIdTypeEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.enums; + +/** + * 表示user的ID的类型,支持open_id, user_id, union_id + */ +public enum GetCustomFieldUserIdTypeEnum { + OPEN_ID("open_id"), // open_id + USER_ID("user_id"), // user_id + UNION_ID("union_id"), // union_id + ; + private String value; + + GetCustomFieldUserIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/GetTasklistActivitySubscriptionUserIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/GetTasklistActivitySubscriptionUserIdTypeEnum.java new file mode 100644 index 000000000..ed0db75ff --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/GetTasklistActivitySubscriptionUserIdTypeEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.enums; + +/** + * 用户ID类型 + */ +public enum GetTasklistActivitySubscriptionUserIdTypeEnum { + OPEN_ID("open_id"), // open_id + UNION_ID("union_id"), // union_id + USER_ID("user_id"), // user_id + ; + private String value; + + GetTasklistActivitySubscriptionUserIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/InputCustomFieldTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/InputCustomFieldTypeEnum.java new file mode 100644 index 000000000..562f428c2 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/InputCustomFieldTypeEnum.java @@ -0,0 +1,36 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.enums; + +/** + * 字段类型 + */ +public enum InputCustomFieldTypeEnum { + NUMBER("number"), // 数字 + DATETIME("datetime"), // 日期 + MEMBER("member"), // 成员 + SINGLE_SELECT("single_select"), // 单选 + MULTI_SELECT("multi_select"), // 多选 + TEXT("text"), // 文本 + ; + private String value; + + InputCustomFieldTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/ListCommentDirectionEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/ListCommentDirectionEnum.java new file mode 100644 index 000000000..55dd2de7d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/ListCommentDirectionEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.enums; + +/** + * 返回数据的排序方式 + */ +public enum ListCommentDirectionEnum { + ASC("asc"), // 评论发表时间升序 + DESC("desc"), // 评论发表时间降序 + ; + private String value; + + ListCommentDirectionEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/ListCustomFieldUserIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/ListCustomFieldUserIdTypeEnum.java new file mode 100644 index 000000000..0658ccd28 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/ListCustomFieldUserIdTypeEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.enums; + +/** + * 用户ID格式,支持open_id, user_id, union_id + */ +public enum ListCustomFieldUserIdTypeEnum { + OPEN_ID("open_id"), // open_id + USER_ID("user_id"), // user_id + UNION_ID("union_id"), // union_id + ; + private String value; + + ListCustomFieldUserIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/ListTasklistActivitySubscriptionUserIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/ListTasklistActivitySubscriptionUserIdTypeEnum.java new file mode 100644 index 000000000..710163a20 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/ListTasklistActivitySubscriptionUserIdTypeEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.enums; + +/** + * 用户ID类型 + */ +public enum ListTasklistActivitySubscriptionUserIdTypeEnum { + OPEN_ID("open_id"), // open_id + UNION_ID("union_id"), // union_id + USER_ID("user_id"), // user_id + ; + private String value; + + ListTasklistActivitySubscriptionUserIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/NumberSettingCustomSymbolPositionEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/NumberSettingCustomSymbolPositionEnum.java new file mode 100644 index 000000000..6e3bd2782 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/NumberSettingCustomSymbolPositionEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.enums; + +/** + * 自定义符号显示的位置。 + */ +public enum NumberSettingCustomSymbolPositionEnum { + LETF("left"), // 自定义符号放在数字左边 + RIGHT("right"), // 自定义符号放在数字右边 + ; + private String value; + + NumberSettingCustomSymbolPositionEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/NumberSettingFormatEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/NumberSettingFormatEnum.java new file mode 100644 index 000000000..b4946bfa7 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/NumberSettingFormatEnum.java @@ -0,0 +1,35 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.enums; + +/** + * 数字展示的格式 + */ +public enum NumberSettingFormatEnum { + NORMAL("normal"), // 常规数字 + PERCENTAGE("percentage"), // 百分比格式 + CNY("cny"), // 人民币格式 + USD("usd"), // 美元格式 + CUSTOM("custom"), // 自定义符号 + ; + private String value; + + NumberSettingFormatEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/NumberSettingSeparatorEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/NumberSettingSeparatorEnum.java new file mode 100644 index 000000000..a09a50377 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/NumberSettingSeparatorEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.enums; + +/** + * 分隔符样式 + */ +public enum NumberSettingSeparatorEnum { + NONE("none"), // 无分隔符 + THOUSAND("thousand"), // 千分位分隔符 + ; + private String value; + + NumberSettingSeparatorEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/PatchCustomFieldUserIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/PatchCustomFieldUserIdTypeEnum.java new file mode 100644 index 000000000..04ea14427 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/PatchCustomFieldUserIdTypeEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.enums; + +/** + * 用户ID格式 + */ +public enum PatchCustomFieldUserIdTypeEnum { + OPEN_ID("open_id"), // open_id + UNION_ID("union_id"), // union_id + USER_ID("user_id"), // user_id + ; + private String value; + + PatchCustomFieldUserIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/PatchTasklistActivitySubscriptionUserIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/PatchTasklistActivitySubscriptionUserIdTypeEnum.java new file mode 100644 index 000000000..08242f901 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/PatchTasklistActivitySubscriptionUserIdTypeEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.enums; + +/** + * 用户ID类型 + */ +public enum PatchTasklistActivitySubscriptionUserIdTypeEnum { + OPEN_ID("open_id"), // open_id + UNION_ID("union_id"), // union_id + USER_ID("user_id"), // user_id + ; + private String value; + + PatchTasklistActivitySubscriptionUserIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/PatchTasklistOriginOwnerToRoleEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/PatchTasklistOriginOwnerToRoleEnum.java new file mode 100644 index 000000000..153666566 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/PatchTasklistOriginOwnerToRoleEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.enums; + +/** + * 该字段表示如果更新了新的负责人,则将原负责人设为指定的协作人角色。仅在update_fields包含owner字段时生效。根据清单的角色设计方式,不允许提前为清单的负责人添加其他角色,但负责人更新后,原有负责人会无法访问该清单。该字段可以帮助避免原负责人彻底退出清单。 + */ +public enum PatchTasklistOriginOwnerToRoleEnum { + EDITOR("editor"), // 原负责人变为可编辑角色的协作人 + VIEWER("viewer"), // 原负责人变为可阅读角色的协作人 + NONE("none"), // 原负责人直接退出清单 + ; + private String value; + + PatchTasklistOriginOwnerToRoleEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/TaskDependencyDependencyTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/TaskDependencyDependencyTypeEnum.java new file mode 100644 index 000000000..5446665b5 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/TaskDependencyDependencyTypeEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.enums; + +/** + * 依赖类型 + */ +public enum TaskDependencyDependencyTypeEnum { + PREV("prev"), // 前置依赖 + NEXT("next"), // 后置依赖 + ; + private String value; + + TaskDependencyDependencyTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/TaskSourceEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/TaskSourceEnum.java new file mode 100644 index 000000000..983059f8a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/TaskSourceEnum.java @@ -0,0 +1,36 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.enums; + +/** + * 任务创建的来源 + */ +public enum TaskSourceEnum { + UNKNOWN_SOURCE_TYPE(0), // 未知来源 + TASK(1), // 任务中心 + IM(2), // 群组任务/消息转任务 + OAPI(6), // 通过开放平台以tenant_access_token授权创建的任务 + OAPI_USER(7), // 通过开放平台以user_access_token授权创建的任务 + DOCX(8), // 文档任务 + ; + private Integer value; + + TaskSourceEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/UploadAttachmentUserIdTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/UploadAttachmentUserIdTypeEnum.java new file mode 100644 index 000000000..a8ded7429 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/enums/UploadAttachmentUserIdTypeEnum.java @@ -0,0 +1,33 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.enums; + +/** + * 表示user的ID的类型,支持open_id, user_id, union_id + */ +public enum UploadAttachmentUserIdTypeEnum { + OPEN_ID("open_id"), // open id + UNION_ID("union_id"), // union id + USER_ID("user_id"), // user_id + ; + private String value; + + UploadAttachmentUserIdTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ActivityRecord.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ActivityRecord.java new file mode 100644 index 000000000..9b90a7d7e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ActivityRecord.java @@ -0,0 +1,296 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class ActivityRecord { + /** + * 动态类型的key + *

示例值:138 + */ + @SerializedName("key") + private Integer key; + /** + * 动态的内容 + *

示例值:@小明 完成了工作计划的任务 + */ + @SerializedName("content") + private String content; + /** + * 动态的发生的时间戳(ms) + *

示例值:1665469397000 + */ + @SerializedName("created_at") + private String createdAt; + /** + * 动态发起者 + *

示例值: + */ + @SerializedName("op_user") + private Member opUser; + /** + * key对应的名称 + *

示例值:"add task into tasklist" + */ + @SerializedName("key_name") + private String keyName; + /** + * 动态相关的任务的guid。当动态是一个任务的动态时有值。 + *

示例值:ead413d9-4027-490e-9089-b1b241d3b15d + */ + @SerializedName("target_task_guid") + private String targetTaskGuid; + /** + * target_task_guid对应的任务的名称。当target_task_guid有值时会提供。 + *

示例值:完成本周周报。 + */ + @SerializedName("target_task_name") + private String targetTaskName; + + // builder 开始 + public ActivityRecord() { + } + + public ActivityRecord(Builder builder) { + /** + * 动态类型的key + *

示例值:138 + */ + this.key = builder.key; + /** + * 动态的内容 + *

示例值:@小明 完成了工作计划的任务 + */ + this.content = builder.content; + /** + * 动态的发生的时间戳(ms) + *

示例值:1665469397000 + */ + this.createdAt = builder.createdAt; + /** + * 动态发起者 + *

示例值: + */ + this.opUser = builder.opUser; + /** + * key对应的名称 + *

示例值:"add task into tasklist" + */ + this.keyName = builder.keyName; + /** + * 动态相关的任务的guid。当动态是一个任务的动态时有值。 + *

示例值:ead413d9-4027-490e-9089-b1b241d3b15d + */ + this.targetTaskGuid = builder.targetTaskGuid; + /** + * target_task_guid对应的任务的名称。当target_task_guid有值时会提供。 + *

示例值:完成本周周报。 + */ + this.targetTaskName = builder.targetTaskName; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Integer getKey() { + return this.key; + } + + public void setKey(Integer key) { + this.key = key; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getCreatedAt() { + return this.createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public Member getOpUser() { + return this.opUser; + } + + public void setOpUser(Member opUser) { + this.opUser = opUser; + } + + public String getKeyName() { + return this.keyName; + } + + public void setKeyName(String keyName) { + this.keyName = keyName; + } + + public String getTargetTaskGuid() { + return this.targetTaskGuid; + } + + public void setTargetTaskGuid(String targetTaskGuid) { + this.targetTaskGuid = targetTaskGuid; + } + + public String getTargetTaskName() { + return this.targetTaskName; + } + + public void setTargetTaskName(String targetTaskName) { + this.targetTaskName = targetTaskName; + } + + public static class Builder { + /** + * 动态类型的key + *

示例值:138 + */ + private Integer key; + /** + * 动态的内容 + *

示例值:@小明 完成了工作计划的任务 + */ + private String content; + /** + * 动态的发生的时间戳(ms) + *

示例值:1665469397000 + */ + private String createdAt; + /** + * 动态发起者 + *

示例值: + */ + private Member opUser; + /** + * key对应的名称 + *

示例值:"add task into tasklist" + */ + private String keyName; + /** + * 动态相关的任务的guid。当动态是一个任务的动态时有值。 + *

示例值:ead413d9-4027-490e-9089-b1b241d3b15d + */ + private String targetTaskGuid; + /** + * target_task_guid对应的任务的名称。当target_task_guid有值时会提供。 + *

示例值:完成本周周报。 + */ + private String targetTaskName; + + /** + * 动态类型的key + *

示例值:138 + * + * @param key + * @return + */ + public Builder key(Integer key) { + this.key = key; + return this; + } + + + /** + * 动态的内容 + *

示例值:@小明 完成了工作计划的任务 + * + * @param content + * @return + */ + public Builder content(String content) { + this.content = content; + return this; + } + + + /** + * 动态的发生的时间戳(ms) + *

示例值:1665469397000 + * + * @param createdAt + * @return + */ + public Builder createdAt(String createdAt) { + this.createdAt = createdAt; + return this; + } + + + /** + * 动态发起者 + *

示例值: + * + * @param opUser + * @return + */ + public Builder opUser(Member opUser) { + this.opUser = opUser; + return this; + } + + + /** + * key对应的名称 + *

示例值:"add task into tasklist" + * + * @param keyName + * @return + */ + public Builder keyName(String keyName) { + this.keyName = keyName; + return this; + } + + + /** + * 动态相关的任务的guid。当动态是一个任务的动态时有值。 + *

示例值:ead413d9-4027-490e-9089-b1b241d3b15d + * + * @param targetTaskGuid + * @return + */ + public Builder targetTaskGuid(String targetTaskGuid) { + this.targetTaskGuid = targetTaskGuid; + return this; + } + + + /** + * target_task_guid对应的任务的名称。当target_task_guid有值时会提供。 + *

示例值:完成本周周报。 + * + * @param targetTaskName + * @return + */ + public Builder targetTaskName(String targetTaskName) { + this.targetTaskName = targetTaskName; + return this; + } + + + public ActivityRecord build() { + return new ActivityRecord(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddCustomFieldReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddCustomFieldReq.java new file mode 100644 index 000000000..c260aedb1 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddCustomFieldReq.java @@ -0,0 +1,100 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Path; + +public class AddCustomFieldReq { + /** + * 自定义字段GUID + *

示例值:0110a4bd-f24b-4a93-8c1a-1732b94f9593 + */ + @Path + @SerializedName("custom_field_guid") + private String customFieldGuid; + @Body + private AddCustomFieldReqBody body; + + // builder 开始 + public AddCustomFieldReq() { + } + + public AddCustomFieldReq(Builder builder) { + /** + * 自定义字段GUID + *

示例值:0110a4bd-f24b-4a93-8c1a-1732b94f9593 + */ + this.customFieldGuid = builder.customFieldGuid; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getCustomFieldGuid() { + return this.customFieldGuid; + } + + public void setCustomFieldGuid(String customFieldGuid) { + this.customFieldGuid = customFieldGuid; + } + + public AddCustomFieldReqBody getAddCustomFieldReqBody() { + return this.body; + } + + public void setAddCustomFieldReqBody(AddCustomFieldReqBody body) { + this.body = body; + } + + public static class Builder { + + private String customFieldGuid; // 自定义字段GUID + private AddCustomFieldReqBody body; + + /** + * 自定义字段GUID + *

示例值:0110a4bd-f24b-4a93-8c1a-1732b94f9593 + * + * @param customFieldGuid + * @return + */ + public Builder customFieldGuid(String customFieldGuid) { + this.customFieldGuid = customFieldGuid; + return this; + } + + public AddCustomFieldReqBody getAddCustomFieldReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder addCustomFieldReqBody(AddCustomFieldReqBody body) { + this.body = body; + return this; + } + + public AddCustomFieldReq build() { + return new AddCustomFieldReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddCustomFieldReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddCustomFieldReqBody.java new file mode 100644 index 000000000..f34b6e70c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddCustomFieldReqBody.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class AddCustomFieldReqBody { + /** + * 要将自定义字段添加到一个资源的资源类型。目前只支持tasklist + *

示例值:tasklist + */ + @SerializedName("resource_type") + private String resourceType; + /** + * 要将自定义字段添加到的资源id,目前只支持tasklist_guid + *

示例值:0110a4bd-f24b-4a93-8c1a-1732b94f9593 + */ + @SerializedName("resource_id") + private String resourceId; + + // builder 开始 + public AddCustomFieldReqBody() { + } + + public AddCustomFieldReqBody(Builder builder) { + /** + * 要将自定义字段添加到一个资源的资源类型。目前只支持tasklist + *

示例值:tasklist + */ + this.resourceType = builder.resourceType; + /** + * 要将自定义字段添加到的资源id,目前只支持tasklist_guid + *

示例值:0110a4bd-f24b-4a93-8c1a-1732b94f9593 + */ + this.resourceId = builder.resourceId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getResourceType() { + return this.resourceType; + } + + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + public String getResourceId() { + return this.resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public static class Builder { + /** + * 要将自定义字段添加到一个资源的资源类型。目前只支持tasklist + *

示例值:tasklist + */ + private String resourceType; + /** + * 要将自定义字段添加到的资源id,目前只支持tasklist_guid + *

示例值:0110a4bd-f24b-4a93-8c1a-1732b94f9593 + */ + private String resourceId; + + /** + * 要将自定义字段添加到一个资源的资源类型。目前只支持tasklist + *

示例值:tasklist + * + * @param resourceType + * @return + */ + public Builder resourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + + /** + * 要将自定义字段添加到的资源id,目前只支持tasklist_guid + *

示例值:0110a4bd-f24b-4a93-8c1a-1732b94f9593 + * + * @param resourceId + * @return + */ + public Builder resourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + + public AddCustomFieldReqBody build() { + return new AddCustomFieldReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddCustomFieldResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddCustomFieldResp.java new file mode 100644 index 000000000..7cf2e8e37 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddCustomFieldResp.java @@ -0,0 +1,20 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; +import com.lark.oapi.core.response.EmptyData; + +public class AddCustomFieldResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddDependenciesTaskReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddDependenciesTaskReq.java new file mode 100644 index 000000000..2a79a31d0 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddDependenciesTaskReq.java @@ -0,0 +1,100 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Path; + +public class AddDependenciesTaskReq { + /** + * 任务GUID + *

示例值:93b7bd05-35e6-4371-b3c9-6b7cbd7100c0 + */ + @Path + @SerializedName("task_guid") + private String taskGuid; + @Body + private AddDependenciesTaskReqBody body; + + // builder 开始 + public AddDependenciesTaskReq() { + } + + public AddDependenciesTaskReq(Builder builder) { + /** + * 任务GUID + *

示例值:93b7bd05-35e6-4371-b3c9-6b7cbd7100c0 + */ + this.taskGuid = builder.taskGuid; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getTaskGuid() { + return this.taskGuid; + } + + public void setTaskGuid(String taskGuid) { + this.taskGuid = taskGuid; + } + + public AddDependenciesTaskReqBody getAddDependenciesTaskReqBody() { + return this.body; + } + + public void setAddDependenciesTaskReqBody(AddDependenciesTaskReqBody body) { + this.body = body; + } + + public static class Builder { + + private String taskGuid; // 任务GUID + private AddDependenciesTaskReqBody body; + + /** + * 任务GUID + *

示例值:93b7bd05-35e6-4371-b3c9-6b7cbd7100c0 + * + * @param taskGuid + * @return + */ + public Builder taskGuid(String taskGuid) { + this.taskGuid = taskGuid; + return this; + } + + public AddDependenciesTaskReqBody getAddDependenciesTaskReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder addDependenciesTaskReqBody(AddDependenciesTaskReqBody body) { + this.body = body; + return this; + } + + public AddDependenciesTaskReq build() { + return new AddDependenciesTaskReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddDependenciesTaskReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddDependenciesTaskReqBody.java new file mode 100644 index 000000000..fcb5ec825 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddDependenciesTaskReqBody.java @@ -0,0 +1,74 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class AddDependenciesTaskReqBody { + /** + * 要添加的依赖 + *

示例值: + */ + @SerializedName("dependencies") + private TaskDependency[] dependencies; + + // builder 开始 + public AddDependenciesTaskReqBody() { + } + + public AddDependenciesTaskReqBody(Builder builder) { + /** + * 要添加的依赖 + *

示例值: + */ + this.dependencies = builder.dependencies; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public TaskDependency[] getDependencies() { + return this.dependencies; + } + + public void setDependencies(TaskDependency[] dependencies) { + this.dependencies = dependencies; + } + + public static class Builder { + /** + * 要添加的依赖 + *

示例值: + */ + private TaskDependency[] dependencies; + + /** + * 要添加的依赖 + *

示例值: + * + * @param dependencies + * @return + */ + public Builder dependencies(TaskDependency[] dependencies) { + this.dependencies = dependencies; + return this; + } + + + public AddDependenciesTaskReqBody build() { + return new AddDependenciesTaskReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddDependenciesTaskResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddDependenciesTaskResp.java new file mode 100644 index 000000000..4bfb840f8 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddDependenciesTaskResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class AddDependenciesTaskResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddDependenciesTaskRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddDependenciesTaskRespBody.java new file mode 100644 index 000000000..d7931b95f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddDependenciesTaskRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class AddDependenciesTaskRespBody { + /** + * 被添加后任务的所有依赖 + *

示例值: + */ + @SerializedName("dependencies") + private TaskDependency[] dependencies; + + public TaskDependency[] getDependencies() { + return this.dependencies; + } + + public void setDependencies(TaskDependency[] dependencies) { + this.dependencies = dependencies; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTaskReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTaskReq.java new file mode 100644 index 000000000..5bccfffe6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTaskReq.java @@ -0,0 +1,133 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class AddMembersTaskReq { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 要添加负责人的任务全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + @Path + @SerializedName("task_guid") + private String taskGuid; + @Body + private AddMembersTaskReqBody body; + + // builder 开始 + public AddMembersTaskReq() { + } + + public AddMembersTaskReq(Builder builder) { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 要添加负责人的任务全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + this.taskGuid = builder.taskGuid; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getTaskGuid() { + return this.taskGuid; + } + + public void setTaskGuid(String taskGuid) { + this.taskGuid = taskGuid; + } + + public AddMembersTaskReqBody getAddMembersTaskReqBody() { + return this.body; + } + + public void setAddMembersTaskReqBody(AddMembersTaskReqBody body) { + this.body = body; + } + + public static class Builder { + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private String taskGuid; // 要添加负责人的任务全局唯一ID + private AddMembersTaskReqBody body; + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 要添加负责人的任务全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + * + * @param taskGuid + * @return + */ + public Builder taskGuid(String taskGuid) { + this.taskGuid = taskGuid; + return this; + } + + public AddMembersTaskReqBody getAddMembersTaskReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder addMembersTaskReqBody(AddMembersTaskReqBody body) { + this.body = body; + return this; + } + + public AddMembersTaskReq build() { + return new AddMembersTaskReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTaskReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTaskReqBody.java new file mode 100644 index 000000000..ab2bbc36c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTaskReqBody.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class AddMembersTaskReqBody { + /** + * 要添加的members列表 + *

示例值: + */ + @SerializedName("members") + private Member[] members; + /** + * 幂等token,如果提供则实现幂等行为 + *

示例值:6d99f59c-4d7d-4452-98d6-3d0556393cf6 + */ + @SerializedName("client_token") + private String clientToken; + + // builder 开始 + public AddMembersTaskReqBody() { + } + + public AddMembersTaskReqBody(Builder builder) { + /** + * 要添加的members列表 + *

示例值: + */ + this.members = builder.members; + /** + * 幂等token,如果提供则实现幂等行为 + *

示例值:6d99f59c-4d7d-4452-98d6-3d0556393cf6 + */ + this.clientToken = builder.clientToken; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Member[] getMembers() { + return this.members; + } + + public void setMembers(Member[] members) { + this.members = members; + } + + public String getClientToken() { + return this.clientToken; + } + + public void setClientToken(String clientToken) { + this.clientToken = clientToken; + } + + public static class Builder { + /** + * 要添加的members列表 + *

示例值: + */ + private Member[] members; + /** + * 幂等token,如果提供则实现幂等行为 + *

示例值:6d99f59c-4d7d-4452-98d6-3d0556393cf6 + */ + private String clientToken; + + /** + * 要添加的members列表 + *

示例值: + * + * @param members + * @return + */ + public Builder members(Member[] members) { + this.members = members; + return this; + } + + + /** + * 幂等token,如果提供则实现幂等行为 + *

示例值:6d99f59c-4d7d-4452-98d6-3d0556393cf6 + * + * @param clientToken + * @return + */ + public Builder clientToken(String clientToken) { + this.clientToken = clientToken; + return this; + } + + + public AddMembersTaskReqBody build() { + return new AddMembersTaskReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTaskResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTaskResp.java new file mode 100644 index 000000000..e8a6d8b84 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTaskResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class AddMembersTaskResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTaskRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTaskRespBody.java new file mode 100644 index 000000000..f689ee96b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTaskRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class AddMembersTaskRespBody { + /** + * 更新完成后的任务实体数据 + *

示例值: + */ + @SerializedName("task") + private Task task; + + public Task getTask() { + return this.task; + } + + public void setTask(Task task) { + this.task = task; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTasklistReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTasklistReq.java new file mode 100644 index 000000000..46057e190 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTasklistReq.java @@ -0,0 +1,133 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class AddMembersTasklistReq { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 要添加协作人的清单的全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + @Path + @SerializedName("tasklist_guid") + private String tasklistGuid; + @Body + private AddMembersTasklistReqBody body; + + // builder 开始 + public AddMembersTasklistReq() { + } + + public AddMembersTasklistReq(Builder builder) { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 要添加协作人的清单的全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + this.tasklistGuid = builder.tasklistGuid; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getTasklistGuid() { + return this.tasklistGuid; + } + + public void setTasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + } + + public AddMembersTasklistReqBody getAddMembersTasklistReqBody() { + return this.body; + } + + public void setAddMembersTasklistReqBody(AddMembersTasklistReqBody body) { + this.body = body; + } + + public static class Builder { + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private String tasklistGuid; // 要添加协作人的清单的全局唯一ID + private AddMembersTasklistReqBody body; + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 要添加协作人的清单的全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + * + * @param tasklistGuid + * @return + */ + public Builder tasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + return this; + } + + public AddMembersTasklistReqBody getAddMembersTasklistReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder addMembersTasklistReqBody(AddMembersTasklistReqBody body) { + this.body = body; + return this; + } + + public AddMembersTasklistReq build() { + return new AddMembersTasklistReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTasklistReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTasklistReqBody.java new file mode 100644 index 000000000..ba12d8ea6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTasklistReqBody.java @@ -0,0 +1,74 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class AddMembersTasklistReqBody { + /** + * 要添加的成员列表 + *

示例值: + */ + @SerializedName("members") + private Member[] members; + + // builder 开始 + public AddMembersTasklistReqBody() { + } + + public AddMembersTasklistReqBody(Builder builder) { + /** + * 要添加的成员列表 + *

示例值: + */ + this.members = builder.members; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Member[] getMembers() { + return this.members; + } + + public void setMembers(Member[] members) { + this.members = members; + } + + public static class Builder { + /** + * 要添加的成员列表 + *

示例值: + */ + private Member[] members; + + /** + * 要添加的成员列表 + *

示例值: + * + * @param members + * @return + */ + public Builder members(Member[] members) { + this.members = members; + return this; + } + + + public AddMembersTasklistReqBody build() { + return new AddMembersTasklistReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTasklistResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTasklistResp.java new file mode 100644 index 000000000..f1ea50f98 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTasklistResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class AddMembersTasklistResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTasklistRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTasklistRespBody.java new file mode 100644 index 000000000..8b7f903ed --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddMembersTasklistRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class AddMembersTasklistRespBody { + /** + * 完成更新后的清单实体 + *

示例值: + */ + @SerializedName("tasklist") + private Tasklist tasklist; + + public Tasklist getTasklist() { + return this.tasklist; + } + + public void setTasklist(Tasklist tasklist) { + this.tasklist = tasklist; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddRemindersTaskReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddRemindersTaskReq.java new file mode 100644 index 000000000..19f4530c7 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddRemindersTaskReq.java @@ -0,0 +1,133 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class AddRemindersTaskReq { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 要添加负责人的任务全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + @Path + @SerializedName("task_guid") + private String taskGuid; + @Body + private AddRemindersTaskReqBody body; + + // builder 开始 + public AddRemindersTaskReq() { + } + + public AddRemindersTaskReq(Builder builder) { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 要添加负责人的任务全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + this.taskGuid = builder.taskGuid; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getTaskGuid() { + return this.taskGuid; + } + + public void setTaskGuid(String taskGuid) { + this.taskGuid = taskGuid; + } + + public AddRemindersTaskReqBody getAddRemindersTaskReqBody() { + return this.body; + } + + public void setAddRemindersTaskReqBody(AddRemindersTaskReqBody body) { + this.body = body; + } + + public static class Builder { + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private String taskGuid; // 要添加负责人的任务全局唯一ID + private AddRemindersTaskReqBody body; + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 要添加负责人的任务全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + * + * @param taskGuid + * @return + */ + public Builder taskGuid(String taskGuid) { + this.taskGuid = taskGuid; + return this; + } + + public AddRemindersTaskReqBody getAddRemindersTaskReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder addRemindersTaskReqBody(AddRemindersTaskReqBody body) { + this.body = body; + return this; + } + + public AddRemindersTaskReq build() { + return new AddRemindersTaskReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddRemindersTaskReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddRemindersTaskReqBody.java new file mode 100644 index 000000000..053bc1c05 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddRemindersTaskReqBody.java @@ -0,0 +1,74 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class AddRemindersTaskReqBody { + /** + * 要添加的reminder的列表 + *

示例值: + */ + @SerializedName("reminders") + private Reminder[] reminders; + + // builder 开始 + public AddRemindersTaskReqBody() { + } + + public AddRemindersTaskReqBody(Builder builder) { + /** + * 要添加的reminder的列表 + *

示例值: + */ + this.reminders = builder.reminders; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Reminder[] getReminders() { + return this.reminders; + } + + public void setReminders(Reminder[] reminders) { + this.reminders = reminders; + } + + public static class Builder { + /** + * 要添加的reminder的列表 + *

示例值: + */ + private Reminder[] reminders; + + /** + * 要添加的reminder的列表 + *

示例值: + * + * @param reminders + * @return + */ + public Builder reminders(Reminder[] reminders) { + this.reminders = reminders; + return this; + } + + + public AddRemindersTaskReqBody build() { + return new AddRemindersTaskReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddRemindersTaskResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddRemindersTaskResp.java new file mode 100644 index 000000000..733d9562a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddRemindersTaskResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class AddRemindersTaskResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddRemindersTaskRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddRemindersTaskRespBody.java new file mode 100644 index 000000000..78978dbcc --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddRemindersTaskRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class AddRemindersTaskRespBody { + /** + * 更新完成后的任务实体 + *

示例值: + */ + @SerializedName("task") + private Task task; + + public Task getTask() { + return this.task; + } + + public void setTask(Task task) { + this.task = task; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddTasklistTaskReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddTasklistTaskReq.java new file mode 100644 index 000000000..9039cb64d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddTasklistTaskReq.java @@ -0,0 +1,133 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class AddTasklistTaskReq { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 要添加到清单的任务的全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + @Path + @SerializedName("task_guid") + private String taskGuid; + @Body + private AddTasklistTaskReqBody body; + + // builder 开始 + public AddTasklistTaskReq() { + } + + public AddTasklistTaskReq(Builder builder) { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 要添加到清单的任务的全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + this.taskGuid = builder.taskGuid; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getTaskGuid() { + return this.taskGuid; + } + + public void setTaskGuid(String taskGuid) { + this.taskGuid = taskGuid; + } + + public AddTasklistTaskReqBody getAddTasklistTaskReqBody() { + return this.body; + } + + public void setAddTasklistTaskReqBody(AddTasklistTaskReqBody body) { + this.body = body; + } + + public static class Builder { + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private String taskGuid; // 要添加到清单的任务的全局唯一ID + private AddTasklistTaskReqBody body; + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 要添加到清单的任务的全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + * + * @param taskGuid + * @return + */ + public Builder taskGuid(String taskGuid) { + this.taskGuid = taskGuid; + return this; + } + + public AddTasklistTaskReqBody getAddTasklistTaskReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder addTasklistTaskReqBody(AddTasklistTaskReqBody body) { + this.body = body; + return this; + } + + public AddTasklistTaskReq build() { + return new AddTasklistTaskReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddTasklistTaskReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddTasklistTaskReqBody.java new file mode 100644 index 000000000..c423cdc95 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddTasklistTaskReqBody.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class AddTasklistTaskReqBody { + /** + * 要添加到的清单的全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + @SerializedName("tasklist_guid") + private String tasklistGuid; + /** + * 要添加到清单的自定义分组全局唯一ID,如不填写表示添加到默认分组 + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + @SerializedName("section_guid") + private String sectionGuid; + + // builder 开始 + public AddTasklistTaskReqBody() { + } + + public AddTasklistTaskReqBody(Builder builder) { + /** + * 要添加到的清单的全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + this.tasklistGuid = builder.tasklistGuid; + /** + * 要添加到清单的自定义分组全局唯一ID,如不填写表示添加到默认分组 + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + this.sectionGuid = builder.sectionGuid; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getTasklistGuid() { + return this.tasklistGuid; + } + + public void setTasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + } + + public String getSectionGuid() { + return this.sectionGuid; + } + + public void setSectionGuid(String sectionGuid) { + this.sectionGuid = sectionGuid; + } + + public static class Builder { + /** + * 要添加到的清单的全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + private String tasklistGuid; + /** + * 要添加到清单的自定义分组全局唯一ID,如不填写表示添加到默认分组 + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + private String sectionGuid; + + /** + * 要添加到的清单的全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + * + * @param tasklistGuid + * @return + */ + public Builder tasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + return this; + } + + + /** + * 要添加到清单的自定义分组全局唯一ID,如不填写表示添加到默认分组 + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + * + * @param sectionGuid + * @return + */ + public Builder sectionGuid(String sectionGuid) { + this.sectionGuid = sectionGuid; + return this; + } + + + public AddTasklistTaskReqBody build() { + return new AddTasklistTaskReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddTasklistTaskResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddTasklistTaskResp.java new file mode 100644 index 000000000..68dca16ad --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddTasklistTaskResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class AddTasklistTaskResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddTasklistTaskRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddTasklistTaskRespBody.java new file mode 100644 index 000000000..8b4bc1394 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/AddTasklistTaskRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class AddTasklistTaskRespBody { + /** + * 添加后的任务详情 + *

示例值: + */ + @SerializedName("task") + private Task task; + + public Task getTask() { + return this.task; + } + + public void setTask(Task task) { + this.task = task; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Attachment.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Attachment.java new file mode 100644 index 000000000..6d7754cad --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Attachment.java @@ -0,0 +1,370 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Attachment { + /** + * 附件guid + *

示例值:f860de3e-6881-4ddd-9321-070f36d1af0b + */ + @SerializedName("guid") + private String guid; + /** + * 附件在云文档系统中的token + *

示例值:boxcnTDqPaRA6JbYnzQsZ2doB2b + */ + @SerializedName("file_token") + private String fileToken; + /** + * 附件名 + *

示例值:foo.jpg + */ + @SerializedName("name") + private String name; + /** + * 附件的字节大小 + *

示例值:62232 + */ + @SerializedName("size") + private Integer size; + /** + * 附件归属的资源 + *

示例值: + */ + @SerializedName("resource") + private Resource resource; + /** + * 附件上传者 + *

示例值: + */ + @SerializedName("uploader") + private Member uploader; + /** + * 是否是封面图 + *

示例值:false + */ + @SerializedName("is_cover") + private Boolean isCover; + /** + * 上传时间戳(ms) + *

示例值:1675742789470 + */ + @SerializedName("uploaded_at") + private String uploadedAt; + /** + * 附件的临时下载url,有效时间3分钟,且只允许调用3次进行附件下载。只有在获取附件时会动态生成。 + *

示例值:https://example.com/download/authcode/?code=OWMzNDlmMjJmZThkYzZkZGJlMjYwZTI0OTUxZTE2MDJfMDZmZmMwOWVj + */ + @SerializedName("url") + private String url; + + // builder 开始 + public Attachment() { + } + + public Attachment(Builder builder) { + /** + * 附件guid + *

示例值:f860de3e-6881-4ddd-9321-070f36d1af0b + */ + this.guid = builder.guid; + /** + * 附件在云文档系统中的token + *

示例值:boxcnTDqPaRA6JbYnzQsZ2doB2b + */ + this.fileToken = builder.fileToken; + /** + * 附件名 + *

示例值:foo.jpg + */ + this.name = builder.name; + /** + * 附件的字节大小 + *

示例值:62232 + */ + this.size = builder.size; + /** + * 附件归属的资源 + *

示例值: + */ + this.resource = builder.resource; + /** + * 附件上传者 + *

示例值: + */ + this.uploader = builder.uploader; + /** + * 是否是封面图 + *

示例值:false + */ + this.isCover = builder.isCover; + /** + * 上传时间戳(ms) + *

示例值:1675742789470 + */ + this.uploadedAt = builder.uploadedAt; + /** + * 附件的临时下载url,有效时间3分钟,且只允许调用3次进行附件下载。只有在获取附件时会动态生成。 + *

示例值:https://example.com/download/authcode/?code=OWMzNDlmMjJmZThkYzZkZGJlMjYwZTI0OTUxZTE2MDJfMDZmZmMwOWVj + */ + this.url = builder.url; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getGuid() { + return this.guid; + } + + public void setGuid(String guid) { + this.guid = guid; + } + + public String getFileToken() { + return this.fileToken; + } + + public void setFileToken(String fileToken) { + this.fileToken = fileToken; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getSize() { + return this.size; + } + + public void setSize(Integer size) { + this.size = size; + } + + public Resource getResource() { + return this.resource; + } + + public void setResource(Resource resource) { + this.resource = resource; + } + + public Member getUploader() { + return this.uploader; + } + + public void setUploader(Member uploader) { + this.uploader = uploader; + } + + public Boolean getIsCover() { + return this.isCover; + } + + public void setIsCover(Boolean isCover) { + this.isCover = isCover; + } + + public String getUploadedAt() { + return this.uploadedAt; + } + + public void setUploadedAt(String uploadedAt) { + this.uploadedAt = uploadedAt; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } + + public static class Builder { + /** + * 附件guid + *

示例值:f860de3e-6881-4ddd-9321-070f36d1af0b + */ + private String guid; + /** + * 附件在云文档系统中的token + *

示例值:boxcnTDqPaRA6JbYnzQsZ2doB2b + */ + private String fileToken; + /** + * 附件名 + *

示例值:foo.jpg + */ + private String name; + /** + * 附件的字节大小 + *

示例值:62232 + */ + private Integer size; + /** + * 附件归属的资源 + *

示例值: + */ + private Resource resource; + /** + * 附件上传者 + *

示例值: + */ + private Member uploader; + /** + * 是否是封面图 + *

示例值:false + */ + private Boolean isCover; + /** + * 上传时间戳(ms) + *

示例值:1675742789470 + */ + private String uploadedAt; + /** + * 附件的临时下载url,有效时间3分钟,且只允许调用3次进行附件下载。只有在获取附件时会动态生成。 + *

示例值:https://example.com/download/authcode/?code=OWMzNDlmMjJmZThkYzZkZGJlMjYwZTI0OTUxZTE2MDJfMDZmZmMwOWVj + */ + private String url; + + /** + * 附件guid + *

示例值:f860de3e-6881-4ddd-9321-070f36d1af0b + * + * @param guid + * @return + */ + public Builder guid(String guid) { + this.guid = guid; + return this; + } + + + /** + * 附件在云文档系统中的token + *

示例值:boxcnTDqPaRA6JbYnzQsZ2doB2b + * + * @param fileToken + * @return + */ + public Builder fileToken(String fileToken) { + this.fileToken = fileToken; + return this; + } + + + /** + * 附件名 + *

示例值:foo.jpg + * + * @param name + * @return + */ + public Builder name(String name) { + this.name = name; + return this; + } + + + /** + * 附件的字节大小 + *

示例值:62232 + * + * @param size + * @return + */ + public Builder size(Integer size) { + this.size = size; + return this; + } + + + /** + * 附件归属的资源 + *

示例值: + * + * @param resource + * @return + */ + public Builder resource(Resource resource) { + this.resource = resource; + return this; + } + + + /** + * 附件上传者 + *

示例值: + * + * @param uploader + * @return + */ + public Builder uploader(Member uploader) { + this.uploader = uploader; + return this; + } + + + /** + * 是否是封面图 + *

示例值:false + * + * @param isCover + * @return + */ + public Builder isCover(Boolean isCover) { + this.isCover = isCover; + return this; + } + + + /** + * 上传时间戳(ms) + *

示例值:1675742789470 + * + * @param uploadedAt + * @return + */ + public Builder uploadedAt(String uploadedAt) { + this.uploadedAt = uploadedAt; + return this; + } + + + /** + * 附件的临时下载url,有效时间3分钟,且只允许调用3次进行附件下载。只有在获取附件时会动态生成。 + *

示例值:https://example.com/download/authcode/?code=OWMzNDlmMjJmZThkYzZkZGJlMjYwZTI0OTUxZTE2MDJfMDZmZmMwOWVj + * + * @param url + * @return + */ + public Builder url(String url) { + this.url = url; + return this; + } + + + public Attachment build() { + return new Attachment(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Comment.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Comment.java new file mode 100644 index 000000000..f27f00847 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Comment.java @@ -0,0 +1,333 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Comment { + /** + * 评论id + *

示例值:7197020628442939411 + */ + @SerializedName("id") + private String id; + /** + * 评论内容 + *

示例值:这是一条评论 + */ + @SerializedName("content") + private String content; + /** + * 评论创建人 + *

示例值: + */ + @SerializedName("creator") + private Member creator; + /** + * 被回复评论的id。如果不是回复评论,则为空。 + *

示例值:7166825117308174356 + */ + @SerializedName("reply_to_comment_id") + private String replyToCommentId; + /** + * 评论创建时间戳(ms) + *

示例值:1675742789470 + */ + @SerializedName("created_at") + private String createdAt; + /** + * 评论更新时间戳(ms) + *

示例值:1675742789470 + */ + @SerializedName("updated_at") + private String updatedAt; + /** + * 任务关联的资源类型 + *

示例值:task + */ + @SerializedName("resource_type") + private String resourceType; + /** + * 任务关联的资源ID + *

示例值:ccb55625-95d2-2e80-655f-0e40bf67953f + */ + @SerializedName("resource_id") + private String resourceId; + + // builder 开始 + public Comment() { + } + + public Comment(Builder builder) { + /** + * 评论id + *

示例值:7197020628442939411 + */ + this.id = builder.id; + /** + * 评论内容 + *

示例值:这是一条评论 + */ + this.content = builder.content; + /** + * 评论创建人 + *

示例值: + */ + this.creator = builder.creator; + /** + * 被回复评论的id。如果不是回复评论,则为空。 + *

示例值:7166825117308174356 + */ + this.replyToCommentId = builder.replyToCommentId; + /** + * 评论创建时间戳(ms) + *

示例值:1675742789470 + */ + this.createdAt = builder.createdAt; + /** + * 评论更新时间戳(ms) + *

示例值:1675742789470 + */ + this.updatedAt = builder.updatedAt; + /** + * 任务关联的资源类型 + *

示例值:task + */ + this.resourceType = builder.resourceType; + /** + * 任务关联的资源ID + *

示例值:ccb55625-95d2-2e80-655f-0e40bf67953f + */ + this.resourceId = builder.resourceId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public Member getCreator() { + return this.creator; + } + + public void setCreator(Member creator) { + this.creator = creator; + } + + public String getReplyToCommentId() { + return this.replyToCommentId; + } + + public void setReplyToCommentId(String replyToCommentId) { + this.replyToCommentId = replyToCommentId; + } + + public String getCreatedAt() { + return this.createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public String getUpdatedAt() { + return this.updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + public String getResourceType() { + return this.resourceType; + } + + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + public String getResourceId() { + return this.resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public static class Builder { + /** + * 评论id + *

示例值:7197020628442939411 + */ + private String id; + /** + * 评论内容 + *

示例值:这是一条评论 + */ + private String content; + /** + * 评论创建人 + *

示例值: + */ + private Member creator; + /** + * 被回复评论的id。如果不是回复评论,则为空。 + *

示例值:7166825117308174356 + */ + private String replyToCommentId; + /** + * 评论创建时间戳(ms) + *

示例值:1675742789470 + */ + private String createdAt; + /** + * 评论更新时间戳(ms) + *

示例值:1675742789470 + */ + private String updatedAt; + /** + * 任务关联的资源类型 + *

示例值:task + */ + private String resourceType; + /** + * 任务关联的资源ID + *

示例值:ccb55625-95d2-2e80-655f-0e40bf67953f + */ + private String resourceId; + + /** + * 评论id + *

示例值:7197020628442939411 + * + * @param id + * @return + */ + public Builder id(String id) { + this.id = id; + return this; + } + + + /** + * 评论内容 + *

示例值:这是一条评论 + * + * @param content + * @return + */ + public Builder content(String content) { + this.content = content; + return this; + } + + + /** + * 评论创建人 + *

示例值: + * + * @param creator + * @return + */ + public Builder creator(Member creator) { + this.creator = creator; + return this; + } + + + /** + * 被回复评论的id。如果不是回复评论,则为空。 + *

示例值:7166825117308174356 + * + * @param replyToCommentId + * @return + */ + public Builder replyToCommentId(String replyToCommentId) { + this.replyToCommentId = replyToCommentId; + return this; + } + + + /** + * 评论创建时间戳(ms) + *

示例值:1675742789470 + * + * @param createdAt + * @return + */ + public Builder createdAt(String createdAt) { + this.createdAt = createdAt; + return this; + } + + + /** + * 评论更新时间戳(ms) + *

示例值:1675742789470 + * + * @param updatedAt + * @return + */ + public Builder updatedAt(String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + + /** + * 任务关联的资源类型 + *

示例值:task + * + * @param resourceType + * @return + */ + public Builder resourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + + /** + * 任务关联的资源ID + *

示例值:ccb55625-95d2-2e80-655f-0e40bf67953f + * + * @param resourceId + * @return + */ + public Builder resourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + + public Comment build() { + return new Comment(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCommentReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCommentReq.java new file mode 100644 index 000000000..eaf150944 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCommentReq.java @@ -0,0 +1,99 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Query; + +public class CreateCommentReq { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + @Body + private InputComment body; + + // builder 开始 + public CreateCommentReq() { + } + + public CreateCommentReq(Builder builder) { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public InputComment getInputComment() { + return this.body; + } + + public void setInputComment(InputComment body) { + this.body = body; + } + + public static class Builder { + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private InputComment body; + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + public InputComment getInputComment() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder inputComment(InputComment body) { + this.body = body; + return this; + } + + public CreateCommentReq build() { + return new CreateCommentReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCommentResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCommentResp.java new file mode 100644 index 000000000..bb2889806 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCommentResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class CreateCommentResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCommentRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCommentRespBody.java new file mode 100644 index 000000000..5d3ef18f3 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCommentRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class CreateCommentRespBody { + /** + * 创建的评论详情 + *

示例值: + */ + @SerializedName("comment") + private Comment comment; + + public Comment getComment() { + return this.comment; + } + + public void setComment(Comment comment) { + this.comment = comment; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCustomFieldOptionReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCustomFieldOptionReq.java new file mode 100644 index 000000000..960d04311 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCustomFieldOptionReq.java @@ -0,0 +1,100 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Path; + +public class CreateCustomFieldOptionReq { + /** + * 要添加选项的自定义字段GUID,该字段必须是 + *

示例值:b13adf3c-cad6-4e02-8929-550c112b5633 + */ + @Path + @SerializedName("custom_field_guid") + private String customFieldGuid; + @Body + private InputOption body; + + // builder 开始 + public CreateCustomFieldOptionReq() { + } + + public CreateCustomFieldOptionReq(Builder builder) { + /** + * 要添加选项的自定义字段GUID,该字段必须是 + *

示例值:b13adf3c-cad6-4e02-8929-550c112b5633 + */ + this.customFieldGuid = builder.customFieldGuid; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getCustomFieldGuid() { + return this.customFieldGuid; + } + + public void setCustomFieldGuid(String customFieldGuid) { + this.customFieldGuid = customFieldGuid; + } + + public InputOption getInputOption() { + return this.body; + } + + public void setInputOption(InputOption body) { + this.body = body; + } + + public static class Builder { + + private String customFieldGuid; // 要添加选项的自定义字段GUID,该字段必须是 + private InputOption body; + + /** + * 要添加选项的自定义字段GUID,该字段必须是 + *

示例值:b13adf3c-cad6-4e02-8929-550c112b5633 + * + * @param customFieldGuid + * @return + */ + public Builder customFieldGuid(String customFieldGuid) { + this.customFieldGuid = customFieldGuid; + return this; + } + + public InputOption getInputOption() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder inputOption(InputOption body) { + this.body = body; + return this; + } + + public CreateCustomFieldOptionReq build() { + return new CreateCustomFieldOptionReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCustomFieldOptionResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCustomFieldOptionResp.java new file mode 100644 index 000000000..477919e22 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCustomFieldOptionResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class CreateCustomFieldOptionResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCustomFieldOptionRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCustomFieldOptionRespBody.java new file mode 100644 index 000000000..f92b66c95 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCustomFieldOptionRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class CreateCustomFieldOptionRespBody { + /** + * 创建的选项 + *

示例值: + */ + @SerializedName("option") + private Option option; + + public Option getOption() { + return this.option; + } + + public void setOption(Option option) { + this.option = option; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCustomFieldReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCustomFieldReq.java new file mode 100644 index 000000000..30348fdd4 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCustomFieldReq.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Query; + +public class CreateCustomFieldReq { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + @Body + private InputCustomField body; + + // builder 开始 + public CreateCustomFieldReq() { + } + + public CreateCustomFieldReq(Builder builder) { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public InputCustomField getInputCustomField() { + return this.body; + } + + public void setInputCustomField(InputCustomField body) { + this.body = body; + } + + public static class Builder { + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private InputCustomField body; + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType {@link com.lark.oapi.service.task.v2.enums.CreateCustomFieldUserIdTypeEnum} + * @return + */ + public Builder userIdType(com.lark.oapi.service.task.v2.enums.CreateCustomFieldUserIdTypeEnum userIdType) { + this.userIdType = userIdType.getValue(); + return this; + } + + public InputCustomField getInputCustomField() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder inputCustomField(InputCustomField body) { + this.body = body; + return this; + } + + public CreateCustomFieldReq build() { + return new CreateCustomFieldReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCustomFieldResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCustomFieldResp.java new file mode 100644 index 000000000..84ae3e94c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCustomFieldResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class CreateCustomFieldResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCustomFieldRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCustomFieldRespBody.java new file mode 100644 index 000000000..97716a502 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateCustomFieldRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class CreateCustomFieldRespBody { + /** + * 创建的自定义字段 + *

示例值: + */ + @SerializedName("custom_field") + private CustomField customField; + + public CustomField getCustomField() { + return this.customField; + } + + public void setCustomField(CustomField customField) { + this.customField = customField; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateSectionReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateSectionReq.java new file mode 100644 index 000000000..b700ba268 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateSectionReq.java @@ -0,0 +1,99 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Query; + +public class CreateSectionReq { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + @Body + private InputSection body; + + // builder 开始 + public CreateSectionReq() { + } + + public CreateSectionReq(Builder builder) { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public InputSection getInputSection() { + return this.body; + } + + public void setInputSection(InputSection body) { + this.body = body; + } + + public static class Builder { + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private InputSection body; + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + public InputSection getInputSection() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder inputSection(InputSection body) { + this.body = body; + return this; + } + + public CreateSectionReq build() { + return new CreateSectionReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateSectionResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateSectionResp.java new file mode 100644 index 000000000..08f0ff409 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateSectionResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class CreateSectionResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateSectionRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateSectionRespBody.java new file mode 100644 index 000000000..e759f97c2 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateSectionRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class CreateSectionRespBody { + /** + * 创建的自定义分组数据 + *

示例值: + */ + @SerializedName("section") + private Section section; + + public Section getSection() { + return this.section; + } + + public void setSection(Section section) { + this.section = section; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTaskReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTaskReq.java new file mode 100644 index 000000000..37ffb16f5 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTaskReq.java @@ -0,0 +1,99 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Query; + +public class CreateTaskReq { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + @Body + private InputTask body; + + // builder 开始 + public CreateTaskReq() { + } + + public CreateTaskReq(Builder builder) { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public InputTask getInputTask() { + return this.body; + } + + public void setInputTask(InputTask body) { + this.body = body; + } + + public static class Builder { + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private InputTask body; + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + public InputTask getInputTask() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder inputTask(InputTask body) { + this.body = body; + return this; + } + + public CreateTaskReq build() { + return new CreateTaskReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTaskResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTaskResp.java new file mode 100644 index 000000000..e9b032c9c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTaskResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class CreateTaskResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTaskRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTaskRespBody.java new file mode 100644 index 000000000..03f6e12c8 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTaskRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class CreateTaskRespBody { + /** + * 产生的任务 + *

示例值: + */ + @SerializedName("task") + private Task task; + + public Task getTask() { + return this.task; + } + + public void setTask(Task task) { + this.task = task; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTaskSubtaskReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTaskSubtaskReq.java new file mode 100644 index 000000000..1a679f6d8 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTaskSubtaskReq.java @@ -0,0 +1,133 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class CreateTaskSubtaskReq { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 父任务GUID + *

示例值:e297ddff-06ca-4166-b917-4ce57cd3a7a0 + */ + @Path + @SerializedName("task_guid") + private String taskGuid; + @Body + private InputTask body; + + // builder 开始 + public CreateTaskSubtaskReq() { + } + + public CreateTaskSubtaskReq(Builder builder) { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 父任务GUID + *

示例值:e297ddff-06ca-4166-b917-4ce57cd3a7a0 + */ + this.taskGuid = builder.taskGuid; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getTaskGuid() { + return this.taskGuid; + } + + public void setTaskGuid(String taskGuid) { + this.taskGuid = taskGuid; + } + + public InputTask getInputTask() { + return this.body; + } + + public void setInputTask(InputTask body) { + this.body = body; + } + + public static class Builder { + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private String taskGuid; // 父任务GUID + private InputTask body; + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 父任务GUID + *

示例值:e297ddff-06ca-4166-b917-4ce57cd3a7a0 + * + * @param taskGuid + * @return + */ + public Builder taskGuid(String taskGuid) { + this.taskGuid = taskGuid; + return this; + } + + public InputTask getInputTask() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder inputTask(InputTask body) { + this.body = body; + return this; + } + + public CreateTaskSubtaskReq build() { + return new CreateTaskSubtaskReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTaskSubtaskResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTaskSubtaskResp.java new file mode 100644 index 000000000..f62d1cfd4 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTaskSubtaskResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class CreateTaskSubtaskResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTaskSubtaskRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTaskSubtaskRespBody.java new file mode 100644 index 000000000..703022d16 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTaskSubtaskRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class CreateTaskSubtaskRespBody { + /** + * 创建的任务 + *

示例值: + */ + @SerializedName("subtask") + private Task subtask; + + public Task getSubtask() { + return this.subtask; + } + + public void setSubtask(Task subtask) { + this.subtask = subtask; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTasklistActivitySubscriptionReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTasklistActivitySubscriptionReq.java new file mode 100644 index 000000000..6584ace5d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTasklistActivitySubscriptionReq.java @@ -0,0 +1,145 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class CreateTasklistActivitySubscriptionReq { + /** + * 用户ID类型 + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 清单GUID + *

示例值:d19e3a2a-edc0-4e4e-b7cc-950e162b53ae + */ + @Path + @SerializedName("tasklist_guid") + private String tasklistGuid; + @Body + private TasklistActivitySubscription body; + + // builder 开始 + public CreateTasklistActivitySubscriptionReq() { + } + + public CreateTasklistActivitySubscriptionReq(Builder builder) { + /** + * 用户ID类型 + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 清单GUID + *

示例值:d19e3a2a-edc0-4e4e-b7cc-950e162b53ae + */ + this.tasklistGuid = builder.tasklistGuid; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getTasklistGuid() { + return this.tasklistGuid; + } + + public void setTasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + } + + public TasklistActivitySubscription getTasklistActivitySubscription() { + return this.body; + } + + public void setTasklistActivitySubscription(TasklistActivitySubscription body) { + this.body = body; + } + + public static class Builder { + private String userIdType; // 用户ID类型 + private String tasklistGuid; // 清单GUID + private TasklistActivitySubscription body; + + /** + * 用户ID类型 + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 用户ID类型 + *

示例值:open_id + * + * @param userIdType {@link com.lark.oapi.service.task.v2.enums.CreateTasklistActivitySubscriptionUserIdTypeEnum} + * @return + */ + public Builder userIdType(com.lark.oapi.service.task.v2.enums.CreateTasklistActivitySubscriptionUserIdTypeEnum userIdType) { + this.userIdType = userIdType.getValue(); + return this; + } + + /** + * 清单GUID + *

示例值:d19e3a2a-edc0-4e4e-b7cc-950e162b53ae + * + * @param tasklistGuid + * @return + */ + public Builder tasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + return this; + } + + public TasklistActivitySubscription getTasklistActivitySubscription() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder tasklistActivitySubscription(TasklistActivitySubscription body) { + this.body = body; + return this; + } + + public CreateTasklistActivitySubscriptionReq build() { + return new CreateTasklistActivitySubscriptionReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTasklistActivitySubscriptionResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTasklistActivitySubscriptionResp.java new file mode 100644 index 000000000..e876ea1cc --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTasklistActivitySubscriptionResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class CreateTasklistActivitySubscriptionResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTasklistActivitySubscriptionRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTasklistActivitySubscriptionRespBody.java new file mode 100644 index 000000000..1f5c46fb3 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTasklistActivitySubscriptionRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class CreateTasklistActivitySubscriptionRespBody { + /** + * 清单动态订阅 + *

示例值: + */ + @SerializedName("activity_subscription") + private TasklistActivitySubscription activitySubscription; + + public TasklistActivitySubscription getActivitySubscription() { + return this.activitySubscription; + } + + public void setActivitySubscription(TasklistActivitySubscription activitySubscription) { + this.activitySubscription = activitySubscription; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTasklistReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTasklistReq.java new file mode 100644 index 000000000..de9b0b302 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTasklistReq.java @@ -0,0 +1,99 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Query; + +public class CreateTasklistReq { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + @Body + private InputTasklist body; + + // builder 开始 + public CreateTasklistReq() { + } + + public CreateTasklistReq(Builder builder) { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public InputTasklist getInputTasklist() { + return this.body; + } + + public void setInputTasklist(InputTasklist body) { + this.body = body; + } + + public static class Builder { + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private InputTasklist body; + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + public InputTasklist getInputTasklist() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder inputTasklist(InputTasklist body) { + this.body = body; + return this; + } + + public CreateTasklistReq build() { + return new CreateTasklistReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTasklistResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTasklistResp.java new file mode 100644 index 000000000..5be250e5d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTasklistResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class CreateTasklistResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTasklistRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTasklistRespBody.java new file mode 100644 index 000000000..c0647e083 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CreateTasklistRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class CreateTasklistRespBody { + /** + * 创建的清单数据 + *

示例值: + */ + @SerializedName("tasklist") + private Tasklist tasklist; + + public Tasklist getTasklist() { + return this.tasklist; + } + + public void setTasklist(Tasklist tasklist) { + this.tasklist = tasklist; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CustomComplete.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CustomComplete.java new file mode 100644 index 000000000..cf34c11b1 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CustomComplete.java @@ -0,0 +1,148 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class CustomComplete { + /** + * pc客户端自定义完成配置(含mac和windows) + *

示例值: + */ + @SerializedName("pc") + private CustomCompleteItem pc; + /** + * ios端的自定义完成配置 + *

示例值: + */ + @SerializedName("ios") + private CustomCompleteItem ios; + /** + * android端的自定义完成配置 + *

示例值: + */ + @SerializedName("android") + private CustomCompleteItem android; + + // builder 开始 + public CustomComplete() { + } + + public CustomComplete(Builder builder) { + /** + * pc客户端自定义完成配置(含mac和windows) + *

示例值: + */ + this.pc = builder.pc; + /** + * ios端的自定义完成配置 + *

示例值: + */ + this.ios = builder.ios; + /** + * android端的自定义完成配置 + *

示例值: + */ + this.android = builder.android; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public CustomCompleteItem getPc() { + return this.pc; + } + + public void setPc(CustomCompleteItem pc) { + this.pc = pc; + } + + public CustomCompleteItem getIos() { + return this.ios; + } + + public void setIos(CustomCompleteItem ios) { + this.ios = ios; + } + + public CustomCompleteItem getAndroid() { + return this.android; + } + + public void setAndroid(CustomCompleteItem android) { + this.android = android; + } + + public static class Builder { + /** + * pc客户端自定义完成配置(含mac和windows) + *

示例值: + */ + private CustomCompleteItem pc; + /** + * ios端的自定义完成配置 + *

示例值: + */ + private CustomCompleteItem ios; + /** + * android端的自定义完成配置 + *

示例值: + */ + private CustomCompleteItem android; + + /** + * pc客户端自定义完成配置(含mac和windows) + *

示例值: + * + * @param pc + * @return + */ + public Builder pc(CustomCompleteItem pc) { + this.pc = pc; + return this; + } + + + /** + * ios端的自定义完成配置 + *

示例值: + * + * @param ios + * @return + */ + public Builder ios(CustomCompleteItem ios) { + this.ios = ios; + return this; + } + + + /** + * android端的自定义完成配置 + *

示例值: + * + * @param android + * @return + */ + public Builder android(CustomCompleteItem android) { + this.android = android; + return this; + } + + + public CustomComplete build() { + return new CustomComplete(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CustomCompleteItem.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CustomCompleteItem.java new file mode 100644 index 000000000..a6f6cf249 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CustomCompleteItem.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class CustomCompleteItem { + /** + * 自定义完成的跳转url + *

示例值:https://www.example.com + */ + @SerializedName("href") + private String href; + /** + * 自定义完成的弹出提示为 + *

示例值: + */ + @SerializedName("tip") + private I18nText tip; + + // builder 开始 + public CustomCompleteItem() { + } + + public CustomCompleteItem(Builder builder) { + /** + * 自定义完成的跳转url + *

示例值:https://www.example.com + */ + this.href = builder.href; + /** + * 自定义完成的弹出提示为 + *

示例值: + */ + this.tip = builder.tip; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getHref() { + return this.href; + } + + public void setHref(String href) { + this.href = href; + } + + public I18nText getTip() { + return this.tip; + } + + public void setTip(I18nText tip) { + this.tip = tip; + } + + public static class Builder { + /** + * 自定义完成的跳转url + *

示例值:https://www.example.com + */ + private String href; + /** + * 自定义完成的弹出提示为 + *

示例值: + */ + private I18nText tip; + + /** + * 自定义完成的跳转url + *

示例值:https://www.example.com + * + * @param href + * @return + */ + public Builder href(String href) { + this.href = href; + return this; + } + + + /** + * 自定义完成的弹出提示为 + *

示例值: + * + * @param tip + * @return + */ + public Builder tip(I18nText tip) { + this.tip = tip; + return this; + } + + + public CustomCompleteItem build() { + return new CustomCompleteItem(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CustomField.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CustomField.java new file mode 100644 index 000000000..dae6f35a0 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CustomField.java @@ -0,0 +1,481 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class CustomField { + /** + * 自定义字段的GUID + *

示例值:34d4b29f-3d58-4bc5-b752-6be80fb687c8 + */ + @SerializedName("guid") + private String guid; + /** + * 自定义字段名称 + *

示例值:优先级 + */ + @SerializedName("name") + private String name; + /** + * 自定义字段类型 + *

示例值:number + */ + @SerializedName("type") + private String type; + /** + * 数字类型的字段设置 + *

示例值: + */ + @SerializedName("number_setting") + private NumberSetting numberSetting; + /** + * 人员类型的字段设置 + *

示例值: + */ + @SerializedName("member_setting") + private MemberSetting memberSetting; + /** + * 时间日期类型的字段设置 + *

示例值: + */ + @SerializedName("datetime_setting") + private DatetimeSetting datetimeSetting; + /** + * 单选类型的字段设置 + *

示例值: + */ + @SerializedName("single_select_setting") + private SelectSetting singleSelectSetting; + /** + * 多选类型的字段设置 + *

示例值: + */ + @SerializedName("multi_select_setting") + private SelectSetting multiSelectSetting; + /** + * 创建人 + *

示例值: + */ + @SerializedName("creator") + private Member creator; + /** + * 自定义字段创建的时间戳(ms) + *

示例值:1688196600000 + */ + @SerializedName("created_at") + private String createdAt; + /** + * 自定义字段的更新时间戳(ms) + *

示例值:1688196600000 + */ + @SerializedName("updated_at") + private String updatedAt; + /** + * 文本字段配置 + *

示例值: + */ + @SerializedName("text_setting") + private TextSetting textSetting; + + // builder 开始 + public CustomField() { + } + + public CustomField(Builder builder) { + /** + * 自定义字段的GUID + *

示例值:34d4b29f-3d58-4bc5-b752-6be80fb687c8 + */ + this.guid = builder.guid; + /** + * 自定义字段名称 + *

示例值:优先级 + */ + this.name = builder.name; + /** + * 自定义字段类型 + *

示例值:number + */ + this.type = builder.type; + /** + * 数字类型的字段设置 + *

示例值: + */ + this.numberSetting = builder.numberSetting; + /** + * 人员类型的字段设置 + *

示例值: + */ + this.memberSetting = builder.memberSetting; + /** + * 时间日期类型的字段设置 + *

示例值: + */ + this.datetimeSetting = builder.datetimeSetting; + /** + * 单选类型的字段设置 + *

示例值: + */ + this.singleSelectSetting = builder.singleSelectSetting; + /** + * 多选类型的字段设置 + *

示例值: + */ + this.multiSelectSetting = builder.multiSelectSetting; + /** + * 创建人 + *

示例值: + */ + this.creator = builder.creator; + /** + * 自定义字段创建的时间戳(ms) + *

示例值:1688196600000 + */ + this.createdAt = builder.createdAt; + /** + * 自定义字段的更新时间戳(ms) + *

示例值:1688196600000 + */ + this.updatedAt = builder.updatedAt; + /** + * 文本字段配置 + *

示例值: + */ + this.textSetting = builder.textSetting; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getGuid() { + return this.guid; + } + + public void setGuid(String guid) { + this.guid = guid; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public NumberSetting getNumberSetting() { + return this.numberSetting; + } + + public void setNumberSetting(NumberSetting numberSetting) { + this.numberSetting = numberSetting; + } + + public MemberSetting getMemberSetting() { + return this.memberSetting; + } + + public void setMemberSetting(MemberSetting memberSetting) { + this.memberSetting = memberSetting; + } + + public DatetimeSetting getDatetimeSetting() { + return this.datetimeSetting; + } + + public void setDatetimeSetting(DatetimeSetting datetimeSetting) { + this.datetimeSetting = datetimeSetting; + } + + public SelectSetting getSingleSelectSetting() { + return this.singleSelectSetting; + } + + public void setSingleSelectSetting(SelectSetting singleSelectSetting) { + this.singleSelectSetting = singleSelectSetting; + } + + public SelectSetting getMultiSelectSetting() { + return this.multiSelectSetting; + } + + public void setMultiSelectSetting(SelectSetting multiSelectSetting) { + this.multiSelectSetting = multiSelectSetting; + } + + public Member getCreator() { + return this.creator; + } + + public void setCreator(Member creator) { + this.creator = creator; + } + + public String getCreatedAt() { + return this.createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public String getUpdatedAt() { + return this.updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + public TextSetting getTextSetting() { + return this.textSetting; + } + + public void setTextSetting(TextSetting textSetting) { + this.textSetting = textSetting; + } + + public static class Builder { + /** + * 自定义字段的GUID + *

示例值:34d4b29f-3d58-4bc5-b752-6be80fb687c8 + */ + private String guid; + /** + * 自定义字段名称 + *

示例值:优先级 + */ + private String name; + /** + * 自定义字段类型 + *

示例值:number + */ + private String type; + /** + * 数字类型的字段设置 + *

示例值: + */ + private NumberSetting numberSetting; + /** + * 人员类型的字段设置 + *

示例值: + */ + private MemberSetting memberSetting; + /** + * 时间日期类型的字段设置 + *

示例值: + */ + private DatetimeSetting datetimeSetting; + /** + * 单选类型的字段设置 + *

示例值: + */ + private SelectSetting singleSelectSetting; + /** + * 多选类型的字段设置 + *

示例值: + */ + private SelectSetting multiSelectSetting; + /** + * 创建人 + *

示例值: + */ + private Member creator; + /** + * 自定义字段创建的时间戳(ms) + *

示例值:1688196600000 + */ + private String createdAt; + /** + * 自定义字段的更新时间戳(ms) + *

示例值:1688196600000 + */ + private String updatedAt; + /** + * 文本字段配置 + *

示例值: + */ + private TextSetting textSetting; + + /** + * 自定义字段的GUID + *

示例值:34d4b29f-3d58-4bc5-b752-6be80fb687c8 + * + * @param guid + * @return + */ + public Builder guid(String guid) { + this.guid = guid; + return this; + } + + + /** + * 自定义字段名称 + *

示例值:优先级 + * + * @param name + * @return + */ + public Builder name(String name) { + this.name = name; + return this; + } + + + /** + * 自定义字段类型 + *

示例值:number + * + * @param type + * @return + */ + public Builder type(String type) { + this.type = type; + return this; + } + + + /** + * 数字类型的字段设置 + *

示例值: + * + * @param numberSetting + * @return + */ + public Builder numberSetting(NumberSetting numberSetting) { + this.numberSetting = numberSetting; + return this; + } + + + /** + * 人员类型的字段设置 + *

示例值: + * + * @param memberSetting + * @return + */ + public Builder memberSetting(MemberSetting memberSetting) { + this.memberSetting = memberSetting; + return this; + } + + + /** + * 时间日期类型的字段设置 + *

示例值: + * + * @param datetimeSetting + * @return + */ + public Builder datetimeSetting(DatetimeSetting datetimeSetting) { + this.datetimeSetting = datetimeSetting; + return this; + } + + + /** + * 单选类型的字段设置 + *

示例值: + * + * @param singleSelectSetting + * @return + */ + public Builder singleSelectSetting(SelectSetting singleSelectSetting) { + this.singleSelectSetting = singleSelectSetting; + return this; + } + + + /** + * 多选类型的字段设置 + *

示例值: + * + * @param multiSelectSetting + * @return + */ + public Builder multiSelectSetting(SelectSetting multiSelectSetting) { + this.multiSelectSetting = multiSelectSetting; + return this; + } + + + /** + * 创建人 + *

示例值: + * + * @param creator + * @return + */ + public Builder creator(Member creator) { + this.creator = creator; + return this; + } + + + /** + * 自定义字段创建的时间戳(ms) + *

示例值:1688196600000 + * + * @param createdAt + * @return + */ + public Builder createdAt(String createdAt) { + this.createdAt = createdAt; + return this; + } + + + /** + * 自定义字段的更新时间戳(ms) + *

示例值:1688196600000 + * + * @param updatedAt + * @return + */ + public Builder updatedAt(String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + + /** + * 文本字段配置 + *

示例值: + * + * @param textSetting + * @return + */ + public Builder textSetting(TextSetting textSetting) { + this.textSetting = textSetting; + return this; + } + + + public CustomField build() { + return new CustomField(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CustomFieldValue.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CustomFieldValue.java new file mode 100644 index 000000000..5b470ed2d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/CustomFieldValue.java @@ -0,0 +1,370 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class CustomFieldValue { + /** + * 字段GUID + *

示例值:a4f648d7-76ef-477f-bc8e-0601b5a60093 + */ + @SerializedName("guid") + private String guid; + /** + * 自定义字段类型,支持"member", "datetime", "number", "single_select", "multi_select"五种类型 + *

示例值:number + */ + @SerializedName("type") + private String type; + /** + * 数字类型的自定义字段值,填写一个合法数字的字符串表示,空字符串表示设为空。 + *

示例值:10.23 + */ + @SerializedName("number_value") + private String numberValue; + /** + * 日期类型自定义字段值。可以输入一个表示日期的以毫秒为单位的字符串。设为空字符串表示设为空。 + *

示例值:1687708260000 + */ + @SerializedName("datetime_value") + private String datetimeValue; + /** + * 人员类型的自定义字段值,可以设置1个或多个用户的id(遵循member格式,只支持user类型)。当该字段的设置为“不能多选”时只能输入一个值。设为空数组表示设为空。 + *

示例值: + */ + @SerializedName("member_value") + private Member[] memberValue; + /** + * 单选类型字段值,填写一个字段选项的option_guid。设置为空字符串表示设为空。 + *

示例值:4216f79b-3fda-4dc6-a0c4-a16022e47152 + */ + @SerializedName("single_select_value") + private String singleSelectValue; + /** + * 多选类型字段值,可以填写一个或多个本字段的option_guid。设为空数组表示设为空。 + *

示例值: + */ + @SerializedName("multi_select_value") + private String[] multiSelectValue; + /** + * 自定义字段名 + *

示例值:优先级 + */ + @SerializedName("name") + private String name; + /** + * 文本类型字段值。可以输入一段文本。空字符串表示清空。 + *

示例值:这是一段文本介绍。 + */ + @SerializedName("text_value") + private String textValue; + + // builder 开始 + public CustomFieldValue() { + } + + public CustomFieldValue(Builder builder) { + /** + * 字段GUID + *

示例值:a4f648d7-76ef-477f-bc8e-0601b5a60093 + */ + this.guid = builder.guid; + /** + * 自定义字段类型,支持"member", "datetime", "number", "single_select", "multi_select"五种类型 + *

示例值:number + */ + this.type = builder.type; + /** + * 数字类型的自定义字段值,填写一个合法数字的字符串表示,空字符串表示设为空。 + *

示例值:10.23 + */ + this.numberValue = builder.numberValue; + /** + * 日期类型自定义字段值。可以输入一个表示日期的以毫秒为单位的字符串。设为空字符串表示设为空。 + *

示例值:1687708260000 + */ + this.datetimeValue = builder.datetimeValue; + /** + * 人员类型的自定义字段值,可以设置1个或多个用户的id(遵循member格式,只支持user类型)。当该字段的设置为“不能多选”时只能输入一个值。设为空数组表示设为空。 + *

示例值: + */ + this.memberValue = builder.memberValue; + /** + * 单选类型字段值,填写一个字段选项的option_guid。设置为空字符串表示设为空。 + *

示例值:4216f79b-3fda-4dc6-a0c4-a16022e47152 + */ + this.singleSelectValue = builder.singleSelectValue; + /** + * 多选类型字段值,可以填写一个或多个本字段的option_guid。设为空数组表示设为空。 + *

示例值: + */ + this.multiSelectValue = builder.multiSelectValue; + /** + * 自定义字段名 + *

示例值:优先级 + */ + this.name = builder.name; + /** + * 文本类型字段值。可以输入一段文本。空字符串表示清空。 + *

示例值:这是一段文本介绍。 + */ + this.textValue = builder.textValue; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getGuid() { + return this.guid; + } + + public void setGuid(String guid) { + this.guid = guid; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getNumberValue() { + return this.numberValue; + } + + public void setNumberValue(String numberValue) { + this.numberValue = numberValue; + } + + public String getDatetimeValue() { + return this.datetimeValue; + } + + public void setDatetimeValue(String datetimeValue) { + this.datetimeValue = datetimeValue; + } + + public Member[] getMemberValue() { + return this.memberValue; + } + + public void setMemberValue(Member[] memberValue) { + this.memberValue = memberValue; + } + + public String getSingleSelectValue() { + return this.singleSelectValue; + } + + public void setSingleSelectValue(String singleSelectValue) { + this.singleSelectValue = singleSelectValue; + } + + public String[] getMultiSelectValue() { + return this.multiSelectValue; + } + + public void setMultiSelectValue(String[] multiSelectValue) { + this.multiSelectValue = multiSelectValue; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getTextValue() { + return this.textValue; + } + + public void setTextValue(String textValue) { + this.textValue = textValue; + } + + public static class Builder { + /** + * 字段GUID + *

示例值:a4f648d7-76ef-477f-bc8e-0601b5a60093 + */ + private String guid; + /** + * 自定义字段类型,支持"member", "datetime", "number", "single_select", "multi_select"五种类型 + *

示例值:number + */ + private String type; + /** + * 数字类型的自定义字段值,填写一个合法数字的字符串表示,空字符串表示设为空。 + *

示例值:10.23 + */ + private String numberValue; + /** + * 日期类型自定义字段值。可以输入一个表示日期的以毫秒为单位的字符串。设为空字符串表示设为空。 + *

示例值:1687708260000 + */ + private String datetimeValue; + /** + * 人员类型的自定义字段值,可以设置1个或多个用户的id(遵循member格式,只支持user类型)。当该字段的设置为“不能多选”时只能输入一个值。设为空数组表示设为空。 + *

示例值: + */ + private Member[] memberValue; + /** + * 单选类型字段值,填写一个字段选项的option_guid。设置为空字符串表示设为空。 + *

示例值:4216f79b-3fda-4dc6-a0c4-a16022e47152 + */ + private String singleSelectValue; + /** + * 多选类型字段值,可以填写一个或多个本字段的option_guid。设为空数组表示设为空。 + *

示例值: + */ + private String[] multiSelectValue; + /** + * 自定义字段名 + *

示例值:优先级 + */ + private String name; + /** + * 文本类型字段值。可以输入一段文本。空字符串表示清空。 + *

示例值:这是一段文本介绍。 + */ + private String textValue; + + /** + * 字段GUID + *

示例值:a4f648d7-76ef-477f-bc8e-0601b5a60093 + * + * @param guid + * @return + */ + public Builder guid(String guid) { + this.guid = guid; + return this; + } + + + /** + * 自定义字段类型,支持"member", "datetime", "number", "single_select", "multi_select"五种类型 + *

示例值:number + * + * @param type + * @return + */ + public Builder type(String type) { + this.type = type; + return this; + } + + + /** + * 数字类型的自定义字段值,填写一个合法数字的字符串表示,空字符串表示设为空。 + *

示例值:10.23 + * + * @param numberValue + * @return + */ + public Builder numberValue(String numberValue) { + this.numberValue = numberValue; + return this; + } + + + /** + * 日期类型自定义字段值。可以输入一个表示日期的以毫秒为单位的字符串。设为空字符串表示设为空。 + *

示例值:1687708260000 + * + * @param datetimeValue + * @return + */ + public Builder datetimeValue(String datetimeValue) { + this.datetimeValue = datetimeValue; + return this; + } + + + /** + * 人员类型的自定义字段值,可以设置1个或多个用户的id(遵循member格式,只支持user类型)。当该字段的设置为“不能多选”时只能输入一个值。设为空数组表示设为空。 + *

示例值: + * + * @param memberValue + * @return + */ + public Builder memberValue(Member[] memberValue) { + this.memberValue = memberValue; + return this; + } + + + /** + * 单选类型字段值,填写一个字段选项的option_guid。设置为空字符串表示设为空。 + *

示例值:4216f79b-3fda-4dc6-a0c4-a16022e47152 + * + * @param singleSelectValue + * @return + */ + public Builder singleSelectValue(String singleSelectValue) { + this.singleSelectValue = singleSelectValue; + return this; + } + + + /** + * 多选类型字段值,可以填写一个或多个本字段的option_guid。设为空数组表示设为空。 + *

示例值: + * + * @param multiSelectValue + * @return + */ + public Builder multiSelectValue(String[] multiSelectValue) { + this.multiSelectValue = multiSelectValue; + return this; + } + + + /** + * 自定义字段名 + *

示例值:优先级 + * + * @param name + * @return + */ + public Builder name(String name) { + this.name = name; + return this; + } + + + /** + * 文本类型字段值。可以输入一段文本。空字符串表示清空。 + *

示例值:这是一段文本介绍。 + * + * @param textValue + * @return + */ + public Builder textValue(String textValue) { + this.textValue = textValue; + return this; + } + + + public CustomFieldValue build() { + return new CustomFieldValue(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DatetimeSetting.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DatetimeSetting.java new file mode 100644 index 000000000..b48af2853 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DatetimeSetting.java @@ -0,0 +1,74 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class DatetimeSetting { + /** + * 日期显示格式 + *

示例值:yyyy/mm/dd + */ + @SerializedName("format") + private String format; + + // builder 开始 + public DatetimeSetting() { + } + + public DatetimeSetting(Builder builder) { + /** + * 日期显示格式 + *

示例值:yyyy/mm/dd + */ + this.format = builder.format; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getFormat() { + return this.format; + } + + public void setFormat(String format) { + this.format = format; + } + + public static class Builder { + /** + * 日期显示格式 + *

示例值:yyyy/mm/dd + */ + private String format; + + /** + * 日期显示格式 + *

示例值:yyyy/mm/dd + * + * @param format + * @return + */ + public Builder format(String format) { + this.format = format; + return this; + } + + + public DatetimeSetting build() { + return new DatetimeSetting(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteAttachmentReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteAttachmentReq.java new file mode 100644 index 000000000..48940e25e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteAttachmentReq.java @@ -0,0 +1,72 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Path; + +public class DeleteAttachmentReq { + /** + * 要删除附件的GUID + *

示例值:b59aa7a3-e98c-4830-8273-cbb29f89b837 + */ + @Path + @SerializedName("attachment_guid") + private String attachmentGuid; + + // builder 开始 + public DeleteAttachmentReq() { + } + + public DeleteAttachmentReq(Builder builder) { + /** + * 要删除附件的GUID + *

示例值:b59aa7a3-e98c-4830-8273-cbb29f89b837 + */ + this.attachmentGuid = builder.attachmentGuid; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getAttachmentGuid() { + return this.attachmentGuid; + } + + public void setAttachmentGuid(String attachmentGuid) { + this.attachmentGuid = attachmentGuid; + } + + public static class Builder { + + private String attachmentGuid; // 要删除附件的GUID + + /** + * 要删除附件的GUID + *

示例值:b59aa7a3-e98c-4830-8273-cbb29f89b837 + * + * @param attachmentGuid + * @return + */ + public Builder attachmentGuid(String attachmentGuid) { + this.attachmentGuid = attachmentGuid; + return this; + } + + public DeleteAttachmentReq build() { + return new DeleteAttachmentReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteAttachmentResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteAttachmentResp.java new file mode 100644 index 000000000..a2c7b2e7e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteAttachmentResp.java @@ -0,0 +1,20 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; +import com.lark.oapi.core.response.EmptyData; + +public class DeleteAttachmentResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteCommentReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteCommentReq.java new file mode 100644 index 000000000..912f561d5 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteCommentReq.java @@ -0,0 +1,72 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Path; + +public class DeleteCommentReq { + /** + * 要删除的评论id + *

示例值:7198104824246747156 + */ + @Path + @SerializedName("comment_id") + private String commentId; + + // builder 开始 + public DeleteCommentReq() { + } + + public DeleteCommentReq(Builder builder) { + /** + * 要删除的评论id + *

示例值:7198104824246747156 + */ + this.commentId = builder.commentId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getCommentId() { + return this.commentId; + } + + public void setCommentId(String commentId) { + this.commentId = commentId; + } + + public static class Builder { + + private String commentId; // 要删除的评论id + + /** + * 要删除的评论id + *

示例值:7198104824246747156 + * + * @param commentId + * @return + */ + public Builder commentId(String commentId) { + this.commentId = commentId; + return this; + } + + public DeleteCommentReq build() { + return new DeleteCommentReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteCommentResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteCommentResp.java new file mode 100644 index 000000000..22cc9bd44 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteCommentResp.java @@ -0,0 +1,20 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; +import com.lark.oapi.core.response.EmptyData; + +public class DeleteCommentResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteSectionReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteSectionReq.java new file mode 100644 index 000000000..8319ca250 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteSectionReq.java @@ -0,0 +1,72 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Path; + +public class DeleteSectionReq { + /** + * 要删除的自定义分组全局唯一ID + *

示例值:9842501a-9f47-4ff5-a622-d319eeecb97f + */ + @Path + @SerializedName("section_guid") + private String sectionGuid; + + // builder 开始 + public DeleteSectionReq() { + } + + public DeleteSectionReq(Builder builder) { + /** + * 要删除的自定义分组全局唯一ID + *

示例值:9842501a-9f47-4ff5-a622-d319eeecb97f + */ + this.sectionGuid = builder.sectionGuid; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getSectionGuid() { + return this.sectionGuid; + } + + public void setSectionGuid(String sectionGuid) { + this.sectionGuid = sectionGuid; + } + + public static class Builder { + + private String sectionGuid; // 要删除的自定义分组全局唯一ID + + /** + * 要删除的自定义分组全局唯一ID + *

示例值:9842501a-9f47-4ff5-a622-d319eeecb97f + * + * @param sectionGuid + * @return + */ + public Builder sectionGuid(String sectionGuid) { + this.sectionGuid = sectionGuid; + return this; + } + + public DeleteSectionReq build() { + return new DeleteSectionReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteSectionResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteSectionResp.java new file mode 100644 index 000000000..717508bf3 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteSectionResp.java @@ -0,0 +1,20 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; +import com.lark.oapi.core.response.EmptyData; + +public class DeleteSectionResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteTaskReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteTaskReq.java new file mode 100644 index 000000000..e577b0173 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteTaskReq.java @@ -0,0 +1,72 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Path; + +public class DeleteTaskReq { + /** + * 要删除的任务guid + *

示例值:e297ddff-06ca-4166-b917-4ce57cd3a7a0 + */ + @Path + @SerializedName("task_guid") + private String taskGuid; + + // builder 开始 + public DeleteTaskReq() { + } + + public DeleteTaskReq(Builder builder) { + /** + * 要删除的任务guid + *

示例值:e297ddff-06ca-4166-b917-4ce57cd3a7a0 + */ + this.taskGuid = builder.taskGuid; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getTaskGuid() { + return this.taskGuid; + } + + public void setTaskGuid(String taskGuid) { + this.taskGuid = taskGuid; + } + + public static class Builder { + + private String taskGuid; // 要删除的任务guid + + /** + * 要删除的任务guid + *

示例值:e297ddff-06ca-4166-b917-4ce57cd3a7a0 + * + * @param taskGuid + * @return + */ + public Builder taskGuid(String taskGuid) { + this.taskGuid = taskGuid; + return this; + } + + public DeleteTaskReq build() { + return new DeleteTaskReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteTaskResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteTaskResp.java new file mode 100644 index 000000000..34e216e3e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteTaskResp.java @@ -0,0 +1,20 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; +import com.lark.oapi.core.response.EmptyData; + +public class DeleteTaskResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteTasklistActivitySubscriptionReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteTasklistActivitySubscriptionReq.java new file mode 100644 index 000000000..9ed987d1c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteTasklistActivitySubscriptionReq.java @@ -0,0 +1,106 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Path; + +public class DeleteTasklistActivitySubscriptionReq { + /** + * 清单GUID + *

示例值:f5ca6747-5ac3-422e-a97e-972c1b2c24f3 + */ + @Path + @SerializedName("tasklist_guid") + private String tasklistGuid; + /** + * 要删除的订阅GUID + *

示例值:d19e3a2a-edc0-4e4e-b7cc-950e162b53ae + */ + @Path + @SerializedName("activity_subscription_guid") + private String activitySubscriptionGuid; + + // builder 开始 + public DeleteTasklistActivitySubscriptionReq() { + } + + public DeleteTasklistActivitySubscriptionReq(Builder builder) { + /** + * 清单GUID + *

示例值:f5ca6747-5ac3-422e-a97e-972c1b2c24f3 + */ + this.tasklistGuid = builder.tasklistGuid; + /** + * 要删除的订阅GUID + *

示例值:d19e3a2a-edc0-4e4e-b7cc-950e162b53ae + */ + this.activitySubscriptionGuid = builder.activitySubscriptionGuid; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getTasklistGuid() { + return this.tasklistGuid; + } + + public void setTasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + } + + public String getActivitySubscriptionGuid() { + return this.activitySubscriptionGuid; + } + + public void setActivitySubscriptionGuid(String activitySubscriptionGuid) { + this.activitySubscriptionGuid = activitySubscriptionGuid; + } + + public static class Builder { + + private String tasklistGuid; // 清单GUID + private String activitySubscriptionGuid; // 要删除的订阅GUID + + /** + * 清单GUID + *

示例值:f5ca6747-5ac3-422e-a97e-972c1b2c24f3 + * + * @param tasklistGuid + * @return + */ + public Builder tasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + return this; + } + + + /** + * 要删除的订阅GUID + *

示例值:d19e3a2a-edc0-4e4e-b7cc-950e162b53ae + * + * @param activitySubscriptionGuid + * @return + */ + public Builder activitySubscriptionGuid(String activitySubscriptionGuid) { + this.activitySubscriptionGuid = activitySubscriptionGuid; + return this; + } + + public DeleteTasklistActivitySubscriptionReq build() { + return new DeleteTasklistActivitySubscriptionReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteTasklistActivitySubscriptionResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteTasklistActivitySubscriptionResp.java new file mode 100644 index 000000000..4e4e510f6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteTasklistActivitySubscriptionResp.java @@ -0,0 +1,20 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; +import com.lark.oapi.core.response.EmptyData; + +public class DeleteTasklistActivitySubscriptionResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteTasklistReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteTasklistReq.java new file mode 100644 index 000000000..3347596ec --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteTasklistReq.java @@ -0,0 +1,72 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Path; + +public class DeleteTasklistReq { + /** + * 要删除的任务GUID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + @Path + @SerializedName("tasklist_guid") + private String tasklistGuid; + + // builder 开始 + public DeleteTasklistReq() { + } + + public DeleteTasklistReq(Builder builder) { + /** + * 要删除的任务GUID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + this.tasklistGuid = builder.tasklistGuid; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getTasklistGuid() { + return this.tasklistGuid; + } + + public void setTasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + } + + public static class Builder { + + private String tasklistGuid; // 要删除的任务GUID + + /** + * 要删除的任务GUID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + * + * @param tasklistGuid + * @return + */ + public Builder tasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + return this; + } + + public DeleteTasklistReq build() { + return new DeleteTasklistReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteTasklistResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteTasklistResp.java new file mode 100644 index 000000000..f72cf16ca --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DeleteTasklistResp.java @@ -0,0 +1,20 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; +import com.lark.oapi.core.response.EmptyData; + +public class DeleteTasklistResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DepartmentId.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DepartmentId.java new file mode 100644 index 000000000..dc2d563b6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DepartmentId.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class DepartmentId { + /** + *

示例值: + */ + @SerializedName("department_id") + private String departmentId; + /** + *

示例值: + */ + @SerializedName("open_department_id") + private String openDepartmentId; + + // builder 开始 + public DepartmentId() { + } + + public DepartmentId(Builder builder) { + /** + * + *

示例值: + */ + this.departmentId = builder.departmentId; + /** + * + *

示例值: + */ + this.openDepartmentId = builder.openDepartmentId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getDepartmentId() { + return this.departmentId; + } + + public void setDepartmentId(String departmentId) { + this.departmentId = departmentId; + } + + public String getOpenDepartmentId() { + return this.openDepartmentId; + } + + public void setOpenDepartmentId(String openDepartmentId) { + this.openDepartmentId = openDepartmentId; + } + + public static class Builder { + /** + *

示例值: + */ + private String departmentId; + /** + *

示例值: + */ + private String openDepartmentId; + + /** + *

示例值: + * + * @param departmentId + * @return + */ + public Builder departmentId(String departmentId) { + this.departmentId = departmentId; + return this; + } + + + /** + *

示例值: + * + * @param openDepartmentId + * @return + */ + public Builder openDepartmentId(String openDepartmentId) { + this.openDepartmentId = openDepartmentId; + return this; + } + + + public DepartmentId build() { + return new DepartmentId(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DocxSource.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DocxSource.java new file mode 100644 index 000000000..46d9bfc37 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/DocxSource.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class DocxSource { + /** + * 任务关联的文档token,要求:如果使用tenant_access_token请求,则请求机器人有文档编辑权限;如果使用user_access_token,则请求用户有文档的编辑权限 + *

示例值:SFZHdZLo2oXprexhDSrbtvmScHm + */ + @SerializedName("token") + private String token; + /** + * 任务关联的文档block_id,要求block_id存在于token对应文档中、且block_id没有绑定过其他的任务 + *

示例值:O6wwd22uIoG8acxwxGtbljaUcfc + */ + @SerializedName("block_id") + private String blockId; + + // builder 开始 + public DocxSource() { + } + + public DocxSource(Builder builder) { + /** + * 任务关联的文档token,要求:如果使用tenant_access_token请求,则请求机器人有文档编辑权限;如果使用user_access_token,则请求用户有文档的编辑权限 + *

示例值:SFZHdZLo2oXprexhDSrbtvmScHm + */ + this.token = builder.token; + /** + * 任务关联的文档block_id,要求block_id存在于token对应文档中、且block_id没有绑定过其他的任务 + *

示例值:O6wwd22uIoG8acxwxGtbljaUcfc + */ + this.blockId = builder.blockId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getToken() { + return this.token; + } + + public void setToken(String token) { + this.token = token; + } + + public String getBlockId() { + return this.blockId; + } + + public void setBlockId(String blockId) { + this.blockId = blockId; + } + + public static class Builder { + /** + * 任务关联的文档token,要求:如果使用tenant_access_token请求,则请求机器人有文档编辑权限;如果使用user_access_token,则请求用户有文档的编辑权限 + *

示例值:SFZHdZLo2oXprexhDSrbtvmScHm + */ + private String token; + /** + * 任务关联的文档block_id,要求block_id存在于token对应文档中、且block_id没有绑定过其他的任务 + *

示例值:O6wwd22uIoG8acxwxGtbljaUcfc + */ + private String blockId; + + /** + * 任务关联的文档token,要求:如果使用tenant_access_token请求,则请求机器人有文档编辑权限;如果使用user_access_token,则请求用户有文档的编辑权限 + *

示例值:SFZHdZLo2oXprexhDSrbtvmScHm + * + * @param token + * @return + */ + public Builder token(String token) { + this.token = token; + return this; + } + + + /** + * 任务关联的文档block_id,要求block_id存在于token对应文档中、且block_id没有绑定过其他的任务 + *

示例值:O6wwd22uIoG8acxwxGtbljaUcfc + * + * @param blockId + * @return + */ + public Builder blockId(String blockId) { + this.blockId = blockId; + return this; + } + + + public DocxSource build() { + return new DocxSource(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Due.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Due.java new file mode 100644 index 000000000..314d63a86 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Due.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Due { + /** + * 截止时间/日期的时间戳,距1970-01-01 00:00:00的毫秒数。如果截止时间是一个日期,需要把日期转换成时间戳,并设置 is_all_day=true + *

示例值:1675454764000 + */ + @SerializedName("timestamp") + private String timestamp; + /** + * 是否截止到一个日期。如果设为true,timestamp中只有日期的部分会被解析和存储。 + *

示例值:true + */ + @SerializedName("is_all_day") + private Boolean isAllDay; + + // builder 开始 + public Due() { + } + + public Due(Builder builder) { + /** + * 截止时间/日期的时间戳,距1970-01-01 00:00:00的毫秒数。如果截止时间是一个日期,需要把日期转换成时间戳,并设置 is_all_day=true + *

示例值:1675454764000 + */ + this.timestamp = builder.timestamp; + /** + * 是否截止到一个日期。如果设为true,timestamp中只有日期的部分会被解析和存储。 + *

示例值:true + */ + this.isAllDay = builder.isAllDay; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getTimestamp() { + return this.timestamp; + } + + public void setTimestamp(String timestamp) { + this.timestamp = timestamp; + } + + public Boolean getIsAllDay() { + return this.isAllDay; + } + + public void setIsAllDay(Boolean isAllDay) { + this.isAllDay = isAllDay; + } + + public static class Builder { + /** + * 截止时间/日期的时间戳,距1970-01-01 00:00:00的毫秒数。如果截止时间是一个日期,需要把日期转换成时间戳,并设置 is_all_day=true + *

示例值:1675454764000 + */ + private String timestamp; + /** + * 是否截止到一个日期。如果设为true,timestamp中只有日期的部分会被解析和存储。 + *

示例值:true + */ + private Boolean isAllDay; + + /** + * 截止时间/日期的时间戳,距1970-01-01 00:00:00的毫秒数。如果截止时间是一个日期,需要把日期转换成时间戳,并设置 is_all_day=true + *

示例值:1675454764000 + * + * @param timestamp + * @return + */ + public Builder timestamp(String timestamp) { + this.timestamp = timestamp; + return this; + } + + + /** + * 是否截止到一个日期。如果设为true,timestamp中只有日期的部分会被解析和存储。 + *

示例值:true + * + * @param isAllDay + * @return + */ + public Builder isAllDay(Boolean isAllDay) { + this.isAllDay = isAllDay; + return this; + } + + + public Due build() { + return new Due(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Dummy.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Dummy.java new file mode 100644 index 000000000..a20658c23 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Dummy.java @@ -0,0 +1,74 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Dummy { + /** + * amazing的api meta + *

示例值:amazing the api meta haha + */ + @SerializedName("foo") + private String foo; + + // builder 开始 + public Dummy() { + } + + public Dummy(Builder builder) { + /** + * amazing的api meta + *

示例值:amazing the api meta haha + */ + this.foo = builder.foo; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getFoo() { + return this.foo; + } + + public void setFoo(String foo) { + this.foo = foo; + } + + public static class Builder { + /** + * amazing的api meta + *

示例值:amazing the api meta haha + */ + private String foo; + + /** + * amazing的api meta + *

示例值:amazing the api meta haha + * + * @param foo + * @return + */ + public Builder foo(String foo) { + this.foo = foo; + return this; + } + + + public Dummy build() { + return new Dummy(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetAttachmentReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetAttachmentReq.java new file mode 100644 index 000000000..b0b6f026b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetAttachmentReq.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class GetAttachmentReq { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 要获取附件详情的guid + *

示例值:b59aa7a3-e98c-4830-8273-cbb29f89b837 + */ + @Path + @SerializedName("attachment_guid") + private String attachmentGuid; + + // builder 开始 + public GetAttachmentReq() { + } + + public GetAttachmentReq(Builder builder) { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 要获取附件详情的guid + *

示例值:b59aa7a3-e98c-4830-8273-cbb29f89b837 + */ + this.attachmentGuid = builder.attachmentGuid; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getAttachmentGuid() { + return this.attachmentGuid; + } + + public void setAttachmentGuid(String attachmentGuid) { + this.attachmentGuid = attachmentGuid; + } + + public static class Builder { + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private String attachmentGuid; // 要获取附件详情的guid + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 要获取附件详情的guid + *

示例值:b59aa7a3-e98c-4830-8273-cbb29f89b837 + * + * @param attachmentGuid + * @return + */ + public Builder attachmentGuid(String attachmentGuid) { + this.attachmentGuid = attachmentGuid; + return this; + } + + public GetAttachmentReq build() { + return new GetAttachmentReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetAttachmentResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetAttachmentResp.java new file mode 100644 index 000000000..3ff6c9490 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetAttachmentResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class GetAttachmentResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetAttachmentRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetAttachmentRespBody.java new file mode 100644 index 000000000..b50914fb1 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetAttachmentRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class GetAttachmentRespBody { + /** + * 附件详情 + *

示例值: + */ + @SerializedName("attachment") + private Attachment attachment; + + public Attachment getAttachment() { + return this.attachment; + } + + public void setAttachment(Attachment attachment) { + this.attachment = attachment; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetCommentReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetCommentReq.java new file mode 100644 index 000000000..466ebe4f6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetCommentReq.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class GetCommentReq { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 评论ID + *

示例值:7198104824246747156 + */ + @Path + @SerializedName("comment_id") + private String commentId; + + // builder 开始 + public GetCommentReq() { + } + + public GetCommentReq(Builder builder) { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 评论ID + *

示例值:7198104824246747156 + */ + this.commentId = builder.commentId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getCommentId() { + return this.commentId; + } + + public void setCommentId(String commentId) { + this.commentId = commentId; + } + + public static class Builder { + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private String commentId; // 评论ID + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 评论ID + *

示例值:7198104824246747156 + * + * @param commentId + * @return + */ + public Builder commentId(String commentId) { + this.commentId = commentId; + return this; + } + + public GetCommentReq build() { + return new GetCommentReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetCommentResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetCommentResp.java new file mode 100644 index 000000000..9c31830c6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetCommentResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class GetCommentResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetCommentRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetCommentRespBody.java new file mode 100644 index 000000000..fae2599e9 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetCommentRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class GetCommentRespBody { + /** + * 评论详情 + *

示例值: + */ + @SerializedName("comment") + private Comment comment; + + public Comment getComment() { + return this.comment; + } + + public void setComment(Comment comment) { + this.comment = comment; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetCustomFieldReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetCustomFieldReq.java new file mode 100644 index 000000000..d4ac7e734 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetCustomFieldReq.java @@ -0,0 +1,117 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class GetCustomFieldReq { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 自定义字段GUID + *

示例值:5ffbe0ca-6600-41e0-a634-2b38cbcf13b8 + */ + @Path + @SerializedName("custom_field_guid") + private String customFieldGuid; + + // builder 开始 + public GetCustomFieldReq() { + } + + public GetCustomFieldReq(Builder builder) { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 自定义字段GUID + *

示例值:5ffbe0ca-6600-41e0-a634-2b38cbcf13b8 + */ + this.customFieldGuid = builder.customFieldGuid; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getCustomFieldGuid() { + return this.customFieldGuid; + } + + public void setCustomFieldGuid(String customFieldGuid) { + this.customFieldGuid = customFieldGuid; + } + + public static class Builder { + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private String customFieldGuid; // 自定义字段GUID + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType {@link com.lark.oapi.service.task.v2.enums.GetCustomFieldUserIdTypeEnum} + * @return + */ + public Builder userIdType(com.lark.oapi.service.task.v2.enums.GetCustomFieldUserIdTypeEnum userIdType) { + this.userIdType = userIdType.getValue(); + return this; + } + + /** + * 自定义字段GUID + *

示例值:5ffbe0ca-6600-41e0-a634-2b38cbcf13b8 + * + * @param customFieldGuid + * @return + */ + public Builder customFieldGuid(String customFieldGuid) { + this.customFieldGuid = customFieldGuid; + return this; + } + + public GetCustomFieldReq build() { + return new GetCustomFieldReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetCustomFieldResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetCustomFieldResp.java new file mode 100644 index 000000000..00b6653fc --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetCustomFieldResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class GetCustomFieldResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetCustomFieldRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetCustomFieldRespBody.java new file mode 100644 index 000000000..e7067b759 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetCustomFieldRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class GetCustomFieldRespBody { + /** + * 获取的自定义字段数据 + *

示例值: + */ + @SerializedName("custom_field") + private CustomField customField; + + public CustomField getCustomField() { + return this.customField; + } + + public void setCustomField(CustomField customField) { + this.customField = customField; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetSectionReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetSectionReq.java new file mode 100644 index 000000000..d98e49d83 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetSectionReq.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class GetSectionReq { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 要获取的自定义分组GUID + *

示例值:9842501a-9f47-4ff5-a622-d319eeecb97f + */ + @Path + @SerializedName("section_guid") + private String sectionGuid; + + // builder 开始 + public GetSectionReq() { + } + + public GetSectionReq(Builder builder) { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 要获取的自定义分组GUID + *

示例值:9842501a-9f47-4ff5-a622-d319eeecb97f + */ + this.sectionGuid = builder.sectionGuid; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getSectionGuid() { + return this.sectionGuid; + } + + public void setSectionGuid(String sectionGuid) { + this.sectionGuid = sectionGuid; + } + + public static class Builder { + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private String sectionGuid; // 要获取的自定义分组GUID + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 要获取的自定义分组GUID + *

示例值:9842501a-9f47-4ff5-a622-d319eeecb97f + * + * @param sectionGuid + * @return + */ + public Builder sectionGuid(String sectionGuid) { + this.sectionGuid = sectionGuid; + return this; + } + + public GetSectionReq build() { + return new GetSectionReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetSectionResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetSectionResp.java new file mode 100644 index 000000000..283a4f825 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetSectionResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class GetSectionResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetSectionRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetSectionRespBody.java new file mode 100644 index 000000000..456d1a13e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetSectionRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class GetSectionRespBody { + /** + * 获取的自定义分组详情 + *

示例值: + */ + @SerializedName("section") + private Section section; + + public Section getSection() { + return this.section; + } + + public void setSection(Section section) { + this.section = section; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTaskReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTaskReq.java new file mode 100644 index 000000000..ab476ba45 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTaskReq.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class GetTaskReq { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 要获取的任务guid + *

示例值:e297ddff-06ca-4166-b917-4ce57cd3a7a0 + */ + @Path + @SerializedName("task_guid") + private String taskGuid; + + // builder 开始 + public GetTaskReq() { + } + + public GetTaskReq(Builder builder) { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 要获取的任务guid + *

示例值:e297ddff-06ca-4166-b917-4ce57cd3a7a0 + */ + this.taskGuid = builder.taskGuid; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getTaskGuid() { + return this.taskGuid; + } + + public void setTaskGuid(String taskGuid) { + this.taskGuid = taskGuid; + } + + public static class Builder { + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private String taskGuid; // 要获取的任务guid + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 要获取的任务guid + *

示例值:e297ddff-06ca-4166-b917-4ce57cd3a7a0 + * + * @param taskGuid + * @return + */ + public Builder taskGuid(String taskGuid) { + this.taskGuid = taskGuid; + return this; + } + + public GetTaskReq build() { + return new GetTaskReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTaskResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTaskResp.java new file mode 100644 index 000000000..91108a5ac --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTaskResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class GetTaskResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTaskRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTaskRespBody.java new file mode 100644 index 000000000..0423de185 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTaskRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class GetTaskRespBody { + /** + * 获得的任务实体 + *

示例值: + */ + @SerializedName("task") + private Task task; + + public Task getTask() { + return this.task; + } + + public void setTask(Task task) { + this.task = task; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTasklistActivitySubscriptionReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTasklistActivitySubscriptionReq.java new file mode 100644 index 000000000..8fe8a6e67 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTasklistActivitySubscriptionReq.java @@ -0,0 +1,151 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class GetTasklistActivitySubscriptionReq { + /** + * 用户ID类型 + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 清单GUID + *

示例值:33991879-704f-444f-81d7-55a6aa7be80c + */ + @Path + @SerializedName("tasklist_guid") + private String tasklistGuid; + /** + * 订阅GUID + *

示例值:33991879-704f-444f-81d7-55a6aa7be80c + */ + @Path + @SerializedName("activity_subscription_guid") + private String activitySubscriptionGuid; + + // builder 开始 + public GetTasklistActivitySubscriptionReq() { + } + + public GetTasklistActivitySubscriptionReq(Builder builder) { + /** + * 用户ID类型 + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 清单GUID + *

示例值:33991879-704f-444f-81d7-55a6aa7be80c + */ + this.tasklistGuid = builder.tasklistGuid; + /** + * 订阅GUID + *

示例值:33991879-704f-444f-81d7-55a6aa7be80c + */ + this.activitySubscriptionGuid = builder.activitySubscriptionGuid; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getTasklistGuid() { + return this.tasklistGuid; + } + + public void setTasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + } + + public String getActivitySubscriptionGuid() { + return this.activitySubscriptionGuid; + } + + public void setActivitySubscriptionGuid(String activitySubscriptionGuid) { + this.activitySubscriptionGuid = activitySubscriptionGuid; + } + + public static class Builder { + private String userIdType; // 用户ID类型 + private String tasklistGuid; // 清单GUID + private String activitySubscriptionGuid; // 订阅GUID + + /** + * 用户ID类型 + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 用户ID类型 + *

示例值:open_id + * + * @param userIdType {@link com.lark.oapi.service.task.v2.enums.GetTasklistActivitySubscriptionUserIdTypeEnum} + * @return + */ + public Builder userIdType(com.lark.oapi.service.task.v2.enums.GetTasklistActivitySubscriptionUserIdTypeEnum userIdType) { + this.userIdType = userIdType.getValue(); + return this; + } + + /** + * 清单GUID + *

示例值:33991879-704f-444f-81d7-55a6aa7be80c + * + * @param tasklistGuid + * @return + */ + public Builder tasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + return this; + } + + + /** + * 订阅GUID + *

示例值:33991879-704f-444f-81d7-55a6aa7be80c + * + * @param activitySubscriptionGuid + * @return + */ + public Builder activitySubscriptionGuid(String activitySubscriptionGuid) { + this.activitySubscriptionGuid = activitySubscriptionGuid; + return this; + } + + public GetTasklistActivitySubscriptionReq build() { + return new GetTasklistActivitySubscriptionReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTasklistActivitySubscriptionResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTasklistActivitySubscriptionResp.java new file mode 100644 index 000000000..82a0e5bb8 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTasklistActivitySubscriptionResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class GetTasklistActivitySubscriptionResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTasklistActivitySubscriptionRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTasklistActivitySubscriptionRespBody.java new file mode 100644 index 000000000..fe697c6d0 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTasklistActivitySubscriptionRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class GetTasklistActivitySubscriptionRespBody { + /** + * 订阅详情 + *

示例值: + */ + @SerializedName("activity_subscription") + private TasklistActivitySubscription activitySubscription; + + public TasklistActivitySubscription getActivitySubscription() { + return this.activitySubscription; + } + + public void setActivitySubscription(TasklistActivitySubscription activitySubscription) { + this.activitySubscription = activitySubscription; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTasklistReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTasklistReq.java new file mode 100644 index 000000000..2ef472fd9 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTasklistReq.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class GetTasklistReq { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 清单全局唯一GUID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + @Path + @SerializedName("tasklist_guid") + private String tasklistGuid; + + // builder 开始 + public GetTasklistReq() { + } + + public GetTasklistReq(Builder builder) { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 清单全局唯一GUID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + this.tasklistGuid = builder.tasklistGuid; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getTasklistGuid() { + return this.tasklistGuid; + } + + public void setTasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + } + + public static class Builder { + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private String tasklistGuid; // 清单全局唯一GUID + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 清单全局唯一GUID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + * + * @param tasklistGuid + * @return + */ + public Builder tasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + return this; + } + + public GetTasklistReq build() { + return new GetTasklistReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTasklistResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTasklistResp.java new file mode 100644 index 000000000..84111a46d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTasklistResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class GetTasklistResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTasklistRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTasklistRespBody.java new file mode 100644 index 000000000..734b445d3 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/GetTasklistRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class GetTasklistRespBody { + /** + * 清单详情 + *

示例值: + */ + @SerializedName("tasklist") + private Tasklist tasklist; + + public Tasklist getTasklist() { + return this.tasklist; + } + + public void setTasklist(Tasklist tasklist) { + this.tasklist = tasklist; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Href.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Href.java new file mode 100644 index 000000000..d1be17d1e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Href.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Href { + /** + * 链接对应的地址 + *

示例值:https://www.example.com + */ + @SerializedName("url") + private String url; + /** + * 链接对应的标题 + *

示例值:反馈一个问题,需要协助排查 + */ + @SerializedName("title") + private String title; + + // builder 开始 + public Href() { + } + + public Href(Builder builder) { + /** + * 链接对应的地址 + *

示例值:https://www.example.com + */ + this.url = builder.url; + /** + * 链接对应的标题 + *

示例值:反馈一个问题,需要协助排查 + */ + this.title = builder.title; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public static class Builder { + /** + * 链接对应的地址 + *

示例值:https://www.example.com + */ + private String url; + /** + * 链接对应的标题 + *

示例值:反馈一个问题,需要协助排查 + */ + private String title; + + /** + * 链接对应的地址 + *

示例值:https://www.example.com + * + * @param url + * @return + */ + public Builder url(String url) { + this.url = url; + return this; + } + + + /** + * 链接对应的标题 + *

示例值:反馈一个问题,需要协助排查 + * + * @param title + * @return + */ + public Builder title(String title) { + this.title = title; + return this; + } + + + public Href build() { + return new Href(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/I18nText.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/I18nText.java new file mode 100644 index 000000000..1e506afda --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/I18nText.java @@ -0,0 +1,481 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class I18nText { + /** + * 英文 + *

示例值:workbench + */ + @SerializedName("en_us") + private String enUs; + /** + * 中文 + *

示例值:工作台 + */ + @SerializedName("zh_cn") + private String zhCn; + /** + * 中文(香港地区) + *

示例值:工作臺 + */ + @SerializedName("zh_hk") + private String zhHk; + /** + * 中文(台湾地区) + *

示例值:工作臺 + */ + @SerializedName("zh_tw") + private String zhTw; + /** + * 日语 + *

示例值:作業台 + */ + @SerializedName("ja_jp") + private String jaJp; + /** + * 法语 + *

示例值:Table de travail + */ + @SerializedName("fr_fr") + private String frFr; + /** + * 意大利语 + *

示例值:banco di lavoro + */ + @SerializedName("it_it") + private String itIt; + /** + * 德语 + *

示例值:Werkbank + */ + @SerializedName("de_de") + private String deDe; + /** + * 俄语 + *

示例值:верстак + */ + @SerializedName("ru_ru") + private String ruRu; + /** + * 泰语 + *

示例值:โต๊ะทำงาน + */ + @SerializedName("th_th") + private String thTh; + /** + * 西班牙语 + *

示例值:banco de trabajo + */ + @SerializedName("es_es") + private String esEs; + /** + * 韩语 + *

示例值:작업대 + */ + @SerializedName("ko_kr") + private String koKr; + + // builder 开始 + public I18nText() { + } + + public I18nText(Builder builder) { + /** + * 英文 + *

示例值:workbench + */ + this.enUs = builder.enUs; + /** + * 中文 + *

示例值:工作台 + */ + this.zhCn = builder.zhCn; + /** + * 中文(香港地区) + *

示例值:工作臺 + */ + this.zhHk = builder.zhHk; + /** + * 中文(台湾地区) + *

示例值:工作臺 + */ + this.zhTw = builder.zhTw; + /** + * 日语 + *

示例值:作業台 + */ + this.jaJp = builder.jaJp; + /** + * 法语 + *

示例值:Table de travail + */ + this.frFr = builder.frFr; + /** + * 意大利语 + *

示例值:banco di lavoro + */ + this.itIt = builder.itIt; + /** + * 德语 + *

示例值:Werkbank + */ + this.deDe = builder.deDe; + /** + * 俄语 + *

示例值:верстак + */ + this.ruRu = builder.ruRu; + /** + * 泰语 + *

示例值:โต๊ะทำงาน + */ + this.thTh = builder.thTh; + /** + * 西班牙语 + *

示例值:banco de trabajo + */ + this.esEs = builder.esEs; + /** + * 韩语 + *

示例值:작업대 + */ + this.koKr = builder.koKr; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getEnUs() { + return this.enUs; + } + + public void setEnUs(String enUs) { + this.enUs = enUs; + } + + public String getZhCn() { + return this.zhCn; + } + + public void setZhCn(String zhCn) { + this.zhCn = zhCn; + } + + public String getZhHk() { + return this.zhHk; + } + + public void setZhHk(String zhHk) { + this.zhHk = zhHk; + } + + public String getZhTw() { + return this.zhTw; + } + + public void setZhTw(String zhTw) { + this.zhTw = zhTw; + } + + public String getJaJp() { + return this.jaJp; + } + + public void setJaJp(String jaJp) { + this.jaJp = jaJp; + } + + public String getFrFr() { + return this.frFr; + } + + public void setFrFr(String frFr) { + this.frFr = frFr; + } + + public String getItIt() { + return this.itIt; + } + + public void setItIt(String itIt) { + this.itIt = itIt; + } + + public String getDeDe() { + return this.deDe; + } + + public void setDeDe(String deDe) { + this.deDe = deDe; + } + + public String getRuRu() { + return this.ruRu; + } + + public void setRuRu(String ruRu) { + this.ruRu = ruRu; + } + + public String getThTh() { + return this.thTh; + } + + public void setThTh(String thTh) { + this.thTh = thTh; + } + + public String getEsEs() { + return this.esEs; + } + + public void setEsEs(String esEs) { + this.esEs = esEs; + } + + public String getKoKr() { + return this.koKr; + } + + public void setKoKr(String koKr) { + this.koKr = koKr; + } + + public static class Builder { + /** + * 英文 + *

示例值:workbench + */ + private String enUs; + /** + * 中文 + *

示例值:工作台 + */ + private String zhCn; + /** + * 中文(香港地区) + *

示例值:工作臺 + */ + private String zhHk; + /** + * 中文(台湾地区) + *

示例值:工作臺 + */ + private String zhTw; + /** + * 日语 + *

示例值:作業台 + */ + private String jaJp; + /** + * 法语 + *

示例值:Table de travail + */ + private String frFr; + /** + * 意大利语 + *

示例值:banco di lavoro + */ + private String itIt; + /** + * 德语 + *

示例值:Werkbank + */ + private String deDe; + /** + * 俄语 + *

示例值:верстак + */ + private String ruRu; + /** + * 泰语 + *

示例值:โต๊ะทำงาน + */ + private String thTh; + /** + * 西班牙语 + *

示例值:banco de trabajo + */ + private String esEs; + /** + * 韩语 + *

示例值:작업대 + */ + private String koKr; + + /** + * 英文 + *

示例值:workbench + * + * @param enUs + * @return + */ + public Builder enUs(String enUs) { + this.enUs = enUs; + return this; + } + + + /** + * 中文 + *

示例值:工作台 + * + * @param zhCn + * @return + */ + public Builder zhCn(String zhCn) { + this.zhCn = zhCn; + return this; + } + + + /** + * 中文(香港地区) + *

示例值:工作臺 + * + * @param zhHk + * @return + */ + public Builder zhHk(String zhHk) { + this.zhHk = zhHk; + return this; + } + + + /** + * 中文(台湾地区) + *

示例值:工作臺 + * + * @param zhTw + * @return + */ + public Builder zhTw(String zhTw) { + this.zhTw = zhTw; + return this; + } + + + /** + * 日语 + *

示例值:作業台 + * + * @param jaJp + * @return + */ + public Builder jaJp(String jaJp) { + this.jaJp = jaJp; + return this; + } + + + /** + * 法语 + *

示例值:Table de travail + * + * @param frFr + * @return + */ + public Builder frFr(String frFr) { + this.frFr = frFr; + return this; + } + + + /** + * 意大利语 + *

示例值:banco di lavoro + * + * @param itIt + * @return + */ + public Builder itIt(String itIt) { + this.itIt = itIt; + return this; + } + + + /** + * 德语 + *

示例值:Werkbank + * + * @param deDe + * @return + */ + public Builder deDe(String deDe) { + this.deDe = deDe; + return this; + } + + + /** + * 俄语 + *

示例值:верстак + * + * @param ruRu + * @return + */ + public Builder ruRu(String ruRu) { + this.ruRu = ruRu; + return this; + } + + + /** + * 泰语 + *

示例值:โต๊ะทำงาน + * + * @param thTh + * @return + */ + public Builder thTh(String thTh) { + this.thTh = thTh; + return this; + } + + + /** + * 西班牙语 + *

示例值:banco de trabajo + * + * @param esEs + * @return + */ + public Builder esEs(String esEs) { + this.esEs = esEs; + return this; + } + + + /** + * 韩语 + *

示例值:작업대 + * + * @param koKr + * @return + */ + public Builder koKr(String koKr) { + this.koKr = koKr; + return this; + } + + + public I18nText build() { + return new I18nText(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputAttachment.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputAttachment.java new file mode 100644 index 000000000..7849be205 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputAttachment.java @@ -0,0 +1,148 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class InputAttachment { + /** + * 附件归属资源的类型 + *

示例值:task + */ + @SerializedName("resource_type") + private String resourceType; + /** + * 附件要归属资源的id。例如,要给任务添加附件,这里要填入任务的全局唯一ID + *

示例值:fe96108d-b004-4a47-b2f8-6886e758b3a5 + */ + @SerializedName("resource_id") + private String resourceId; + /** + * 要上传的文件 + *

示例值: + */ + @SerializedName("file") + private java.io.File file; + + // builder 开始 + public InputAttachment() { + } + + public InputAttachment(Builder builder) { + /** + * 附件归属资源的类型 + *

示例值:task + */ + this.resourceType = builder.resourceType; + /** + * 附件要归属资源的id。例如,要给任务添加附件,这里要填入任务的全局唯一ID + *

示例值:fe96108d-b004-4a47-b2f8-6886e758b3a5 + */ + this.resourceId = builder.resourceId; + /** + * 要上传的文件 + *

示例值: + */ + this.file = builder.file; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getResourceType() { + return this.resourceType; + } + + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + public String getResourceId() { + return this.resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public java.io.File getFile() { + return this.file; + } + + public void setFile(java.io.File file) { + this.file = file; + } + + public static class Builder { + /** + * 附件归属资源的类型 + *

示例值:task + */ + private String resourceType; + /** + * 附件要归属资源的id。例如,要给任务添加附件,这里要填入任务的全局唯一ID + *

示例值:fe96108d-b004-4a47-b2f8-6886e758b3a5 + */ + private String resourceId; + /** + * 要上传的文件 + *

示例值: + */ + private java.io.File file; + + /** + * 附件归属资源的类型 + *

示例值:task + * + * @param resourceType + * @return + */ + public Builder resourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + + /** + * 附件要归属资源的id。例如,要给任务添加附件,这里要填入任务的全局唯一ID + *

示例值:fe96108d-b004-4a47-b2f8-6886e758b3a5 + * + * @param resourceId + * @return + */ + public Builder resourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + + /** + * 要上传的文件 + *

示例值: + * + * @param file + * @return + */ + public Builder file(java.io.File file) { + this.file = file; + return this; + } + + + public InputAttachment build() { + return new InputAttachment(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputComment.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputComment.java new file mode 100644 index 000000000..cfaa30a12 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputComment.java @@ -0,0 +1,185 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class InputComment { + /** + * 评论内容 + *

示例值:举杯邀明月,对影成三人 + */ + @SerializedName("content") + private String content; + /** + * 回复给评论的id + *

示例值:6937231762296684564 + */ + @SerializedName("reply_to_comment_id") + private String replyToCommentId; + /** + * 评论归属的资源类型 + *

示例值:task + */ + @SerializedName("resource_type") + private String resourceType; + /** + * 评论归属的资源ID + *

示例值:ccb55625-95d2-2e80-655f-0e40bf67953f + */ + @SerializedName("resource_id") + private String resourceId; + + // builder 开始 + public InputComment() { + } + + public InputComment(Builder builder) { + /** + * 评论内容 + *

示例值:举杯邀明月,对影成三人 + */ + this.content = builder.content; + /** + * 回复给评论的id + *

示例值:6937231762296684564 + */ + this.replyToCommentId = builder.replyToCommentId; + /** + * 评论归属的资源类型 + *

示例值:task + */ + this.resourceType = builder.resourceType; + /** + * 评论归属的资源ID + *

示例值:ccb55625-95d2-2e80-655f-0e40bf67953f + */ + this.resourceId = builder.resourceId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getReplyToCommentId() { + return this.replyToCommentId; + } + + public void setReplyToCommentId(String replyToCommentId) { + this.replyToCommentId = replyToCommentId; + } + + public String getResourceType() { + return this.resourceType; + } + + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + public String getResourceId() { + return this.resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public static class Builder { + /** + * 评论内容 + *

示例值:举杯邀明月,对影成三人 + */ + private String content; + /** + * 回复给评论的id + *

示例值:6937231762296684564 + */ + private String replyToCommentId; + /** + * 评论归属的资源类型 + *

示例值:task + */ + private String resourceType; + /** + * 评论归属的资源ID + *

示例值:ccb55625-95d2-2e80-655f-0e40bf67953f + */ + private String resourceId; + + /** + * 评论内容 + *

示例值:举杯邀明月,对影成三人 + * + * @param content + * @return + */ + public Builder content(String content) { + this.content = content; + return this; + } + + + /** + * 回复给评论的id + *

示例值:6937231762296684564 + * + * @param replyToCommentId + * @return + */ + public Builder replyToCommentId(String replyToCommentId) { + this.replyToCommentId = replyToCommentId; + return this; + } + + + /** + * 评论归属的资源类型 + *

示例值:task + * + * @param resourceType + * @return + */ + public Builder resourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + + /** + * 评论归属的资源ID + *

示例值:ccb55625-95d2-2e80-655f-0e40bf67953f + * + * @param resourceId + * @return + */ + public Builder resourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + + public InputComment build() { + return new InputComment(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputCustomField.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputCustomField.java new file mode 100644 index 000000000..40d1df2fa --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputCustomField.java @@ -0,0 +1,419 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class InputCustomField { + /** + * 自定义字段归属的资源类型 + *

示例值:tasklist + */ + @SerializedName("resource_type") + private String resourceType; + /** + * 自定义字段归属的资源id,目前必然是tasklist_guid + *

示例值:5ffbe0ca-6600-41e0-a634-2b38cbcf13b8 + */ + @SerializedName("resource_id") + private String resourceId; + /** + * 字段名称 + *

示例值:优先级 + */ + @SerializedName("name") + private String name; + /** + * 字段类型 + *

示例值:number + */ + @SerializedName("type") + private String type; + /** + * 数字类型的字段设置 + *

示例值: + */ + @SerializedName("number_setting") + private NumberSetting numberSetting; + /** + * 人员类型的字段设置 + *

示例值: + */ + @SerializedName("member_setting") + private MemberSetting memberSetting; + /** + * 时间日期类型的字段设置 + *

示例值: + */ + @SerializedName("datetime_setting") + private DatetimeSetting datetimeSetting; + /** + * 单选类型的字段设置 + *

示例值: + */ + @SerializedName("single_select_setting") + private SelectSetting singleSelectSetting; + /** + * 多选类型的字段设置 + *

示例值: + */ + @SerializedName("multi_select_setting") + private SelectSetting multiSelectSetting; + /** + * 文本类型 + *

示例值: + */ + @SerializedName("text_setting") + private TextSetting textSetting; + + // builder 开始 + public InputCustomField() { + } + + public InputCustomField(Builder builder) { + /** + * 自定义字段归属的资源类型 + *

示例值:tasklist + */ + this.resourceType = builder.resourceType; + /** + * 自定义字段归属的资源id,目前必然是tasklist_guid + *

示例值:5ffbe0ca-6600-41e0-a634-2b38cbcf13b8 + */ + this.resourceId = builder.resourceId; + /** + * 字段名称 + *

示例值:优先级 + */ + this.name = builder.name; + /** + * 字段类型 + *

示例值:number + */ + this.type = builder.type; + /** + * 数字类型的字段设置 + *

示例值: + */ + this.numberSetting = builder.numberSetting; + /** + * 人员类型的字段设置 + *

示例值: + */ + this.memberSetting = builder.memberSetting; + /** + * 时间日期类型的字段设置 + *

示例值: + */ + this.datetimeSetting = builder.datetimeSetting; + /** + * 单选类型的字段设置 + *

示例值: + */ + this.singleSelectSetting = builder.singleSelectSetting; + /** + * 多选类型的字段设置 + *

示例值: + */ + this.multiSelectSetting = builder.multiSelectSetting; + /** + * 文本类型 + *

示例值: + */ + this.textSetting = builder.textSetting; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getResourceType() { + return this.resourceType; + } + + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + public String getResourceId() { + return this.resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public NumberSetting getNumberSetting() { + return this.numberSetting; + } + + public void setNumberSetting(NumberSetting numberSetting) { + this.numberSetting = numberSetting; + } + + public MemberSetting getMemberSetting() { + return this.memberSetting; + } + + public void setMemberSetting(MemberSetting memberSetting) { + this.memberSetting = memberSetting; + } + + public DatetimeSetting getDatetimeSetting() { + return this.datetimeSetting; + } + + public void setDatetimeSetting(DatetimeSetting datetimeSetting) { + this.datetimeSetting = datetimeSetting; + } + + public SelectSetting getSingleSelectSetting() { + return this.singleSelectSetting; + } + + public void setSingleSelectSetting(SelectSetting singleSelectSetting) { + this.singleSelectSetting = singleSelectSetting; + } + + public SelectSetting getMultiSelectSetting() { + return this.multiSelectSetting; + } + + public void setMultiSelectSetting(SelectSetting multiSelectSetting) { + this.multiSelectSetting = multiSelectSetting; + } + + public TextSetting getTextSetting() { + return this.textSetting; + } + + public void setTextSetting(TextSetting textSetting) { + this.textSetting = textSetting; + } + + public static class Builder { + /** + * 自定义字段归属的资源类型 + *

示例值:tasklist + */ + private String resourceType; + /** + * 自定义字段归属的资源id,目前必然是tasklist_guid + *

示例值:5ffbe0ca-6600-41e0-a634-2b38cbcf13b8 + */ + private String resourceId; + /** + * 字段名称 + *

示例值:优先级 + */ + private String name; + /** + * 字段类型 + *

示例值:number + */ + private String type; + /** + * 数字类型的字段设置 + *

示例值: + */ + private NumberSetting numberSetting; + /** + * 人员类型的字段设置 + *

示例值: + */ + private MemberSetting memberSetting; + /** + * 时间日期类型的字段设置 + *

示例值: + */ + private DatetimeSetting datetimeSetting; + /** + * 单选类型的字段设置 + *

示例值: + */ + private SelectSetting singleSelectSetting; + /** + * 多选类型的字段设置 + *

示例值: + */ + private SelectSetting multiSelectSetting; + /** + * 文本类型 + *

示例值: + */ + private TextSetting textSetting; + + /** + * 自定义字段归属的资源类型 + *

示例值:tasklist + * + * @param resourceType + * @return + */ + public Builder resourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + + /** + * 自定义字段归属的资源id,目前必然是tasklist_guid + *

示例值:5ffbe0ca-6600-41e0-a634-2b38cbcf13b8 + * + * @param resourceId + * @return + */ + public Builder resourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + + /** + * 字段名称 + *

示例值:优先级 + * + * @param name + * @return + */ + public Builder name(String name) { + this.name = name; + return this; + } + + + /** + * 字段类型 + *

示例值:number + * + * @param type + * @return + */ + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * 字段类型 + *

示例值:number + * + * @param type {@link com.lark.oapi.service.task.v2.enums.InputCustomFieldTypeEnum} + * @return + */ + public Builder type(com.lark.oapi.service.task.v2.enums.InputCustomFieldTypeEnum type) { + this.type = type.getValue(); + return this; + } + + + /** + * 数字类型的字段设置 + *

示例值: + * + * @param numberSetting + * @return + */ + public Builder numberSetting(NumberSetting numberSetting) { + this.numberSetting = numberSetting; + return this; + } + + + /** + * 人员类型的字段设置 + *

示例值: + * + * @param memberSetting + * @return + */ + public Builder memberSetting(MemberSetting memberSetting) { + this.memberSetting = memberSetting; + return this; + } + + + /** + * 时间日期类型的字段设置 + *

示例值: + * + * @param datetimeSetting + * @return + */ + public Builder datetimeSetting(DatetimeSetting datetimeSetting) { + this.datetimeSetting = datetimeSetting; + return this; + } + + + /** + * 单选类型的字段设置 + *

示例值: + * + * @param singleSelectSetting + * @return + */ + public Builder singleSelectSetting(SelectSetting singleSelectSetting) { + this.singleSelectSetting = singleSelectSetting; + return this; + } + + + /** + * 多选类型的字段设置 + *

示例值: + * + * @param multiSelectSetting + * @return + */ + public Builder multiSelectSetting(SelectSetting multiSelectSetting) { + this.multiSelectSetting = multiSelectSetting; + return this; + } + + + /** + * 文本类型 + *

示例值: + * + * @param textSetting + * @return + */ + public Builder textSetting(TextSetting textSetting) { + this.textSetting = textSetting; + return this; + } + + + public InputCustomField build() { + return new InputCustomField(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputCustomFieldValue.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputCustomFieldValue.java new file mode 100644 index 000000000..b8ee05785 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputCustomFieldValue.java @@ -0,0 +1,296 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class InputCustomFieldValue { + /** + * 自定义字段guid + *

示例值:73b21903-0041-4796-a11e-f8be919a7063 + */ + @SerializedName("guid") + private String guid; + /** + * 数字类型的自定义字段值,填写一个合法数字的字符串表示,空字符串表示设为空。 + *

示例值:10.23 + */ + @SerializedName("number_value") + private String numberValue; + /** + * 人员类型的自定义字段值。可以设置1个或多个用户的id(遵循member格式,只支持user类型)。当字段设为只不能多选时只能输入一个值。设为空数组表示设为空。 + *

示例值: + */ + @SerializedName("member_value") + private Member[] memberValue; + /** + * 日期类型自定义字段值,可以输入一个表示日期的以毫秒为单位的字符串。设为空字符串表示设为空。 + *

示例值:1698192000000 + */ + @SerializedName("datetime_value") + private String datetimeValue; + /** + * 单选类型字段值,填写一个字段选项的option_guid。设置为空字符串表示设为空。 + *

示例值:73b21903-0041-4796-a11e-f8be919a7063 + */ + @SerializedName("single_select_value") + private String singleSelectValue; + /** + * 多选类型字段值,可以填写一个或多个本字段的option_guid。设为空数组表示设为空。 + *

示例值: + */ + @SerializedName("multi_select_value") + private String[] multiSelectValue; + /** + * 文本类型字段值。可以填写最多3000字符。使用空字符串表示设为空。 + *

示例值:文本类型字段值。可以输入一段文本。空字符串表示清空。 + */ + @SerializedName("text_value") + private String textValue; + + // builder 开始 + public InputCustomFieldValue() { + } + + public InputCustomFieldValue(Builder builder) { + /** + * 自定义字段guid + *

示例值:73b21903-0041-4796-a11e-f8be919a7063 + */ + this.guid = builder.guid; + /** + * 数字类型的自定义字段值,填写一个合法数字的字符串表示,空字符串表示设为空。 + *

示例值:10.23 + */ + this.numberValue = builder.numberValue; + /** + * 人员类型的自定义字段值。可以设置1个或多个用户的id(遵循member格式,只支持user类型)。当字段设为只不能多选时只能输入一个值。设为空数组表示设为空。 + *

示例值: + */ + this.memberValue = builder.memberValue; + /** + * 日期类型自定义字段值,可以输入一个表示日期的以毫秒为单位的字符串。设为空字符串表示设为空。 + *

示例值:1698192000000 + */ + this.datetimeValue = builder.datetimeValue; + /** + * 单选类型字段值,填写一个字段选项的option_guid。设置为空字符串表示设为空。 + *

示例值:73b21903-0041-4796-a11e-f8be919a7063 + */ + this.singleSelectValue = builder.singleSelectValue; + /** + * 多选类型字段值,可以填写一个或多个本字段的option_guid。设为空数组表示设为空。 + *

示例值: + */ + this.multiSelectValue = builder.multiSelectValue; + /** + * 文本类型字段值。可以填写最多3000字符。使用空字符串表示设为空。 + *

示例值:文本类型字段值。可以输入一段文本。空字符串表示清空。 + */ + this.textValue = builder.textValue; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getGuid() { + return this.guid; + } + + public void setGuid(String guid) { + this.guid = guid; + } + + public String getNumberValue() { + return this.numberValue; + } + + public void setNumberValue(String numberValue) { + this.numberValue = numberValue; + } + + public Member[] getMemberValue() { + return this.memberValue; + } + + public void setMemberValue(Member[] memberValue) { + this.memberValue = memberValue; + } + + public String getDatetimeValue() { + return this.datetimeValue; + } + + public void setDatetimeValue(String datetimeValue) { + this.datetimeValue = datetimeValue; + } + + public String getSingleSelectValue() { + return this.singleSelectValue; + } + + public void setSingleSelectValue(String singleSelectValue) { + this.singleSelectValue = singleSelectValue; + } + + public String[] getMultiSelectValue() { + return this.multiSelectValue; + } + + public void setMultiSelectValue(String[] multiSelectValue) { + this.multiSelectValue = multiSelectValue; + } + + public String getTextValue() { + return this.textValue; + } + + public void setTextValue(String textValue) { + this.textValue = textValue; + } + + public static class Builder { + /** + * 自定义字段guid + *

示例值:73b21903-0041-4796-a11e-f8be919a7063 + */ + private String guid; + /** + * 数字类型的自定义字段值,填写一个合法数字的字符串表示,空字符串表示设为空。 + *

示例值:10.23 + */ + private String numberValue; + /** + * 人员类型的自定义字段值。可以设置1个或多个用户的id(遵循member格式,只支持user类型)。当字段设为只不能多选时只能输入一个值。设为空数组表示设为空。 + *

示例值: + */ + private Member[] memberValue; + /** + * 日期类型自定义字段值,可以输入一个表示日期的以毫秒为单位的字符串。设为空字符串表示设为空。 + *

示例值:1698192000000 + */ + private String datetimeValue; + /** + * 单选类型字段值,填写一个字段选项的option_guid。设置为空字符串表示设为空。 + *

示例值:73b21903-0041-4796-a11e-f8be919a7063 + */ + private String singleSelectValue; + /** + * 多选类型字段值,可以填写一个或多个本字段的option_guid。设为空数组表示设为空。 + *

示例值: + */ + private String[] multiSelectValue; + /** + * 文本类型字段值。可以填写最多3000字符。使用空字符串表示设为空。 + *

示例值:文本类型字段值。可以输入一段文本。空字符串表示清空。 + */ + private String textValue; + + /** + * 自定义字段guid + *

示例值:73b21903-0041-4796-a11e-f8be919a7063 + * + * @param guid + * @return + */ + public Builder guid(String guid) { + this.guid = guid; + return this; + } + + + /** + * 数字类型的自定义字段值,填写一个合法数字的字符串表示,空字符串表示设为空。 + *

示例值:10.23 + * + * @param numberValue + * @return + */ + public Builder numberValue(String numberValue) { + this.numberValue = numberValue; + return this; + } + + + /** + * 人员类型的自定义字段值。可以设置1个或多个用户的id(遵循member格式,只支持user类型)。当字段设为只不能多选时只能输入一个值。设为空数组表示设为空。 + *

示例值: + * + * @param memberValue + * @return + */ + public Builder memberValue(Member[] memberValue) { + this.memberValue = memberValue; + return this; + } + + + /** + * 日期类型自定义字段值,可以输入一个表示日期的以毫秒为单位的字符串。设为空字符串表示设为空。 + *

示例值:1698192000000 + * + * @param datetimeValue + * @return + */ + public Builder datetimeValue(String datetimeValue) { + this.datetimeValue = datetimeValue; + return this; + } + + + /** + * 单选类型字段值,填写一个字段选项的option_guid。设置为空字符串表示设为空。 + *

示例值:73b21903-0041-4796-a11e-f8be919a7063 + * + * @param singleSelectValue + * @return + */ + public Builder singleSelectValue(String singleSelectValue) { + this.singleSelectValue = singleSelectValue; + return this; + } + + + /** + * 多选类型字段值,可以填写一个或多个本字段的option_guid。设为空数组表示设为空。 + *

示例值: + * + * @param multiSelectValue + * @return + */ + public Builder multiSelectValue(String[] multiSelectValue) { + this.multiSelectValue = multiSelectValue; + return this; + } + + + /** + * 文本类型字段值。可以填写最多3000字符。使用空字符串表示设为空。 + *

示例值:文本类型字段值。可以输入一段文本。空字符串表示清空。 + * + * @param textValue + * @return + */ + public Builder textValue(String textValue) { + this.textValue = textValue; + return this; + } + + + public InputCustomFieldValue build() { + return new InputCustomFieldValue(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputOption.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputOption.java new file mode 100644 index 000000000..835851dcd --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputOption.java @@ -0,0 +1,222 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class InputOption { + /** + * 选项名称 + *

示例值:高优 + */ + @SerializedName("name") + private String name; + /** + * 颜色索引值,支持0~54中的一个数字。如果不填写,则会随机选一个。 + *

示例值:10 + */ + @SerializedName("color_index") + private Integer colorIndex; + /** + * 要放到某个option之前的option_guid + *

示例值:2bd905f8-ef38-408b-aa1f-2b2ad33b2913 + */ + @SerializedName("insert_before") + private String insertBefore; + /** + * 要放到某个option之后的option_guid + *

示例值:b13adf3c-cad6-4e02-8929-550c112b5633 + */ + @SerializedName("insert_after") + private String insertAfter; + /** + * 是否隐藏 + *

示例值:false + */ + @SerializedName("is_hidden") + private Boolean isHidden; + + // builder 开始 + public InputOption() { + } + + public InputOption(Builder builder) { + /** + * 选项名称 + *

示例值:高优 + */ + this.name = builder.name; + /** + * 颜色索引值,支持0~54中的一个数字。如果不填写,则会随机选一个。 + *

示例值:10 + */ + this.colorIndex = builder.colorIndex; + /** + * 要放到某个option之前的option_guid + *

示例值:2bd905f8-ef38-408b-aa1f-2b2ad33b2913 + */ + this.insertBefore = builder.insertBefore; + /** + * 要放到某个option之后的option_guid + *

示例值:b13adf3c-cad6-4e02-8929-550c112b5633 + */ + this.insertAfter = builder.insertAfter; + /** + * 是否隐藏 + *

示例值:false + */ + this.isHidden = builder.isHidden; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getColorIndex() { + return this.colorIndex; + } + + public void setColorIndex(Integer colorIndex) { + this.colorIndex = colorIndex; + } + + public String getInsertBefore() { + return this.insertBefore; + } + + public void setInsertBefore(String insertBefore) { + this.insertBefore = insertBefore; + } + + public String getInsertAfter() { + return this.insertAfter; + } + + public void setInsertAfter(String insertAfter) { + this.insertAfter = insertAfter; + } + + public Boolean getIsHidden() { + return this.isHidden; + } + + public void setIsHidden(Boolean isHidden) { + this.isHidden = isHidden; + } + + public static class Builder { + /** + * 选项名称 + *

示例值:高优 + */ + private String name; + /** + * 颜色索引值,支持0~54中的一个数字。如果不填写,则会随机选一个。 + *

示例值:10 + */ + private Integer colorIndex; + /** + * 要放到某个option之前的option_guid + *

示例值:2bd905f8-ef38-408b-aa1f-2b2ad33b2913 + */ + private String insertBefore; + /** + * 要放到某个option之后的option_guid + *

示例值:b13adf3c-cad6-4e02-8929-550c112b5633 + */ + private String insertAfter; + /** + * 是否隐藏 + *

示例值:false + */ + private Boolean isHidden; + + /** + * 选项名称 + *

示例值:高优 + * + * @param name + * @return + */ + public Builder name(String name) { + this.name = name; + return this; + } + + + /** + * 颜色索引值,支持0~54中的一个数字。如果不填写,则会随机选一个。 + *

示例值:10 + * + * @param colorIndex + * @return + */ + public Builder colorIndex(Integer colorIndex) { + this.colorIndex = colorIndex; + return this; + } + + + /** + * 要放到某个option之前的option_guid + *

示例值:2bd905f8-ef38-408b-aa1f-2b2ad33b2913 + * + * @param insertBefore + * @return + */ + public Builder insertBefore(String insertBefore) { + this.insertBefore = insertBefore; + return this; + } + + + /** + * 要放到某个option之后的option_guid + *

示例值:b13adf3c-cad6-4e02-8929-550c112b5633 + * + * @param insertAfter + * @return + */ + public Builder insertAfter(String insertAfter) { + this.insertAfter = insertAfter; + return this; + } + + + /** + * 是否隐藏 + *

示例值:false + * + * @param isHidden + * @return + */ + public Builder isHidden(Boolean isHidden) { + this.isHidden = isHidden; + return this; + } + + + public InputOption build() { + return new InputOption(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputSection.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputSection.java new file mode 100644 index 000000000..4a2116daf --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputSection.java @@ -0,0 +1,222 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class InputSection { + /** + * 自定义分组名 + *

示例值:已经审核过的任务 + */ + @SerializedName("name") + private String name; + /** + * 自定义分组的资源类型 + *

示例值:tasklist + */ + @SerializedName("resource_type") + private String resourceType; + /** + * 自定义分组要归属的资源id + *

示例值:cc371766-6584-cf50-a222-c22cd9055004 + */ + @SerializedName("resource_id") + private String resourceId; + /** + * 要将新分组插入到自定义分分组的前面的目标分组的guid。insert_before/insert_after二选一。也可以都不设置。都不设置时表示将新分组查到对应容器的最前面。 + *

示例值:e6e37dcc-f75a-5936-f589-12fb4b5c80c2 + */ + @SerializedName("insert_before") + private String insertBefore; + /** + * 要将新分组插入到自定义分分组的后面的目标分组的guid。insert_before/insert_after二选一。也可以都不设置。都不设置时表示将新分组查到对应容器的最前面。 + *

示例值:e6e37dcc-f75a-5936-f589-12fb4b5c80c2 + */ + @SerializedName("insert_after") + private String insertAfter; + + // builder 开始 + public InputSection() { + } + + public InputSection(Builder builder) { + /** + * 自定义分组名 + *

示例值:已经审核过的任务 + */ + this.name = builder.name; + /** + * 自定义分组的资源类型 + *

示例值:tasklist + */ + this.resourceType = builder.resourceType; + /** + * 自定义分组要归属的资源id + *

示例值:cc371766-6584-cf50-a222-c22cd9055004 + */ + this.resourceId = builder.resourceId; + /** + * 要将新分组插入到自定义分分组的前面的目标分组的guid。insert_before/insert_after二选一。也可以都不设置。都不设置时表示将新分组查到对应容器的最前面。 + *

示例值:e6e37dcc-f75a-5936-f589-12fb4b5c80c2 + */ + this.insertBefore = builder.insertBefore; + /** + * 要将新分组插入到自定义分分组的后面的目标分组的guid。insert_before/insert_after二选一。也可以都不设置。都不设置时表示将新分组查到对应容器的最前面。 + *

示例值:e6e37dcc-f75a-5936-f589-12fb4b5c80c2 + */ + this.insertAfter = builder.insertAfter; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getResourceType() { + return this.resourceType; + } + + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + public String getResourceId() { + return this.resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public String getInsertBefore() { + return this.insertBefore; + } + + public void setInsertBefore(String insertBefore) { + this.insertBefore = insertBefore; + } + + public String getInsertAfter() { + return this.insertAfter; + } + + public void setInsertAfter(String insertAfter) { + this.insertAfter = insertAfter; + } + + public static class Builder { + /** + * 自定义分组名 + *

示例值:已经审核过的任务 + */ + private String name; + /** + * 自定义分组的资源类型 + *

示例值:tasklist + */ + private String resourceType; + /** + * 自定义分组要归属的资源id + *

示例值:cc371766-6584-cf50-a222-c22cd9055004 + */ + private String resourceId; + /** + * 要将新分组插入到自定义分分组的前面的目标分组的guid。insert_before/insert_after二选一。也可以都不设置。都不设置时表示将新分组查到对应容器的最前面。 + *

示例值:e6e37dcc-f75a-5936-f589-12fb4b5c80c2 + */ + private String insertBefore; + /** + * 要将新分组插入到自定义分分组的后面的目标分组的guid。insert_before/insert_after二选一。也可以都不设置。都不设置时表示将新分组查到对应容器的最前面。 + *

示例值:e6e37dcc-f75a-5936-f589-12fb4b5c80c2 + */ + private String insertAfter; + + /** + * 自定义分组名 + *

示例值:已经审核过的任务 + * + * @param name + * @return + */ + public Builder name(String name) { + this.name = name; + return this; + } + + + /** + * 自定义分组的资源类型 + *

示例值:tasklist + * + * @param resourceType + * @return + */ + public Builder resourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + + /** + * 自定义分组要归属的资源id + *

示例值:cc371766-6584-cf50-a222-c22cd9055004 + * + * @param resourceId + * @return + */ + public Builder resourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + + /** + * 要将新分组插入到自定义分分组的前面的目标分组的guid。insert_before/insert_after二选一。也可以都不设置。都不设置时表示将新分组查到对应容器的最前面。 + *

示例值:e6e37dcc-f75a-5936-f589-12fb4b5c80c2 + * + * @param insertBefore + * @return + */ + public Builder insertBefore(String insertBefore) { + this.insertBefore = insertBefore; + return this; + } + + + /** + * 要将新分组插入到自定义分分组的后面的目标分组的guid。insert_before/insert_after二选一。也可以都不设置。都不设置时表示将新分组查到对应容器的最前面。 + *

示例值:e6e37dcc-f75a-5936-f589-12fb4b5c80c2 + * + * @param insertAfter + * @return + */ + public Builder insertAfter(String insertAfter) { + this.insertAfter = insertAfter; + return this; + } + + + public InputSection build() { + return new InputSection(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputTask.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputTask.java new file mode 100644 index 000000000..03338a343 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputTask.java @@ -0,0 +1,666 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class InputTask { + /** + * 任务标题 + *

示例值:针对全年销售进行一次复盘 + */ + @SerializedName("summary") + private String summary; + /** + * 任务描述 + *

示例值:需要事先阅读复盘总结文档 + */ + @SerializedName("description") + private String description; + /** + * 任务截止时间戳(ms),截止时间戳和截止日期选择一个填写。 + *

示例值:1675742789470 + */ + @SerializedName("due") + private Due due; + /** + * 任务关联的第三方平台来源信息 + *

示例值: + */ + @SerializedName("origin") + private Origin origin; + /** + * 调用者可以传入的任意附带到任务上的数据。在获取任务详情时会原样返回。 + *

示例值:dGVzdA== + */ + @SerializedName("extra") + private String extra; + /** + * 任务的完成时刻时间戳(ms) + *

示例值:1675742789470 + */ + @SerializedName("completed_at") + private String completedAt; + /** + * 负责人ID列表 + *

示例值: + */ + @SerializedName("members") + private Member[] members; + /** + * 如果设置,则该任务为“重复任务”。该字段表示了重复任务的重复规则。 + *

示例值:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR + */ + @SerializedName("repeat_rule") + private String repeatRule; + /** + * 如果设置,则将任务设计为“自定义完成”。用户在任务中心点击“完成”时,不会直接完成任务,而是跳转到第三方配置好的地址或者现实自定义提示。 + *

示例值: + */ + @SerializedName("custom_complete") + private CustomComplete customComplete; + /** + * 任务所在清单的信息 + *

示例值: + */ + @SerializedName("tasklists") + private TaskInTasklistInfo[] tasklists; + /** + * 幂等token,如果填写则触发幂等行为。 + *

示例值:daa2237f-8310-4707-a83b-52c8a81e0fb7 + */ + @SerializedName("client_token") + private String clientToken; + /** + * 任务的开始时间(ms) + *

示例值: + */ + @SerializedName("start") + private Start start; + /** + * 任务提醒 + *

示例值: + */ + @SerializedName("reminders") + private Reminder[] reminders; + /** + * 任务的完成模式。1 - 会签任务;2 - 或签任务 + *

示例值:2 + */ + @SerializedName("mode") + private Integer mode; + /** + * 是否是里程碑任务 + *

示例值:false + */ + @SerializedName("is_milestone") + private Boolean isMilestone; + /** + * 自定义字段值 + *

示例值: + */ + @SerializedName("custom_fields") + private InputCustomFieldValue[] customFields; + /** + * 任务的新版云文档来源 + *

示例值: + */ + @SerializedName("docx_source") + private DocxSource docxSource; + + // builder 开始 + public InputTask() { + } + + public InputTask(Builder builder) { + /** + * 任务标题 + *

示例值:针对全年销售进行一次复盘 + */ + this.summary = builder.summary; + /** + * 任务描述 + *

示例值:需要事先阅读复盘总结文档 + */ + this.description = builder.description; + /** + * 任务截止时间戳(ms),截止时间戳和截止日期选择一个填写。 + *

示例值:1675742789470 + */ + this.due = builder.due; + /** + * 任务关联的第三方平台来源信息 + *

示例值: + */ + this.origin = builder.origin; + /** + * 调用者可以传入的任意附带到任务上的数据。在获取任务详情时会原样返回。 + *

示例值:dGVzdA== + */ + this.extra = builder.extra; + /** + * 任务的完成时刻时间戳(ms) + *

示例值:1675742789470 + */ + this.completedAt = builder.completedAt; + /** + * 负责人ID列表 + *

示例值: + */ + this.members = builder.members; + /** + * 如果设置,则该任务为“重复任务”。该字段表示了重复任务的重复规则。 + *

示例值:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR + */ + this.repeatRule = builder.repeatRule; + /** + * 如果设置,则将任务设计为“自定义完成”。用户在任务中心点击“完成”时,不会直接完成任务,而是跳转到第三方配置好的地址或者现实自定义提示。 + *

示例值: + */ + this.customComplete = builder.customComplete; + /** + * 任务所在清单的信息 + *

示例值: + */ + this.tasklists = builder.tasklists; + /** + * 幂等token,如果填写则触发幂等行为。 + *

示例值:daa2237f-8310-4707-a83b-52c8a81e0fb7 + */ + this.clientToken = builder.clientToken; + /** + * 任务的开始时间(ms) + *

示例值: + */ + this.start = builder.start; + /** + * 任务提醒 + *

示例值: + */ + this.reminders = builder.reminders; + /** + * 任务的完成模式。1 - 会签任务;2 - 或签任务 + *

示例值:2 + */ + this.mode = builder.mode; + /** + * 是否是里程碑任务 + *

示例值:false + */ + this.isMilestone = builder.isMilestone; + /** + * 自定义字段值 + *

示例值: + */ + this.customFields = builder.customFields; + /** + * 任务的新版云文档来源 + *

示例值: + */ + this.docxSource = builder.docxSource; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getSummary() { + return this.summary; + } + + public void setSummary(String summary) { + this.summary = summary; + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Due getDue() { + return this.due; + } + + public void setDue(Due due) { + this.due = due; + } + + public Origin getOrigin() { + return this.origin; + } + + public void setOrigin(Origin origin) { + this.origin = origin; + } + + public String getExtra() { + return this.extra; + } + + public void setExtra(String extra) { + this.extra = extra; + } + + public String getCompletedAt() { + return this.completedAt; + } + + public void setCompletedAt(String completedAt) { + this.completedAt = completedAt; + } + + public Member[] getMembers() { + return this.members; + } + + public void setMembers(Member[] members) { + this.members = members; + } + + public String getRepeatRule() { + return this.repeatRule; + } + + public void setRepeatRule(String repeatRule) { + this.repeatRule = repeatRule; + } + + public CustomComplete getCustomComplete() { + return this.customComplete; + } + + public void setCustomComplete(CustomComplete customComplete) { + this.customComplete = customComplete; + } + + public TaskInTasklistInfo[] getTasklists() { + return this.tasklists; + } + + public void setTasklists(TaskInTasklistInfo[] tasklists) { + this.tasklists = tasklists; + } + + public String getClientToken() { + return this.clientToken; + } + + public void setClientToken(String clientToken) { + this.clientToken = clientToken; + } + + public Start getStart() { + return this.start; + } + + public void setStart(Start start) { + this.start = start; + } + + public Reminder[] getReminders() { + return this.reminders; + } + + public void setReminders(Reminder[] reminders) { + this.reminders = reminders; + } + + public Integer getMode() { + return this.mode; + } + + public void setMode(Integer mode) { + this.mode = mode; + } + + public Boolean getIsMilestone() { + return this.isMilestone; + } + + public void setIsMilestone(Boolean isMilestone) { + this.isMilestone = isMilestone; + } + + public InputCustomFieldValue[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(InputCustomFieldValue[] customFields) { + this.customFields = customFields; + } + + public DocxSource getDocxSource() { + return this.docxSource; + } + + public void setDocxSource(DocxSource docxSource) { + this.docxSource = docxSource; + } + + public static class Builder { + /** + * 任务标题 + *

示例值:针对全年销售进行一次复盘 + */ + private String summary; + /** + * 任务描述 + *

示例值:需要事先阅读复盘总结文档 + */ + private String description; + /** + * 任务截止时间戳(ms),截止时间戳和截止日期选择一个填写。 + *

示例值:1675742789470 + */ + private Due due; + /** + * 任务关联的第三方平台来源信息 + *

示例值: + */ + private Origin origin; + /** + * 调用者可以传入的任意附带到任务上的数据。在获取任务详情时会原样返回。 + *

示例值:dGVzdA== + */ + private String extra; + /** + * 任务的完成时刻时间戳(ms) + *

示例值:1675742789470 + */ + private String completedAt; + /** + * 负责人ID列表 + *

示例值: + */ + private Member[] members; + /** + * 如果设置,则该任务为“重复任务”。该字段表示了重复任务的重复规则。 + *

示例值:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR + */ + private String repeatRule; + /** + * 如果设置,则将任务设计为“自定义完成”。用户在任务中心点击“完成”时,不会直接完成任务,而是跳转到第三方配置好的地址或者现实自定义提示。 + *

示例值: + */ + private CustomComplete customComplete; + /** + * 任务所在清单的信息 + *

示例值: + */ + private TaskInTasklistInfo[] tasklists; + /** + * 幂等token,如果填写则触发幂等行为。 + *

示例值:daa2237f-8310-4707-a83b-52c8a81e0fb7 + */ + private String clientToken; + /** + * 任务的开始时间(ms) + *

示例值: + */ + private Start start; + /** + * 任务提醒 + *

示例值: + */ + private Reminder[] reminders; + /** + * 任务的完成模式。1 - 会签任务;2 - 或签任务 + *

示例值:2 + */ + private Integer mode; + /** + * 是否是里程碑任务 + *

示例值:false + */ + private Boolean isMilestone; + /** + * 自定义字段值 + *

示例值: + */ + private InputCustomFieldValue[] customFields; + /** + * 任务的新版云文档来源 + *

示例值: + */ + private DocxSource docxSource; + + /** + * 任务标题 + *

示例值:针对全年销售进行一次复盘 + * + * @param summary + * @return + */ + public Builder summary(String summary) { + this.summary = summary; + return this; + } + + + /** + * 任务描述 + *

示例值:需要事先阅读复盘总结文档 + * + * @param description + * @return + */ + public Builder description(String description) { + this.description = description; + return this; + } + + + /** + * 任务截止时间戳(ms),截止时间戳和截止日期选择一个填写。 + *

示例值:1675742789470 + * + * @param due + * @return + */ + public Builder due(Due due) { + this.due = due; + return this; + } + + + /** + * 任务关联的第三方平台来源信息 + *

示例值: + * + * @param origin + * @return + */ + public Builder origin(Origin origin) { + this.origin = origin; + return this; + } + + + /** + * 调用者可以传入的任意附带到任务上的数据。在获取任务详情时会原样返回。 + *

示例值:dGVzdA== + * + * @param extra + * @return + */ + public Builder extra(String extra) { + this.extra = extra; + return this; + } + + + /** + * 任务的完成时刻时间戳(ms) + *

示例值:1675742789470 + * + * @param completedAt + * @return + */ + public Builder completedAt(String completedAt) { + this.completedAt = completedAt; + return this; + } + + + /** + * 负责人ID列表 + *

示例值: + * + * @param members + * @return + */ + public Builder members(Member[] members) { + this.members = members; + return this; + } + + + /** + * 如果设置,则该任务为“重复任务”。该字段表示了重复任务的重复规则。 + *

示例值:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR + * + * @param repeatRule + * @return + */ + public Builder repeatRule(String repeatRule) { + this.repeatRule = repeatRule; + return this; + } + + + /** + * 如果设置,则将任务设计为“自定义完成”。用户在任务中心点击“完成”时,不会直接完成任务,而是跳转到第三方配置好的地址或者现实自定义提示。 + *

示例值: + * + * @param customComplete + * @return + */ + public Builder customComplete(CustomComplete customComplete) { + this.customComplete = customComplete; + return this; + } + + + /** + * 任务所在清单的信息 + *

示例值: + * + * @param tasklists + * @return + */ + public Builder tasklists(TaskInTasklistInfo[] tasklists) { + this.tasklists = tasklists; + return this; + } + + + /** + * 幂等token,如果填写则触发幂等行为。 + *

示例值:daa2237f-8310-4707-a83b-52c8a81e0fb7 + * + * @param clientToken + * @return + */ + public Builder clientToken(String clientToken) { + this.clientToken = clientToken; + return this; + } + + + /** + * 任务的开始时间(ms) + *

示例值: + * + * @param start + * @return + */ + public Builder start(Start start) { + this.start = start; + return this; + } + + + /** + * 任务提醒 + *

示例值: + * + * @param reminders + * @return + */ + public Builder reminders(Reminder[] reminders) { + this.reminders = reminders; + return this; + } + + + /** + * 任务的完成模式。1 - 会签任务;2 - 或签任务 + *

示例值:2 + * + * @param mode + * @return + */ + public Builder mode(Integer mode) { + this.mode = mode; + return this; + } + + + /** + * 是否是里程碑任务 + *

示例值:false + * + * @param isMilestone + * @return + */ + public Builder isMilestone(Boolean isMilestone) { + this.isMilestone = isMilestone; + return this; + } + + + /** + * 自定义字段值 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(InputCustomFieldValue[] customFields) { + this.customFields = customFields; + return this; + } + + + /** + * 任务的新版云文档来源 + *

示例值: + * + * @param docxSource + * @return + */ + public Builder docxSource(DocxSource docxSource) { + this.docxSource = docxSource; + return this; + } + + + public InputTask build() { + return new InputTask(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputTasklist.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputTasklist.java new file mode 100644 index 000000000..c5091b211 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/InputTasklist.java @@ -0,0 +1,185 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class InputTasklist { + /** + * 清单名称 + *

示例值:年会工作任务清单 + */ + @SerializedName("name") + private String name; + /** + * 幂等token,如果提供则实现幂等行为 + *

示例值:daa2237f-8310-4707-a83b-52c8a81e0fb7 + */ + @SerializedName("client_token") + private String clientToken; + /** + * 清单的成员列表 + *

示例值: + */ + @SerializedName("members") + private Member[] members; + /** + * 清单所有者 + *

示例值: + */ + @SerializedName("owner") + private Member owner; + + // builder 开始 + public InputTasklist() { + } + + public InputTasklist(Builder builder) { + /** + * 清单名称 + *

示例值:年会工作任务清单 + */ + this.name = builder.name; + /** + * 幂等token,如果提供则实现幂等行为 + *

示例值:daa2237f-8310-4707-a83b-52c8a81e0fb7 + */ + this.clientToken = builder.clientToken; + /** + * 清单的成员列表 + *

示例值: + */ + this.members = builder.members; + /** + * 清单所有者 + *

示例值: + */ + this.owner = builder.owner; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getClientToken() { + return this.clientToken; + } + + public void setClientToken(String clientToken) { + this.clientToken = clientToken; + } + + public Member[] getMembers() { + return this.members; + } + + public void setMembers(Member[] members) { + this.members = members; + } + + public Member getOwner() { + return this.owner; + } + + public void setOwner(Member owner) { + this.owner = owner; + } + + public static class Builder { + /** + * 清单名称 + *

示例值:年会工作任务清单 + */ + private String name; + /** + * 幂等token,如果提供则实现幂等行为 + *

示例值:daa2237f-8310-4707-a83b-52c8a81e0fb7 + */ + private String clientToken; + /** + * 清单的成员列表 + *

示例值: + */ + private Member[] members; + /** + * 清单所有者 + *

示例值: + */ + private Member owner; + + /** + * 清单名称 + *

示例值:年会工作任务清单 + * + * @param name + * @return + */ + public Builder name(String name) { + this.name = name; + return this; + } + + + /** + * 幂等token,如果提供则实现幂等行为 + *

示例值:daa2237f-8310-4707-a83b-52c8a81e0fb7 + * + * @param clientToken + * @return + */ + public Builder clientToken(String clientToken) { + this.clientToken = clientToken; + return this; + } + + + /** + * 清单的成员列表 + *

示例值: + * + * @param members + * @return + */ + public Builder members(Member[] members) { + this.members = members; + return this; + } + + + /** + * 清单所有者 + *

示例值: + * + * @param owner + * @return + */ + public Builder owner(Member owner) { + this.owner = owner; + return this; + } + + + public InputTasklist build() { + return new InputTasklist(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListAttachmentReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListAttachmentReq.java new file mode 100644 index 000000000..d69f1cbf9 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListAttachmentReq.java @@ -0,0 +1,208 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Query; + +public class ListAttachmentReq { + /** + * 分页大小 + *

示例值:50 + */ + @Query + @SerializedName("page_size") + private Integer pageSize; + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + @Query + @SerializedName("page_token") + private String pageToken; + /** + * 附件归属的资源类型 + *

示例值:task + */ + @Query + @SerializedName("resource_type") + private String resourceType; + /** + * 附件归属资源的id,配合resource_type使用。例如希望获取任务的附件,需要设置 resource_type为task, resource_id为任务的全局唯一ID + *

示例值:9842501a-9f47-4ff5-a622-d319eeecb97f + */ + @Query + @SerializedName("resource_id") + private String resourceId; + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + + // builder 开始 + public ListAttachmentReq() { + } + + public ListAttachmentReq(Builder builder) { + /** + * 分页大小 + *

示例值:50 + */ + this.pageSize = builder.pageSize; + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + this.pageToken = builder.pageToken; + /** + * 附件归属的资源类型 + *

示例值:task + */ + this.resourceType = builder.resourceType; + /** + * 附件归属资源的id,配合resource_type使用。例如希望获取任务的附件,需要设置 resource_type为task, resource_id为任务的全局唯一ID + *

示例值:9842501a-9f47-4ff5-a622-d319eeecb97f + */ + this.resourceId = builder.resourceId; + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Integer getPageSize() { + return this.pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public String getResourceType() { + return this.resourceType; + } + + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + public String getResourceId() { + return this.resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public static class Builder { + private Integer pageSize; // 分页大小 + private String pageToken; // 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + private String resourceType; // 附件归属的资源类型 + private String resourceId; // 附件归属资源的id,配合resource_type使用。例如希望获取任务的附件,需要设置 resource_type为task, resource_id为任务的全局唯一ID + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + + + /** + * 分页大小 + *

示例值:50 + * + * @param pageSize + * @return + */ + public Builder pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + * + * @param pageToken + * @return + */ + public Builder pageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + + /** + * 附件归属的资源类型 + *

示例值:task + * + * @param resourceType + * @return + */ + public Builder resourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + + /** + * 附件归属资源的id,配合resource_type使用。例如希望获取任务的附件,需要设置 resource_type为task, resource_id为任务的全局唯一ID + *

示例值:9842501a-9f47-4ff5-a622-d319eeecb97f + * + * @param resourceId + * @return + */ + public Builder resourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + public ListAttachmentReq build() { + return new ListAttachmentReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListAttachmentResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListAttachmentResp.java new file mode 100644 index 000000000..3abf57527 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListAttachmentResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class ListAttachmentResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListAttachmentRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListAttachmentRespBody.java new file mode 100644 index 000000000..07b9d92ff --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListAttachmentRespBody.java @@ -0,0 +1,62 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class ListAttachmentRespBody { + /** + * 附件列表 + *

示例值: + */ + @SerializedName("items") + private Attachment[] items; + /** + * 获取下一页的分页标记,无更多数据时返回空 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + @SerializedName("page_token") + private String pageToken; + /** + * 是否有更多数据 + *

示例值:true + */ + @SerializedName("has_more") + private Boolean hasMore; + + public Attachment[] getItems() { + return this.items; + } + + public void setItems(Attachment[] items) { + this.items = items; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public Boolean getHasMore() { + return this.hasMore; + } + + public void setHasMore(Boolean hasMore) { + this.hasMore = hasMore; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListCommentReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListCommentReq.java new file mode 100644 index 000000000..846de0bf0 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListCommentReq.java @@ -0,0 +1,254 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Query; + +public class ListCommentReq { + /** + * 分页大小 + *

示例值:50 + */ + @Query + @SerializedName("page_size") + private Integer pageSize; + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + @Query + @SerializedName("page_token") + private String pageToken; + /** + * 要获取评论列表的资源类型 + *

示例值:task + */ + @Query + @SerializedName("resource_type") + private String resourceType; + /** + * 要获取评论的资源ID。例如要获取任务的评论列表,此处应该填写任务全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + @Query + @SerializedName("resource_id") + private String resourceId; + /** + * 返回数据的排序方式 + *

示例值:asc + */ + @Query + @SerializedName("direction") + private String direction; + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + + // builder 开始 + public ListCommentReq() { + } + + public ListCommentReq(Builder builder) { + /** + * 分页大小 + *

示例值:50 + */ + this.pageSize = builder.pageSize; + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + this.pageToken = builder.pageToken; + /** + * 要获取评论列表的资源类型 + *

示例值:task + */ + this.resourceType = builder.resourceType; + /** + * 要获取评论的资源ID。例如要获取任务的评论列表,此处应该填写任务全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + this.resourceId = builder.resourceId; + /** + * 返回数据的排序方式 + *

示例值:asc + */ + this.direction = builder.direction; + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Integer getPageSize() { + return this.pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public String getResourceType() { + return this.resourceType; + } + + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + public String getResourceId() { + return this.resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public String getDirection() { + return this.direction; + } + + public void setDirection(String direction) { + this.direction = direction; + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public static class Builder { + private Integer pageSize; // 分页大小 + private String pageToken; // 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + private String resourceType; // 要获取评论列表的资源类型 + private String resourceId; // 要获取评论的资源ID。例如要获取任务的评论列表,此处应该填写任务全局唯一ID + private String direction; // 返回数据的排序方式 + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + + + /** + * 分页大小 + *

示例值:50 + * + * @param pageSize + * @return + */ + public Builder pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + * + * @param pageToken + * @return + */ + public Builder pageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + + /** + * 要获取评论列表的资源类型 + *

示例值:task + * + * @param resourceType + * @return + */ + public Builder resourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + + /** + * 要获取评论的资源ID。例如要获取任务的评论列表,此处应该填写任务全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + * + * @param resourceId + * @return + */ + public Builder resourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + + /** + * 返回数据的排序方式 + *

示例值:asc + * + * @param direction + * @return + */ + public Builder direction(String direction) { + this.direction = direction; + return this; + } + + /** + * 返回数据的排序方式 + *

示例值:asc + * + * @param direction {@link com.lark.oapi.service.task.v2.enums.ListCommentDirectionEnum} + * @return + */ + public Builder direction(com.lark.oapi.service.task.v2.enums.ListCommentDirectionEnum direction) { + this.direction = direction.getValue(); + return this; + } + + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + public ListCommentReq build() { + return new ListCommentReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListCommentResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListCommentResp.java new file mode 100644 index 000000000..3c33d49fb --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListCommentResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class ListCommentResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListCommentRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListCommentRespBody.java new file mode 100644 index 000000000..aeac77ea8 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListCommentRespBody.java @@ -0,0 +1,62 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class ListCommentRespBody { + /** + * 评论列表数据 + *

示例值: + */ + @SerializedName("items") + private Comment[] items; + /** + * 用于获取下一页的分页标记,当has_more为false时为空 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + @SerializedName("page_token") + private String pageToken; + /** + * 是否还有更多数据 + *

示例值:true + */ + @SerializedName("has_more") + private Boolean hasMore; + + public Comment[] getItems() { + return this.items; + } + + public void setItems(Comment[] items) { + this.items = items; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public Boolean getHasMore() { + return this.hasMore; + } + + public void setHasMore(Boolean hasMore) { + this.hasMore = hasMore; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListCustomFieldReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListCustomFieldReq.java new file mode 100644 index 000000000..06d06599f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListCustomFieldReq.java @@ -0,0 +1,220 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Query; + +public class ListCustomFieldReq { + /** + * 分页大小 + *

示例值:50 + */ + @Query + @SerializedName("page_size") + private Integer pageSize; + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + @Query + @SerializedName("page_token") + private String pageToken; + /** + * 用户ID格式,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 资源类型,如提供表示仅查询特定资源下的自定义字段。目前只支持tasklist。 + *

示例值:tasklist + */ + @Query + @SerializedName("resource_type") + private String resourceType; + /** + * 要查询自定义字段的归属resource_id + *

示例值:5ffbe0ca-6600-41e0-a634-2b38cbcf13b8 + */ + @Query + @SerializedName("resource_id") + private String resourceId; + + // builder 开始 + public ListCustomFieldReq() { + } + + public ListCustomFieldReq(Builder builder) { + /** + * 分页大小 + *

示例值:50 + */ + this.pageSize = builder.pageSize; + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + this.pageToken = builder.pageToken; + /** + * 用户ID格式,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 资源类型,如提供表示仅查询特定资源下的自定义字段。目前只支持tasklist。 + *

示例值:tasklist + */ + this.resourceType = builder.resourceType; + /** + * 要查询自定义字段的归属resource_id + *

示例值:5ffbe0ca-6600-41e0-a634-2b38cbcf13b8 + */ + this.resourceId = builder.resourceId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Integer getPageSize() { + return this.pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getResourceType() { + return this.resourceType; + } + + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + public String getResourceId() { + return this.resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public static class Builder { + private Integer pageSize; // 分页大小 + private String pageToken; // 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + private String userIdType; // 用户ID格式,支持open_id, user_id, union_id + private String resourceType; // 资源类型,如提供表示仅查询特定资源下的自定义字段。目前只支持tasklist。 + private String resourceId; // 要查询自定义字段的归属resource_id + + + /** + * 分页大小 + *

示例值:50 + * + * @param pageSize + * @return + */ + public Builder pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + * + * @param pageToken + * @return + */ + public Builder pageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + + /** + * 用户ID格式,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 用户ID格式,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType {@link com.lark.oapi.service.task.v2.enums.ListCustomFieldUserIdTypeEnum} + * @return + */ + public Builder userIdType(com.lark.oapi.service.task.v2.enums.ListCustomFieldUserIdTypeEnum userIdType) { + this.userIdType = userIdType.getValue(); + return this; + } + + + /** + * 资源类型,如提供表示仅查询特定资源下的自定义字段。目前只支持tasklist。 + *

示例值:tasklist + * + * @param resourceType + * @return + */ + public Builder resourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + + /** + * 要查询自定义字段的归属resource_id + *

示例值:5ffbe0ca-6600-41e0-a634-2b38cbcf13b8 + * + * @param resourceId + * @return + */ + public Builder resourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + public ListCustomFieldReq build() { + return new ListCustomFieldReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListCustomFieldResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListCustomFieldResp.java new file mode 100644 index 000000000..6115f8e0a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListCustomFieldResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class ListCustomFieldResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListCustomFieldRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListCustomFieldRespBody.java new file mode 100644 index 000000000..7a65a9676 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListCustomFieldRespBody.java @@ -0,0 +1,62 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class ListCustomFieldRespBody { + /** + * 返回的自定义字段列表 + *

示例值: + */ + @SerializedName("items") + private CustomField[] items; + /** + * 用于获取下一页数据的page_token + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + @SerializedName("page_token") + private String pageToken; + /** + * 是否有下一页的数据 + *

示例值:false + */ + @SerializedName("has_more") + private Boolean hasMore; + + public CustomField[] getItems() { + return this.items; + } + + public void setItems(CustomField[] items) { + this.items = items; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public Boolean getHasMore() { + return this.hasMore; + } + + public void setHasMore(Boolean hasMore) { + this.hasMore = hasMore; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListSectionReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListSectionReq.java new file mode 100644 index 000000000..3096e93af --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListSectionReq.java @@ -0,0 +1,208 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Query; + +public class ListSectionReq { + /** + * 分页大小 + *

示例值:50 + */ + @Query + @SerializedName("page_size") + private Integer pageSize; + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + @Query + @SerializedName("page_token") + private String pageToken; + /** + * 自定义分组所属的资源类型。支持"my_tasks"(我负责的)和"tasklist"(清单)。当使用"tasklist"时,需要用resource_id提供清单GUID。 + *

示例值:tasklist + */ + @Query + @SerializedName("resource_type") + private String resourceType; + /** + * 如`resource_type`为"tasklist",这里需要填写要列取自定义分组的清单的GUID。 + *

示例值:caef228f-2342-23c1-c36d-91186414dc64 + */ + @Query + @SerializedName("resource_id") + private String resourceId; + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + + // builder 开始 + public ListSectionReq() { + } + + public ListSectionReq(Builder builder) { + /** + * 分页大小 + *

示例值:50 + */ + this.pageSize = builder.pageSize; + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + this.pageToken = builder.pageToken; + /** + * 自定义分组所属的资源类型。支持"my_tasks"(我负责的)和"tasklist"(清单)。当使用"tasklist"时,需要用resource_id提供清单GUID。 + *

示例值:tasklist + */ + this.resourceType = builder.resourceType; + /** + * 如`resource_type`为"tasklist",这里需要填写要列取自定义分组的清单的GUID。 + *

示例值:caef228f-2342-23c1-c36d-91186414dc64 + */ + this.resourceId = builder.resourceId; + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Integer getPageSize() { + return this.pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public String getResourceType() { + return this.resourceType; + } + + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + public String getResourceId() { + return this.resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public static class Builder { + private Integer pageSize; // 分页大小 + private String pageToken; // 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + private String resourceType; // 自定义分组所属的资源类型。支持"my_tasks"(我负责的)和"tasklist"(清单)。当使用"tasklist"时,需要用resource_id提供清单GUID。 + private String resourceId; // 如`resource_type`为"tasklist",这里需要填写要列取自定义分组的清单的GUID。 + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + + + /** + * 分页大小 + *

示例值:50 + * + * @param pageSize + * @return + */ + public Builder pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + * + * @param pageToken + * @return + */ + public Builder pageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + + /** + * 自定义分组所属的资源类型。支持"my_tasks"(我负责的)和"tasklist"(清单)。当使用"tasklist"时,需要用resource_id提供清单GUID。 + *

示例值:tasklist + * + * @param resourceType + * @return + */ + public Builder resourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + + /** + * 如`resource_type`为"tasklist",这里需要填写要列取自定义分组的清单的GUID。 + *

示例值:caef228f-2342-23c1-c36d-91186414dc64 + * + * @param resourceId + * @return + */ + public Builder resourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + public ListSectionReq build() { + return new ListSectionReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListSectionResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListSectionResp.java new file mode 100644 index 000000000..01b0bca14 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListSectionResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class ListSectionResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListSectionRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListSectionRespBody.java new file mode 100644 index 000000000..ab0055f6c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListSectionRespBody.java @@ -0,0 +1,62 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class ListSectionRespBody { + /** + * 自定义分组的摘要列表 + *

示例值: + */ + @SerializedName("items") + private SectionSummary[] items; + /** + * 获取下一页数据的分页标记,没有更多数据时返回空 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + @SerializedName("page_token") + private String pageToken; + /** + * 是否有更多数据 + *

示例值:true + */ + @SerializedName("has_more") + private Boolean hasMore; + + public SectionSummary[] getItems() { + return this.items; + } + + public void setItems(SectionSummary[] items) { + this.items = items; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public Boolean getHasMore() { + return this.hasMore; + } + + public void setHasMore(Boolean hasMore) { + this.hasMore = hasMore; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTaskReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTaskReq.java new file mode 100644 index 000000000..40e3c5971 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTaskReq.java @@ -0,0 +1,208 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Query; + +public class ListTaskReq { + /** + * 每页的任务数量 + *

示例值:50 + */ + @Query + @SerializedName("page_size") + private Integer pageSize; + /** + * 分页标记。第一次请求不填该参数,表示从头开始查询;查询结果若还有更多数据时会同时返回新的 page_token。使用page_token重新调用本接口可以获取下一页数据。 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + @Query + @SerializedName("page_token") + private String pageToken; + /** + * 是否按任务完成进行过滤。不填写表示不过滤。 + *

示例值:true + */ + @Query + @SerializedName("completed") + private Boolean completed; + /** + * 查询任务的范围 + *

示例值:my_tasks + */ + @Query + @SerializedName("type") + private String type; + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + + // builder 开始 + public ListTaskReq() { + } + + public ListTaskReq(Builder builder) { + /** + * 每页的任务数量 + *

示例值:50 + */ + this.pageSize = builder.pageSize; + /** + * 分页标记。第一次请求不填该参数,表示从头开始查询;查询结果若还有更多数据时会同时返回新的 page_token。使用page_token重新调用本接口可以获取下一页数据。 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + this.pageToken = builder.pageToken; + /** + * 是否按任务完成进行过滤。不填写表示不过滤。 + *

示例值:true + */ + this.completed = builder.completed; + /** + * 查询任务的范围 + *

示例值:my_tasks + */ + this.type = builder.type; + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Integer getPageSize() { + return this.pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public Boolean getCompleted() { + return this.completed; + } + + public void setCompleted(Boolean completed) { + this.completed = completed; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public static class Builder { + private Integer pageSize; // 每页的任务数量 + private String pageToken; // 分页标记。第一次请求不填该参数,表示从头开始查询;查询结果若还有更多数据时会同时返回新的 page_token。使用page_token重新调用本接口可以获取下一页数据。 + private Boolean completed; // 是否按任务完成进行过滤。不填写表示不过滤。 + private String type; // 查询任务的范围 + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + + + /** + * 每页的任务数量 + *

示例值:50 + * + * @param pageSize + * @return + */ + public Builder pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + + /** + * 分页标记。第一次请求不填该参数,表示从头开始查询;查询结果若还有更多数据时会同时返回新的 page_token。使用page_token重新调用本接口可以获取下一页数据。 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + * + * @param pageToken + * @return + */ + public Builder pageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + + /** + * 是否按任务完成进行过滤。不填写表示不过滤。 + *

示例值:true + * + * @param completed + * @return + */ + public Builder completed(Boolean completed) { + this.completed = completed; + return this; + } + + + /** + * 查询任务的范围 + *

示例值:my_tasks + * + * @param type + * @return + */ + public Builder type(String type) { + this.type = type; + return this; + } + + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + public ListTaskReq build() { + return new ListTaskReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTaskResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTaskResp.java new file mode 100644 index 000000000..6e9a0ecce --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTaskResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class ListTaskResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTaskRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTaskRespBody.java new file mode 100644 index 000000000..ef7d3f27f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTaskRespBody.java @@ -0,0 +1,62 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class ListTaskRespBody { + /** + * 返回的任务列表 + *

示例值: + */ + @SerializedName("items") + private Task[] items; + /** + * 获取下一次分页的分页标记 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + @SerializedName("page_token") + private String pageToken; + /** + * 是否有更多数据 + *

示例值:true + */ + @SerializedName("has_more") + private Boolean hasMore; + + public Task[] getItems() { + return this.items; + } + + public void setItems(Task[] items) { + this.items = items; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public Boolean getHasMore() { + return this.hasMore; + } + + public void setHasMore(Boolean hasMore) { + this.hasMore = hasMore; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTaskSubtaskReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTaskSubtaskReq.java new file mode 100644 index 000000000..0d55a3969 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTaskSubtaskReq.java @@ -0,0 +1,171 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class ListTaskSubtaskReq { + /** + * 分页大小 + *

示例值:50 + */ + @Query + @SerializedName("page_size") + private Integer pageSize; + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + @Query + @SerializedName("page_token") + private String pageToken; + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 父任务的全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + @Path + @SerializedName("task_guid") + private String taskGuid; + + // builder 开始 + public ListTaskSubtaskReq() { + } + + public ListTaskSubtaskReq(Builder builder) { + /** + * 分页大小 + *

示例值:50 + */ + this.pageSize = builder.pageSize; + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + this.pageToken = builder.pageToken; + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 父任务的全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + this.taskGuid = builder.taskGuid; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Integer getPageSize() { + return this.pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getTaskGuid() { + return this.taskGuid; + } + + public void setTaskGuid(String taskGuid) { + this.taskGuid = taskGuid; + } + + public static class Builder { + private Integer pageSize; // 分页大小 + private String pageToken; // 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private String taskGuid; // 父任务的全局唯一ID + + /** + * 分页大小 + *

示例值:50 + * + * @param pageSize + * @return + */ + public Builder pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + * + * @param pageToken + * @return + */ + public Builder pageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 父任务的全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + * + * @param taskGuid + * @return + */ + public Builder taskGuid(String taskGuid) { + this.taskGuid = taskGuid; + return this; + } + + public ListTaskSubtaskReq build() { + return new ListTaskSubtaskReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTaskSubtaskResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTaskSubtaskResp.java new file mode 100644 index 000000000..d7e68b321 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTaskSubtaskResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class ListTaskSubtaskResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTaskSubtaskRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTaskSubtaskRespBody.java new file mode 100644 index 000000000..257cf7901 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTaskSubtaskRespBody.java @@ -0,0 +1,62 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class ListTaskSubtaskRespBody { + /** + * 子任务列表 + *

示例值: + */ + @SerializedName("items") + private Task[] items; + /** + * 用于返回下一个分页的token + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + @SerializedName("page_token") + private String pageToken; + /** + * 是否还有下一页数据。 + *

示例值:true + */ + @SerializedName("has_more") + private Boolean hasMore; + + public Task[] getItems() { + return this.items; + } + + public void setItems(Task[] items) { + this.items = items; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public Boolean getHasMore() { + return this.hasMore; + } + + public void setHasMore(Boolean hasMore) { + this.hasMore = hasMore; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTasklistActivitySubscriptionReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTasklistActivitySubscriptionReq.java new file mode 100644 index 000000000..481903072 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTasklistActivitySubscriptionReq.java @@ -0,0 +1,150 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class ListTasklistActivitySubscriptionReq { + /** + * 返回结果的最大数量 + *

示例值:50 + */ + @Query + @SerializedName("limit") + private Integer limit; + /** + * 用户ID类型 + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 清单GUID + *

示例值:d19e3a2a-edc0-4e4e-b7cc-950e162b53ae + */ + @Path + @SerializedName("tasklist_guid") + private String tasklistGuid; + + // builder 开始 + public ListTasklistActivitySubscriptionReq() { + } + + public ListTasklistActivitySubscriptionReq(Builder builder) { + /** + * 返回结果的最大数量 + *

示例值:50 + */ + this.limit = builder.limit; + /** + * 用户ID类型 + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 清单GUID + *

示例值:d19e3a2a-edc0-4e4e-b7cc-950e162b53ae + */ + this.tasklistGuid = builder.tasklistGuid; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Integer getLimit() { + return this.limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getTasklistGuid() { + return this.tasklistGuid; + } + + public void setTasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + } + + public static class Builder { + private Integer limit; // 返回结果的最大数量 + private String userIdType; // 用户ID类型 + private String tasklistGuid; // 清单GUID + + /** + * 返回结果的最大数量 + *

示例值:50 + * + * @param limit + * @return + */ + public Builder limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * 用户ID类型 + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 用户ID类型 + *

示例值:open_id + * + * @param userIdType {@link com.lark.oapi.service.task.v2.enums.ListTasklistActivitySubscriptionUserIdTypeEnum} + * @return + */ + public Builder userIdType(com.lark.oapi.service.task.v2.enums.ListTasklistActivitySubscriptionUserIdTypeEnum userIdType) { + this.userIdType = userIdType.getValue(); + return this; + } + + /** + * 清单GUID + *

示例值:d19e3a2a-edc0-4e4e-b7cc-950e162b53ae + * + * @param tasklistGuid + * @return + */ + public Builder tasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + return this; + } + + public ListTasklistActivitySubscriptionReq build() { + return new ListTasklistActivitySubscriptionReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTasklistActivitySubscriptionResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTasklistActivitySubscriptionResp.java new file mode 100644 index 000000000..038093a00 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTasklistActivitySubscriptionResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class ListTasklistActivitySubscriptionResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTasklistActivitySubscriptionRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTasklistActivitySubscriptionRespBody.java new file mode 100644 index 000000000..f16160afa --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTasklistActivitySubscriptionRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class ListTasklistActivitySubscriptionRespBody { + /** + * 清单的动态订阅数据 + *

示例值: + */ + @SerializedName("items") + private TasklistActivitySubscription[] items; + + public TasklistActivitySubscription[] getItems() { + return this.items; + } + + public void setItems(TasklistActivitySubscription[] items) { + this.items = items; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTasklistReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTasklistReq.java new file mode 100644 index 000000000..f809e2147 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTasklistReq.java @@ -0,0 +1,140 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Query; + +public class ListTasklistReq { + /** + * 每页返回的清单数量 + *

示例值:50 + */ + @Query + @SerializedName("page_size") + private Integer pageSize; + /** + * 分页标记。第一次请求不填该参数,表示从头开始查询;查询结果若还有更多数据时会同时返回新的 page_token。使用page_token重新调用本接口可以获取下一页数据。 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + @Query + @SerializedName("page_token") + private String pageToken; + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + + // builder 开始 + public ListTasklistReq() { + } + + public ListTasklistReq(Builder builder) { + /** + * 每页返回的清单数量 + *

示例值:50 + */ + this.pageSize = builder.pageSize; + /** + * 分页标记。第一次请求不填该参数,表示从头开始查询;查询结果若还有更多数据时会同时返回新的 page_token。使用page_token重新调用本接口可以获取下一页数据。 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + this.pageToken = builder.pageToken; + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Integer getPageSize() { + return this.pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public static class Builder { + private Integer pageSize; // 每页返回的清单数量 + private String pageToken; // 分页标记。第一次请求不填该参数,表示从头开始查询;查询结果若还有更多数据时会同时返回新的 page_token。使用page_token重新调用本接口可以获取下一页数据。 + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + + + /** + * 每页返回的清单数量 + *

示例值:50 + * + * @param pageSize + * @return + */ + public Builder pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + + /** + * 分页标记。第一次请求不填该参数,表示从头开始查询;查询结果若还有更多数据时会同时返回新的 page_token。使用page_token重新调用本接口可以获取下一页数据。 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + * + * @param pageToken + * @return + */ + public Builder pageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + public ListTasklistReq build() { + return new ListTasklistReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTasklistResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTasklistResp.java new file mode 100644 index 000000000..ace1e1d3e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTasklistResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class ListTasklistResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTasklistRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTasklistRespBody.java new file mode 100644 index 000000000..aaef307ac --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/ListTasklistRespBody.java @@ -0,0 +1,62 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class ListTasklistRespBody { + /** + * 清单数据列表 + *

示例值: + */ + @SerializedName("items") + private Tasklist[] items; + /** + * 用于获取下一页的分页标记 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + @SerializedName("page_token") + private String pageToken; + /** + * 是否有更多数据 + *

示例值:true + */ + @SerializedName("has_more") + private Boolean hasMore; + + public Tasklist[] getItems() { + return this.items; + } + + public void setItems(Tasklist[] items) { + this.items = items; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public Boolean getHasMore() { + return this.hasMore; + } + + public void setHasMore(Boolean hasMore) { + this.hasMore = hasMore; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Member.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Member.java new file mode 100644 index 000000000..406558633 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Member.java @@ -0,0 +1,185 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Member { + /** + * 表示member的id + *

示例值:ou_2cefb2f014f8d0c6c2d2eb7bafb0e54f + */ + @SerializedName("id") + private String id; + /** + * 成员的类型 + *

示例值:user + */ + @SerializedName("type") + private String type; + /** + * 成员角色 + *

示例值:editor + */ + @SerializedName("role") + private String role; + /** + * 成员名称 + *

示例值:张明德(明德) + */ + @SerializedName("name") + private String name; + + // builder 开始 + public Member() { + } + + public Member(Builder builder) { + /** + * 表示member的id + *

示例值:ou_2cefb2f014f8d0c6c2d2eb7bafb0e54f + */ + this.id = builder.id; + /** + * 成员的类型 + *

示例值:user + */ + this.type = builder.type; + /** + * 成员角色 + *

示例值:editor + */ + this.role = builder.role; + /** + * 成员名称 + *

示例值:张明德(明德) + */ + this.name = builder.name; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getRole() { + return this.role; + } + + public void setRole(String role) { + this.role = role; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public static class Builder { + /** + * 表示member的id + *

示例值:ou_2cefb2f014f8d0c6c2d2eb7bafb0e54f + */ + private String id; + /** + * 成员的类型 + *

示例值:user + */ + private String type; + /** + * 成员角色 + *

示例值:editor + */ + private String role; + /** + * 成员名称 + *

示例值:张明德(明德) + */ + private String name; + + /** + * 表示member的id + *

示例值:ou_2cefb2f014f8d0c6c2d2eb7bafb0e54f + * + * @param id + * @return + */ + public Builder id(String id) { + this.id = id; + return this; + } + + + /** + * 成员的类型 + *

示例值:user + * + * @param type + * @return + */ + public Builder type(String type) { + this.type = type; + return this; + } + + + /** + * 成员角色 + *

示例值:editor + * + * @param role + * @return + */ + public Builder role(String role) { + this.role = role; + return this; + } + + + /** + * 成员名称 + *

示例值:张明德(明德) + * + * @param name + * @return + */ + public Builder name(String name) { + this.name = name; + return this; + } + + + public Member build() { + return new Member(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/MemberSetting.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/MemberSetting.java new file mode 100644 index 000000000..610a95910 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/MemberSetting.java @@ -0,0 +1,74 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class MemberSetting { + /** + * 是否支持多选 + *

示例值:true + */ + @SerializedName("multi") + private Boolean multi; + + // builder 开始 + public MemberSetting() { + } + + public MemberSetting(Builder builder) { + /** + * 是否支持多选 + *

示例值:true + */ + this.multi = builder.multi; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Boolean getMulti() { + return this.multi; + } + + public void setMulti(Boolean multi) { + this.multi = multi; + } + + public static class Builder { + /** + * 是否支持多选 + *

示例值:true + */ + private Boolean multi; + + /** + * 是否支持多选 + *

示例值:true + * + * @param multi + * @return + */ + public Builder multi(Boolean multi) { + this.multi = multi; + return this; + } + + + public MemberSetting build() { + return new MemberSetting(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/NumberSetting.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/NumberSetting.java new file mode 100644 index 000000000..00584c54d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/NumberSetting.java @@ -0,0 +1,258 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class NumberSetting { + /** + * 数字展示的格式 + *

示例值:normal + */ + @SerializedName("format") + private String format; + /** + * 自定义符号。只有`format`设为custom时才会生效。 + *

示例值:自定义符号 + */ + @SerializedName("custom_symbol") + private String customSymbol; + /** + * 自定义符号显示的位置。 + *

示例值:left + */ + @SerializedName("custom_symbol_position") + private String customSymbolPosition; + /** + * 分隔符样式 + *

示例值:thousand + */ + @SerializedName("separator") + private String separator; + /** + * 保留小数位数。输入的数字值的小数位数如果比该设置多,多余的位数将被四舍五入后舍弃。如果`format`为"percentage",表示变为百分数之后的小数位数。 + *

示例值:2 + */ + @SerializedName("decimal_count") + private Integer decimalCount; + + // builder 开始 + public NumberSetting() { + } + + public NumberSetting(Builder builder) { + /** + * 数字展示的格式 + *

示例值:normal + */ + this.format = builder.format; + /** + * 自定义符号。只有`format`设为custom时才会生效。 + *

示例值:自定义符号 + */ + this.customSymbol = builder.customSymbol; + /** + * 自定义符号显示的位置。 + *

示例值:left + */ + this.customSymbolPosition = builder.customSymbolPosition; + /** + * 分隔符样式 + *

示例值:thousand + */ + this.separator = builder.separator; + /** + * 保留小数位数。输入的数字值的小数位数如果比该设置多,多余的位数将被四舍五入后舍弃。如果`format`为"percentage",表示变为百分数之后的小数位数。 + *

示例值:2 + */ + this.decimalCount = builder.decimalCount; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getFormat() { + return this.format; + } + + public void setFormat(String format) { + this.format = format; + } + + public String getCustomSymbol() { + return this.customSymbol; + } + + public void setCustomSymbol(String customSymbol) { + this.customSymbol = customSymbol; + } + + public String getCustomSymbolPosition() { + return this.customSymbolPosition; + } + + public void setCustomSymbolPosition(String customSymbolPosition) { + this.customSymbolPosition = customSymbolPosition; + } + + public String getSeparator() { + return this.separator; + } + + public void setSeparator(String separator) { + this.separator = separator; + } + + public Integer getDecimalCount() { + return this.decimalCount; + } + + public void setDecimalCount(Integer decimalCount) { + this.decimalCount = decimalCount; + } + + public static class Builder { + /** + * 数字展示的格式 + *

示例值:normal + */ + private String format; + /** + * 自定义符号。只有`format`设为custom时才会生效。 + *

示例值:自定义符号 + */ + private String customSymbol; + /** + * 自定义符号显示的位置。 + *

示例值:left + */ + private String customSymbolPosition; + /** + * 分隔符样式 + *

示例值:thousand + */ + private String separator; + /** + * 保留小数位数。输入的数字值的小数位数如果比该设置多,多余的位数将被四舍五入后舍弃。如果`format`为"percentage",表示变为百分数之后的小数位数。 + *

示例值:2 + */ + private Integer decimalCount; + + /** + * 数字展示的格式 + *

示例值:normal + * + * @param format + * @return + */ + public Builder format(String format) { + this.format = format; + return this; + } + + /** + * 数字展示的格式 + *

示例值:normal + * + * @param format {@link com.lark.oapi.service.task.v2.enums.NumberSettingFormatEnum} + * @return + */ + public Builder format(com.lark.oapi.service.task.v2.enums.NumberSettingFormatEnum format) { + this.format = format.getValue(); + return this; + } + + + /** + * 自定义符号。只有`format`设为custom时才会生效。 + *

示例值:自定义符号 + * + * @param customSymbol + * @return + */ + public Builder customSymbol(String customSymbol) { + this.customSymbol = customSymbol; + return this; + } + + + /** + * 自定义符号显示的位置。 + *

示例值:left + * + * @param customSymbolPosition + * @return + */ + public Builder customSymbolPosition(String customSymbolPosition) { + this.customSymbolPosition = customSymbolPosition; + return this; + } + + /** + * 自定义符号显示的位置。 + *

示例值:left + * + * @param customSymbolPosition {@link com.lark.oapi.service.task.v2.enums.NumberSettingCustomSymbolPositionEnum} + * @return + */ + public Builder customSymbolPosition(com.lark.oapi.service.task.v2.enums.NumberSettingCustomSymbolPositionEnum customSymbolPosition) { + this.customSymbolPosition = customSymbolPosition.getValue(); + return this; + } + + + /** + * 分隔符样式 + *

示例值:thousand + * + * @param separator + * @return + */ + public Builder separator(String separator) { + this.separator = separator; + return this; + } + + /** + * 分隔符样式 + *

示例值:thousand + * + * @param separator {@link com.lark.oapi.service.task.v2.enums.NumberSettingSeparatorEnum} + * @return + */ + public Builder separator(com.lark.oapi.service.task.v2.enums.NumberSettingSeparatorEnum separator) { + this.separator = separator.getValue(); + return this; + } + + + /** + * 保留小数位数。输入的数字值的小数位数如果比该设置多,多余的位数将被四舍五入后舍弃。如果`format`为"percentage",表示变为百分数之后的小数位数。 + *

示例值:2 + * + * @param decimalCount + * @return + */ + public Builder decimalCount(Integer decimalCount) { + this.decimalCount = decimalCount; + return this; + } + + + public NumberSetting build() { + return new NumberSetting(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Option.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Option.java new file mode 100644 index 000000000..5d4e9470d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Option.java @@ -0,0 +1,185 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Option { + /** + * 选项的GUID + *

示例值:4216f79b-3fda-4dc6-a0c4-a16022e47152 + */ + @SerializedName("guid") + private String guid; + /** + * 选项名称,不能为空,最大50个字符 + *

示例值:高优 + */ + @SerializedName("name") + private String name; + /** + * 选项的颜色索引值,可以是0~54中的一个数字。如果不填写则会随机选一个。 + *

示例值:1 + */ + @SerializedName("color_index") + private Integer colorIndex; + /** + * 选项是否隐藏。隐藏后的选项在界面不可见,也不可以再通过openapi将字段值设为该选项。 + *

示例值:false + */ + @SerializedName("is_hidden") + private Boolean isHidden; + + // builder 开始 + public Option() { + } + + public Option(Builder builder) { + /** + * 选项的GUID + *

示例值:4216f79b-3fda-4dc6-a0c4-a16022e47152 + */ + this.guid = builder.guid; + /** + * 选项名称,不能为空,最大50个字符 + *

示例值:高优 + */ + this.name = builder.name; + /** + * 选项的颜色索引值,可以是0~54中的一个数字。如果不填写则会随机选一个。 + *

示例值:1 + */ + this.colorIndex = builder.colorIndex; + /** + * 选项是否隐藏。隐藏后的选项在界面不可见,也不可以再通过openapi将字段值设为该选项。 + *

示例值:false + */ + this.isHidden = builder.isHidden; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getGuid() { + return this.guid; + } + + public void setGuid(String guid) { + this.guid = guid; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getColorIndex() { + return this.colorIndex; + } + + public void setColorIndex(Integer colorIndex) { + this.colorIndex = colorIndex; + } + + public Boolean getIsHidden() { + return this.isHidden; + } + + public void setIsHidden(Boolean isHidden) { + this.isHidden = isHidden; + } + + public static class Builder { + /** + * 选项的GUID + *

示例值:4216f79b-3fda-4dc6-a0c4-a16022e47152 + */ + private String guid; + /** + * 选项名称,不能为空,最大50个字符 + *

示例值:高优 + */ + private String name; + /** + * 选项的颜色索引值,可以是0~54中的一个数字。如果不填写则会随机选一个。 + *

示例值:1 + */ + private Integer colorIndex; + /** + * 选项是否隐藏。隐藏后的选项在界面不可见,也不可以再通过openapi将字段值设为该选项。 + *

示例值:false + */ + private Boolean isHidden; + + /** + * 选项的GUID + *

示例值:4216f79b-3fda-4dc6-a0c4-a16022e47152 + * + * @param guid + * @return + */ + public Builder guid(String guid) { + this.guid = guid; + return this; + } + + + /** + * 选项名称,不能为空,最大50个字符 + *

示例值:高优 + * + * @param name + * @return + */ + public Builder name(String name) { + this.name = name; + return this; + } + + + /** + * 选项的颜色索引值,可以是0~54中的一个数字。如果不填写则会随机选一个。 + *

示例值:1 + * + * @param colorIndex + * @return + */ + public Builder colorIndex(Integer colorIndex) { + this.colorIndex = colorIndex; + return this; + } + + + /** + * 选项是否隐藏。隐藏后的选项在界面不可见,也不可以再通过openapi将字段值设为该选项。 + *

示例值:false + * + * @param isHidden + * @return + */ + public Builder isHidden(Boolean isHidden) { + this.isHidden = isHidden; + return this; + } + + + public Option build() { + return new Option(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Origin.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Origin.java new file mode 100644 index 000000000..9e40b04c3 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Origin.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Origin { + /** + * 任务导入来源的名称,用于在任务中心详情页展示。需提供多语言版本。 + *

示例值: + */ + @SerializedName("platform_i18n_name") + private I18nText platformI18nName; + /** + * 任务关联的来源平台详情页链接 + *

示例值: + */ + @SerializedName("href") + private Href href; + + // builder 开始 + public Origin() { + } + + public Origin(Builder builder) { + /** + * 任务导入来源的名称,用于在任务中心详情页展示。需提供多语言版本。 + *

示例值: + */ + this.platformI18nName = builder.platformI18nName; + /** + * 任务关联的来源平台详情页链接 + *

示例值: + */ + this.href = builder.href; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public I18nText getPlatformI18nName() { + return this.platformI18nName; + } + + public void setPlatformI18nName(I18nText platformI18nName) { + this.platformI18nName = platformI18nName; + } + + public Href getHref() { + return this.href; + } + + public void setHref(Href href) { + this.href = href; + } + + public static class Builder { + /** + * 任务导入来源的名称,用于在任务中心详情页展示。需提供多语言版本。 + *

示例值: + */ + private I18nText platformI18nName; + /** + * 任务关联的来源平台详情页链接 + *

示例值: + */ + private Href href; + + /** + * 任务导入来源的名称,用于在任务中心详情页展示。需提供多语言版本。 + *

示例值: + * + * @param platformI18nName + * @return + */ + public Builder platformI18nName(I18nText platformI18nName) { + this.platformI18nName = platformI18nName; + return this; + } + + + /** + * 任务关联的来源平台详情页链接 + *

示例值: + * + * @param href + * @return + */ + public Builder href(Href href) { + this.href = href; + return this; + } + + + public Origin build() { + return new Origin(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCommentReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCommentReq.java new file mode 100644 index 000000000..4d27ab90a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCommentReq.java @@ -0,0 +1,133 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class PatchCommentReq { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 要更新的评论ID + *

示例值:7198104824246747156 + */ + @Path + @SerializedName("comment_id") + private String commentId; + @Body + private PatchCommentReqBody body; + + // builder 开始 + public PatchCommentReq() { + } + + public PatchCommentReq(Builder builder) { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 要更新的评论ID + *

示例值:7198104824246747156 + */ + this.commentId = builder.commentId; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getCommentId() { + return this.commentId; + } + + public void setCommentId(String commentId) { + this.commentId = commentId; + } + + public PatchCommentReqBody getPatchCommentReqBody() { + return this.body; + } + + public void setPatchCommentReqBody(PatchCommentReqBody body) { + this.body = body; + } + + public static class Builder { + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private String commentId; // 要更新的评论ID + private PatchCommentReqBody body; + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 要更新的评论ID + *

示例值:7198104824246747156 + * + * @param commentId + * @return + */ + public Builder commentId(String commentId) { + this.commentId = commentId; + return this; + } + + public PatchCommentReqBody getPatchCommentReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder patchCommentReqBody(PatchCommentReqBody body) { + this.body = body; + return this; + } + + public PatchCommentReq build() { + return new PatchCommentReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCommentReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCommentReqBody.java new file mode 100644 index 000000000..d54e26df6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCommentReqBody.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PatchCommentReqBody { + /** + * 要更新的评论数据,支持更新content, md_content + *

示例值: + */ + @SerializedName("comment") + private InputComment comment; + /** + * 要更新的字段 + *

示例值: + */ + @SerializedName("update_fields") + private String[] updateFields; + + // builder 开始 + public PatchCommentReqBody() { + } + + public PatchCommentReqBody(Builder builder) { + /** + * 要更新的评论数据,支持更新content, md_content + *

示例值: + */ + this.comment = builder.comment; + /** + * 要更新的字段 + *

示例值: + */ + this.updateFields = builder.updateFields; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public InputComment getComment() { + return this.comment; + } + + public void setComment(InputComment comment) { + this.comment = comment; + } + + public String[] getUpdateFields() { + return this.updateFields; + } + + public void setUpdateFields(String[] updateFields) { + this.updateFields = updateFields; + } + + public static class Builder { + /** + * 要更新的评论数据,支持更新content, md_content + *

示例值: + */ + private InputComment comment; + /** + * 要更新的字段 + *

示例值: + */ + private String[] updateFields; + + /** + * 要更新的评论数据,支持更新content, md_content + *

示例值: + * + * @param comment + * @return + */ + public Builder comment(InputComment comment) { + this.comment = comment; + return this; + } + + + /** + * 要更新的字段 + *

示例值: + * + * @param updateFields + * @return + */ + public Builder updateFields(String[] updateFields) { + this.updateFields = updateFields; + return this; + } + + + public PatchCommentReqBody build() { + return new PatchCommentReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCommentResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCommentResp.java new file mode 100644 index 000000000..dcec501f3 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCommentResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class PatchCommentResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCommentRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCommentRespBody.java new file mode 100644 index 000000000..92967ca0f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCommentRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PatchCommentRespBody { + /** + * 更新后的评论 + *

示例值: + */ + @SerializedName("comment") + private Comment comment; + + public Comment getComment() { + return this.comment; + } + + public void setComment(Comment comment) { + this.comment = comment; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldOptionReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldOptionReq.java new file mode 100644 index 000000000..0e15d7c1a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldOptionReq.java @@ -0,0 +1,133 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Path; + +public class PatchCustomFieldOptionReq { + /** + * 要更新的选项的自定义字段GUID + *

示例值:b13adf3c-cad6-4e02-8929-550c112b5633 + */ + @Path + @SerializedName("custom_field_guid") + private String customFieldGuid; + /** + * 要更新的选项的GUID + *

示例值:b13adf3c-cad6-4e02-8929-550c112b5633 + */ + @Path + @SerializedName("option_guid") + private String optionGuid; + @Body + private PatchCustomFieldOptionReqBody body; + + // builder 开始 + public PatchCustomFieldOptionReq() { + } + + public PatchCustomFieldOptionReq(Builder builder) { + /** + * 要更新的选项的自定义字段GUID + *

示例值:b13adf3c-cad6-4e02-8929-550c112b5633 + */ + this.customFieldGuid = builder.customFieldGuid; + /** + * 要更新的选项的GUID + *

示例值:b13adf3c-cad6-4e02-8929-550c112b5633 + */ + this.optionGuid = builder.optionGuid; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getCustomFieldGuid() { + return this.customFieldGuid; + } + + public void setCustomFieldGuid(String customFieldGuid) { + this.customFieldGuid = customFieldGuid; + } + + public String getOptionGuid() { + return this.optionGuid; + } + + public void setOptionGuid(String optionGuid) { + this.optionGuid = optionGuid; + } + + public PatchCustomFieldOptionReqBody getPatchCustomFieldOptionReqBody() { + return this.body; + } + + public void setPatchCustomFieldOptionReqBody(PatchCustomFieldOptionReqBody body) { + this.body = body; + } + + public static class Builder { + + private String customFieldGuid; // 要更新的选项的自定义字段GUID + private String optionGuid; // 要更新的选项的GUID + private PatchCustomFieldOptionReqBody body; + + /** + * 要更新的选项的自定义字段GUID + *

示例值:b13adf3c-cad6-4e02-8929-550c112b5633 + * + * @param customFieldGuid + * @return + */ + public Builder customFieldGuid(String customFieldGuid) { + this.customFieldGuid = customFieldGuid; + return this; + } + + /** + * 要更新的选项的GUID + *

示例值:b13adf3c-cad6-4e02-8929-550c112b5633 + * + * @param optionGuid + * @return + */ + public Builder optionGuid(String optionGuid) { + this.optionGuid = optionGuid; + return this; + } + + public PatchCustomFieldOptionReqBody getPatchCustomFieldOptionReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder patchCustomFieldOptionReqBody(PatchCustomFieldOptionReqBody body) { + this.body = body; + return this; + } + + public PatchCustomFieldOptionReq build() { + return new PatchCustomFieldOptionReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldOptionReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldOptionReqBody.java new file mode 100644 index 000000000..dde7d187a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldOptionReqBody.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PatchCustomFieldOptionReqBody { + /** + * 要更新的option数据 + *

示例值: + */ + @SerializedName("option") + private InputOption option; + /** + * 要更新的字段名,支持name,color,is_hidden,insert_before,insert_after + *

示例值: + */ + @SerializedName("update_fields") + private String[] updateFields; + + // builder 开始 + public PatchCustomFieldOptionReqBody() { + } + + public PatchCustomFieldOptionReqBody(Builder builder) { + /** + * 要更新的option数据 + *

示例值: + */ + this.option = builder.option; + /** + * 要更新的字段名,支持name,color,is_hidden,insert_before,insert_after + *

示例值: + */ + this.updateFields = builder.updateFields; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public InputOption getOption() { + return this.option; + } + + public void setOption(InputOption option) { + this.option = option; + } + + public String[] getUpdateFields() { + return this.updateFields; + } + + public void setUpdateFields(String[] updateFields) { + this.updateFields = updateFields; + } + + public static class Builder { + /** + * 要更新的option数据 + *

示例值: + */ + private InputOption option; + /** + * 要更新的字段名,支持name,color,is_hidden,insert_before,insert_after + *

示例值: + */ + private String[] updateFields; + + /** + * 要更新的option数据 + *

示例值: + * + * @param option + * @return + */ + public Builder option(InputOption option) { + this.option = option; + return this; + } + + + /** + * 要更新的字段名,支持name,color,is_hidden,insert_before,insert_after + *

示例值: + * + * @param updateFields + * @return + */ + public Builder updateFields(String[] updateFields) { + this.updateFields = updateFields; + return this; + } + + + public PatchCustomFieldOptionReqBody build() { + return new PatchCustomFieldOptionReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldOptionResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldOptionResp.java new file mode 100644 index 000000000..30ddf2335 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldOptionResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class PatchCustomFieldOptionResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldOptionRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldOptionRespBody.java new file mode 100644 index 000000000..da545f97b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldOptionRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PatchCustomFieldOptionRespBody { + /** + * 更新后的option数据 + *

示例值: + */ + @SerializedName("option") + private Option option; + + public Option getOption() { + return this.option; + } + + public void setOption(Option option) { + this.option = option; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldReq.java new file mode 100644 index 000000000..e7af5d38c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldReq.java @@ -0,0 +1,145 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class PatchCustomFieldReq { + /** + * 用户ID格式 + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 自定义字段GUID + *

示例值:5ffbe0ca-6600-41e0-a634-2b38cbcf13b8 + */ + @Path + @SerializedName("custom_field_guid") + private String customFieldGuid; + @Body + private PatchCustomFieldReqBody body; + + // builder 开始 + public PatchCustomFieldReq() { + } + + public PatchCustomFieldReq(Builder builder) { + /** + * 用户ID格式 + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 自定义字段GUID + *

示例值:5ffbe0ca-6600-41e0-a634-2b38cbcf13b8 + */ + this.customFieldGuid = builder.customFieldGuid; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getCustomFieldGuid() { + return this.customFieldGuid; + } + + public void setCustomFieldGuid(String customFieldGuid) { + this.customFieldGuid = customFieldGuid; + } + + public PatchCustomFieldReqBody getPatchCustomFieldReqBody() { + return this.body; + } + + public void setPatchCustomFieldReqBody(PatchCustomFieldReqBody body) { + this.body = body; + } + + public static class Builder { + private String userIdType; // 用户ID格式 + private String customFieldGuid; // 自定义字段GUID + private PatchCustomFieldReqBody body; + + /** + * 用户ID格式 + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 用户ID格式 + *

示例值:open_id + * + * @param userIdType {@link com.lark.oapi.service.task.v2.enums.PatchCustomFieldUserIdTypeEnum} + * @return + */ + public Builder userIdType(com.lark.oapi.service.task.v2.enums.PatchCustomFieldUserIdTypeEnum userIdType) { + this.userIdType = userIdType.getValue(); + return this; + } + + /** + * 自定义字段GUID + *

示例值:5ffbe0ca-6600-41e0-a634-2b38cbcf13b8 + * + * @param customFieldGuid + * @return + */ + public Builder customFieldGuid(String customFieldGuid) { + this.customFieldGuid = customFieldGuid; + return this; + } + + public PatchCustomFieldReqBody getPatchCustomFieldReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder patchCustomFieldReqBody(PatchCustomFieldReqBody body) { + this.body = body; + return this; + } + + public PatchCustomFieldReq build() { + return new PatchCustomFieldReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldReqBody.java new file mode 100644 index 000000000..94e82c85b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldReqBody.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PatchCustomFieldReqBody { + /** + * 要修改的自定义字段数据 + *

示例值: + */ + @SerializedName("custom_field") + private InputCustomField customField; + /** + * 要修改的自定义字段类型,支持name, member_setting, number_setting, datetime_setting, single_select_setting, multi_select_setting + *

示例值: + */ + @SerializedName("update_fields") + private String[] updateFields; + + // builder 开始 + public PatchCustomFieldReqBody() { + } + + public PatchCustomFieldReqBody(Builder builder) { + /** + * 要修改的自定义字段数据 + *

示例值: + */ + this.customField = builder.customField; + /** + * 要修改的自定义字段类型,支持name, member_setting, number_setting, datetime_setting, single_select_setting, multi_select_setting + *

示例值: + */ + this.updateFields = builder.updateFields; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public InputCustomField getCustomField() { + return this.customField; + } + + public void setCustomField(InputCustomField customField) { + this.customField = customField; + } + + public String[] getUpdateFields() { + return this.updateFields; + } + + public void setUpdateFields(String[] updateFields) { + this.updateFields = updateFields; + } + + public static class Builder { + /** + * 要修改的自定义字段数据 + *

示例值: + */ + private InputCustomField customField; + /** + * 要修改的自定义字段类型,支持name, member_setting, number_setting, datetime_setting, single_select_setting, multi_select_setting + *

示例值: + */ + private String[] updateFields; + + /** + * 要修改的自定义字段数据 + *

示例值: + * + * @param customField + * @return + */ + public Builder customField(InputCustomField customField) { + this.customField = customField; + return this; + } + + + /** + * 要修改的自定义字段类型,支持name, member_setting, number_setting, datetime_setting, single_select_setting, multi_select_setting + *

示例值: + * + * @param updateFields + * @return + */ + public Builder updateFields(String[] updateFields) { + this.updateFields = updateFields; + return this; + } + + + public PatchCustomFieldReqBody build() { + return new PatchCustomFieldReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldResp.java new file mode 100644 index 000000000..ec80ac051 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class PatchCustomFieldResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldRespBody.java new file mode 100644 index 000000000..e114b7efa --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchCustomFieldRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PatchCustomFieldRespBody { + /** + * 修改后的自定义字段设置 + *

示例值: + */ + @SerializedName("custom_field") + private CustomField customField; + + public CustomField getCustomField() { + return this.customField; + } + + public void setCustomField(CustomField customField) { + this.customField = customField; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchSectionReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchSectionReq.java new file mode 100644 index 000000000..c3802268f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchSectionReq.java @@ -0,0 +1,133 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class PatchSectionReq { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 要更新的自定义分组GUID + *

示例值:9842501a-9f47-4ff5-a622-d319eeecb97f + */ + @Path + @SerializedName("section_guid") + private String sectionGuid; + @Body + private PatchSectionReqBody body; + + // builder 开始 + public PatchSectionReq() { + } + + public PatchSectionReq(Builder builder) { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 要更新的自定义分组GUID + *

示例值:9842501a-9f47-4ff5-a622-d319eeecb97f + */ + this.sectionGuid = builder.sectionGuid; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getSectionGuid() { + return this.sectionGuid; + } + + public void setSectionGuid(String sectionGuid) { + this.sectionGuid = sectionGuid; + } + + public PatchSectionReqBody getPatchSectionReqBody() { + return this.body; + } + + public void setPatchSectionReqBody(PatchSectionReqBody body) { + this.body = body; + } + + public static class Builder { + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private String sectionGuid; // 要更新的自定义分组GUID + private PatchSectionReqBody body; + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 要更新的自定义分组GUID + *

示例值:9842501a-9f47-4ff5-a622-d319eeecb97f + * + * @param sectionGuid + * @return + */ + public Builder sectionGuid(String sectionGuid) { + this.sectionGuid = sectionGuid; + return this; + } + + public PatchSectionReqBody getPatchSectionReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder patchSectionReqBody(PatchSectionReqBody body) { + this.body = body; + return this; + } + + public PatchSectionReq build() { + return new PatchSectionReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchSectionReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchSectionReqBody.java new file mode 100644 index 000000000..d922badb4 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchSectionReqBody.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PatchSectionReqBody { + /** + * 要更新的自定义分组的数据,仅支持name, insert_after, insert_before + *

示例值: + */ + @SerializedName("section") + private InputSection section; + /** + * 要更新的字段名 + *

示例值: + */ + @SerializedName("update_fields") + private String[] updateFields; + + // builder 开始 + public PatchSectionReqBody() { + } + + public PatchSectionReqBody(Builder builder) { + /** + * 要更新的自定义分组的数据,仅支持name, insert_after, insert_before + *

示例值: + */ + this.section = builder.section; + /** + * 要更新的字段名 + *

示例值: + */ + this.updateFields = builder.updateFields; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public InputSection getSection() { + return this.section; + } + + public void setSection(InputSection section) { + this.section = section; + } + + public String[] getUpdateFields() { + return this.updateFields; + } + + public void setUpdateFields(String[] updateFields) { + this.updateFields = updateFields; + } + + public static class Builder { + /** + * 要更新的自定义分组的数据,仅支持name, insert_after, insert_before + *

示例值: + */ + private InputSection section; + /** + * 要更新的字段名 + *

示例值: + */ + private String[] updateFields; + + /** + * 要更新的自定义分组的数据,仅支持name, insert_after, insert_before + *

示例值: + * + * @param section + * @return + */ + public Builder section(InputSection section) { + this.section = section; + return this; + } + + + /** + * 要更新的字段名 + *

示例值: + * + * @param updateFields + * @return + */ + public Builder updateFields(String[] updateFields) { + this.updateFields = updateFields; + return this; + } + + + public PatchSectionReqBody build() { + return new PatchSectionReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchSectionResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchSectionResp.java new file mode 100644 index 000000000..58a2353be --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchSectionResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class PatchSectionResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchSectionRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchSectionRespBody.java new file mode 100644 index 000000000..7048f9e68 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchSectionRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PatchSectionRespBody { + /** + * 更新后的自定义分组 + *

示例值: + */ + @SerializedName("section") + private Section section; + + public Section getSection() { + return this.section; + } + + public void setSection(Section section) { + this.section = section; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTaskReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTaskReq.java new file mode 100644 index 000000000..3463ec5af --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTaskReq.java @@ -0,0 +1,133 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class PatchTaskReq { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 要更新的任务全局唯一ID + *

示例值:e297ddff-06ca-4166-b917-4ce57cd3a7a0 + */ + @Path + @SerializedName("task_guid") + private String taskGuid; + @Body + private PatchTaskReqBody body; + + // builder 开始 + public PatchTaskReq() { + } + + public PatchTaskReq(Builder builder) { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 要更新的任务全局唯一ID + *

示例值:e297ddff-06ca-4166-b917-4ce57cd3a7a0 + */ + this.taskGuid = builder.taskGuid; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getTaskGuid() { + return this.taskGuid; + } + + public void setTaskGuid(String taskGuid) { + this.taskGuid = taskGuid; + } + + public PatchTaskReqBody getPatchTaskReqBody() { + return this.body; + } + + public void setPatchTaskReqBody(PatchTaskReqBody body) { + this.body = body; + } + + public static class Builder { + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private String taskGuid; // 要更新的任务全局唯一ID + private PatchTaskReqBody body; + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 要更新的任务全局唯一ID + *

示例值:e297ddff-06ca-4166-b917-4ce57cd3a7a0 + * + * @param taskGuid + * @return + */ + public Builder taskGuid(String taskGuid) { + this.taskGuid = taskGuid; + return this; + } + + public PatchTaskReqBody getPatchTaskReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder patchTaskReqBody(PatchTaskReqBody body) { + this.body = body; + return this; + } + + public PatchTaskReq build() { + return new PatchTaskReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTaskReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTaskReqBody.java new file mode 100644 index 000000000..7bb4afeed --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTaskReqBody.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PatchTaskReqBody { + /** + * 要更新的任务数据,只需要写明要更新的字段 + *

示例值: + */ + @SerializedName("task") + private InputTask task; + /** + * 要更新的字段名称。支持summary, description, due, start, completed_at, extra, repeat_rule, custom_complete, mode, is_milestone, custom_fields。 + *

示例值: + */ + @SerializedName("update_fields") + private String[] updateFields; + + // builder 开始 + public PatchTaskReqBody() { + } + + public PatchTaskReqBody(Builder builder) { + /** + * 要更新的任务数据,只需要写明要更新的字段 + *

示例值: + */ + this.task = builder.task; + /** + * 要更新的字段名称。支持summary, description, due, start, completed_at, extra, repeat_rule, custom_complete, mode, is_milestone, custom_fields。 + *

示例值: + */ + this.updateFields = builder.updateFields; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public InputTask getTask() { + return this.task; + } + + public void setTask(InputTask task) { + this.task = task; + } + + public String[] getUpdateFields() { + return this.updateFields; + } + + public void setUpdateFields(String[] updateFields) { + this.updateFields = updateFields; + } + + public static class Builder { + /** + * 要更新的任务数据,只需要写明要更新的字段 + *

示例值: + */ + private InputTask task; + /** + * 要更新的字段名称。支持summary, description, due, start, completed_at, extra, repeat_rule, custom_complete, mode, is_milestone, custom_fields。 + *

示例值: + */ + private String[] updateFields; + + /** + * 要更新的任务数据,只需要写明要更新的字段 + *

示例值: + * + * @param task + * @return + */ + public Builder task(InputTask task) { + this.task = task; + return this; + } + + + /** + * 要更新的字段名称。支持summary, description, due, start, completed_at, extra, repeat_rule, custom_complete, mode, is_milestone, custom_fields。 + *

示例值: + * + * @param updateFields + * @return + */ + public Builder updateFields(String[] updateFields) { + this.updateFields = updateFields; + return this; + } + + + public PatchTaskReqBody build() { + return new PatchTaskReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTaskResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTaskResp.java new file mode 100644 index 000000000..dd0823ddc --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTaskResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class PatchTaskResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTaskRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTaskRespBody.java new file mode 100644 index 000000000..69dc12ad2 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTaskRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PatchTaskRespBody { + /** + * 更新后的任务 + *

示例值: + */ + @SerializedName("task") + private Task task; + + public Task getTask() { + return this.task; + } + + public void setTask(Task task) { + this.task = task; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistActivitySubscriptionReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistActivitySubscriptionReq.java new file mode 100644 index 000000000..1302e637c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistActivitySubscriptionReq.java @@ -0,0 +1,178 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class PatchTasklistActivitySubscriptionReq { + /** + * 用户ID类型 + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 清单GUID + *

示例值:33991879-704f-444f-81d7-55a6aa7be80c + */ + @Path + @SerializedName("tasklist_guid") + private String tasklistGuid; + /** + * 要更新的动态订阅GUID + *

示例值:f5ca6747-5ac3-422e-a97e-972c1b2c24f3 + */ + @Path + @SerializedName("activity_subscription_guid") + private String activitySubscriptionGuid; + @Body + private PatchTasklistActivitySubscriptionReqBody body; + + // builder 开始 + public PatchTasklistActivitySubscriptionReq() { + } + + public PatchTasklistActivitySubscriptionReq(Builder builder) { + /** + * 用户ID类型 + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 清单GUID + *

示例值:33991879-704f-444f-81d7-55a6aa7be80c + */ + this.tasklistGuid = builder.tasklistGuid; + /** + * 要更新的动态订阅GUID + *

示例值:f5ca6747-5ac3-422e-a97e-972c1b2c24f3 + */ + this.activitySubscriptionGuid = builder.activitySubscriptionGuid; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getTasklistGuid() { + return this.tasklistGuid; + } + + public void setTasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + } + + public String getActivitySubscriptionGuid() { + return this.activitySubscriptionGuid; + } + + public void setActivitySubscriptionGuid(String activitySubscriptionGuid) { + this.activitySubscriptionGuid = activitySubscriptionGuid; + } + + public PatchTasklistActivitySubscriptionReqBody getPatchTasklistActivitySubscriptionReqBody() { + return this.body; + } + + public void setPatchTasklistActivitySubscriptionReqBody(PatchTasklistActivitySubscriptionReqBody body) { + this.body = body; + } + + public static class Builder { + private String userIdType; // 用户ID类型 + private String tasklistGuid; // 清单GUID + private String activitySubscriptionGuid; // 要更新的动态订阅GUID + private PatchTasklistActivitySubscriptionReqBody body; + + /** + * 用户ID类型 + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 用户ID类型 + *

示例值:open_id + * + * @param userIdType {@link com.lark.oapi.service.task.v2.enums.PatchTasklistActivitySubscriptionUserIdTypeEnum} + * @return + */ + public Builder userIdType(com.lark.oapi.service.task.v2.enums.PatchTasklistActivitySubscriptionUserIdTypeEnum userIdType) { + this.userIdType = userIdType.getValue(); + return this; + } + + /** + * 清单GUID + *

示例值:33991879-704f-444f-81d7-55a6aa7be80c + * + * @param tasklistGuid + * @return + */ + public Builder tasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + return this; + } + + /** + * 要更新的动态订阅GUID + *

示例值:f5ca6747-5ac3-422e-a97e-972c1b2c24f3 + * + * @param activitySubscriptionGuid + * @return + */ + public Builder activitySubscriptionGuid(String activitySubscriptionGuid) { + this.activitySubscriptionGuid = activitySubscriptionGuid; + return this; + } + + public PatchTasklistActivitySubscriptionReqBody getPatchTasklistActivitySubscriptionReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder patchTasklistActivitySubscriptionReqBody(PatchTasklistActivitySubscriptionReqBody body) { + this.body = body; + return this; + } + + public PatchTasklistActivitySubscriptionReq build() { + return new PatchTasklistActivitySubscriptionReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistActivitySubscriptionReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistActivitySubscriptionReqBody.java new file mode 100644 index 000000000..6de810f8c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistActivitySubscriptionReqBody.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PatchTasklistActivitySubscriptionReqBody { + /** + * 要更新的订阅数据 + *

示例值: + */ + @SerializedName("activity_subscription") + private TasklistActivitySubscription activitySubscription; + /** + * 要更新的字段 + *

示例值: + */ + @SerializedName("update_fields") + private String[] updateFields; + + // builder 开始 + public PatchTasklistActivitySubscriptionReqBody() { + } + + public PatchTasklistActivitySubscriptionReqBody(Builder builder) { + /** + * 要更新的订阅数据 + *

示例值: + */ + this.activitySubscription = builder.activitySubscription; + /** + * 要更新的字段 + *

示例值: + */ + this.updateFields = builder.updateFields; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public TasklistActivitySubscription getActivitySubscription() { + return this.activitySubscription; + } + + public void setActivitySubscription(TasklistActivitySubscription activitySubscription) { + this.activitySubscription = activitySubscription; + } + + public String[] getUpdateFields() { + return this.updateFields; + } + + public void setUpdateFields(String[] updateFields) { + this.updateFields = updateFields; + } + + public static class Builder { + /** + * 要更新的订阅数据 + *

示例值: + */ + private TasklistActivitySubscription activitySubscription; + /** + * 要更新的字段 + *

示例值: + */ + private String[] updateFields; + + /** + * 要更新的订阅数据 + *

示例值: + * + * @param activitySubscription + * @return + */ + public Builder activitySubscription(TasklistActivitySubscription activitySubscription) { + this.activitySubscription = activitySubscription; + return this; + } + + + /** + * 要更新的字段 + *

示例值: + * + * @param updateFields + * @return + */ + public Builder updateFields(String[] updateFields) { + this.updateFields = updateFields; + return this; + } + + + public PatchTasklistActivitySubscriptionReqBody build() { + return new PatchTasklistActivitySubscriptionReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistActivitySubscriptionResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistActivitySubscriptionResp.java new file mode 100644 index 000000000..f7d56c013 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistActivitySubscriptionResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class PatchTasklistActivitySubscriptionResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistActivitySubscriptionRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistActivitySubscriptionRespBody.java new file mode 100644 index 000000000..6b2de0368 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistActivitySubscriptionRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PatchTasklistActivitySubscriptionRespBody { + /** + * 更新后的订阅 + *

示例值: + */ + @SerializedName("activity_subscription") + private TasklistActivitySubscription activitySubscription; + + public TasklistActivitySubscription getActivitySubscription() { + return this.activitySubscription; + } + + public void setActivitySubscription(TasklistActivitySubscription activitySubscription) { + this.activitySubscription = activitySubscription; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistReq.java new file mode 100644 index 000000000..1cc187b85 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistReq.java @@ -0,0 +1,133 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class PatchTasklistReq { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 要更新的清单的全局唯一GUID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + @Path + @SerializedName("tasklist_guid") + private String tasklistGuid; + @Body + private PatchTasklistReqBody body; + + // builder 开始 + public PatchTasklistReq() { + } + + public PatchTasklistReq(Builder builder) { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 要更新的清单的全局唯一GUID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + this.tasklistGuid = builder.tasklistGuid; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getTasklistGuid() { + return this.tasklistGuid; + } + + public void setTasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + } + + public PatchTasklistReqBody getPatchTasklistReqBody() { + return this.body; + } + + public void setPatchTasklistReqBody(PatchTasklistReqBody body) { + this.body = body; + } + + public static class Builder { + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private String tasklistGuid; // 要更新的清单的全局唯一GUID + private PatchTasklistReqBody body; + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 要更新的清单的全局唯一GUID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + * + * @param tasklistGuid + * @return + */ + public Builder tasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + return this; + } + + public PatchTasklistReqBody getPatchTasklistReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder patchTasklistReqBody(PatchTasklistReqBody body) { + this.body = body; + return this; + } + + public PatchTasklistReq build() { + return new PatchTasklistReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistReqBody.java new file mode 100644 index 000000000..4a86e7266 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistReqBody.java @@ -0,0 +1,160 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PatchTasklistReqBody { + /** + * 要更新清单的数据 + *

示例值: + */ + @SerializedName("tasklist") + private InputTasklist tasklist; + /** + * 要更新的字段名,只支持更新"owner", "name"两个字段 + *

示例值: + */ + @SerializedName("update_fields") + private String[] updateFields; + /** + * 该字段表示如果更新了新的负责人,则将原负责人设为指定的协作人角色。仅在update_fields包含owner字段时生效。根据清单的角色设计方式,不允许提前为清单的负责人添加其他角色,但负责人更新后,原有负责人会无法访问该清单。该字段可以帮助避免原负责人彻底退出清单。 + *

示例值:editor + */ + @SerializedName("origin_owner_to_role") + private String originOwnerToRole; + + // builder 开始 + public PatchTasklistReqBody() { + } + + public PatchTasklistReqBody(Builder builder) { + /** + * 要更新清单的数据 + *

示例值: + */ + this.tasklist = builder.tasklist; + /** + * 要更新的字段名,只支持更新"owner", "name"两个字段 + *

示例值: + */ + this.updateFields = builder.updateFields; + /** + * 该字段表示如果更新了新的负责人,则将原负责人设为指定的协作人角色。仅在update_fields包含owner字段时生效。根据清单的角色设计方式,不允许提前为清单的负责人添加其他角色,但负责人更新后,原有负责人会无法访问该清单。该字段可以帮助避免原负责人彻底退出清单。 + *

示例值:editor + */ + this.originOwnerToRole = builder.originOwnerToRole; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public InputTasklist getTasklist() { + return this.tasklist; + } + + public void setTasklist(InputTasklist tasklist) { + this.tasklist = tasklist; + } + + public String[] getUpdateFields() { + return this.updateFields; + } + + public void setUpdateFields(String[] updateFields) { + this.updateFields = updateFields; + } + + public String getOriginOwnerToRole() { + return this.originOwnerToRole; + } + + public void setOriginOwnerToRole(String originOwnerToRole) { + this.originOwnerToRole = originOwnerToRole; + } + + public static class Builder { + /** + * 要更新清单的数据 + *

示例值: + */ + private InputTasklist tasklist; + /** + * 要更新的字段名,只支持更新"owner", "name"两个字段 + *

示例值: + */ + private String[] updateFields; + /** + * 该字段表示如果更新了新的负责人,则将原负责人设为指定的协作人角色。仅在update_fields包含owner字段时生效。根据清单的角色设计方式,不允许提前为清单的负责人添加其他角色,但负责人更新后,原有负责人会无法访问该清单。该字段可以帮助避免原负责人彻底退出清单。 + *

示例值:editor + */ + private String originOwnerToRole; + + /** + * 要更新清单的数据 + *

示例值: + * + * @param tasklist + * @return + */ + public Builder tasklist(InputTasklist tasklist) { + this.tasklist = tasklist; + return this; + } + + + /** + * 要更新的字段名,只支持更新"owner", "name"两个字段 + *

示例值: + * + * @param updateFields + * @return + */ + public Builder updateFields(String[] updateFields) { + this.updateFields = updateFields; + return this; + } + + + /** + * 该字段表示如果更新了新的负责人,则将原负责人设为指定的协作人角色。仅在update_fields包含owner字段时生效。根据清单的角色设计方式,不允许提前为清单的负责人添加其他角色,但负责人更新后,原有负责人会无法访问该清单。该字段可以帮助避免原负责人彻底退出清单。 + *

示例值:editor + * + * @param originOwnerToRole + * @return + */ + public Builder originOwnerToRole(String originOwnerToRole) { + this.originOwnerToRole = originOwnerToRole; + return this; + } + + /** + * 该字段表示如果更新了新的负责人,则将原负责人设为指定的协作人角色。仅在update_fields包含owner字段时生效。根据清单的角色设计方式,不允许提前为清单的负责人添加其他角色,但负责人更新后,原有负责人会无法访问该清单。该字段可以帮助避免原负责人彻底退出清单。 + *

示例值:editor + * + * @param originOwnerToRole {@link com.lark.oapi.service.task.v2.enums.PatchTasklistOriginOwnerToRoleEnum} + * @return + */ + public Builder originOwnerToRole(com.lark.oapi.service.task.v2.enums.PatchTasklistOriginOwnerToRoleEnum originOwnerToRole) { + this.originOwnerToRole = originOwnerToRole.getValue(); + return this; + } + + + public PatchTasklistReqBody build() { + return new PatchTasklistReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistResp.java new file mode 100644 index 000000000..76265dc28 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class PatchTasklistResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistRespBody.java new file mode 100644 index 000000000..c31f0733c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/PatchTasklistRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class PatchTasklistRespBody { + /** + * 修改后的任务清单 + *

示例值: + */ + @SerializedName("tasklist") + private Tasklist tasklist; + + public Tasklist getTasklist() { + return this.tasklist; + } + + public void setTasklist(Tasklist tasklist) { + this.tasklist = tasklist; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Reminder.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Reminder.java new file mode 100644 index 000000000..f3a6bb96d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Reminder.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Reminder { + /** + * 提醒时间设置的 ID + *

示例值:10 + */ + @SerializedName("id") + private String id; + /** + * 相对于截止时间的提醒时间分钟数。例如30表示截止时间前30分钟提醒;0表示截止时提醒。 + *

示例值:30 + */ + @SerializedName("relative_fire_minute") + private Integer relativeFireMinute; + + // builder 开始 + public Reminder() { + } + + public Reminder(Builder builder) { + /** + * 提醒时间设置的 ID + *

示例值:10 + */ + this.id = builder.id; + /** + * 相对于截止时间的提醒时间分钟数。例如30表示截止时间前30分钟提醒;0表示截止时提醒。 + *

示例值:30 + */ + this.relativeFireMinute = builder.relativeFireMinute; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public Integer getRelativeFireMinute() { + return this.relativeFireMinute; + } + + public void setRelativeFireMinute(Integer relativeFireMinute) { + this.relativeFireMinute = relativeFireMinute; + } + + public static class Builder { + /** + * 提醒时间设置的 ID + *

示例值:10 + */ + private String id; + /** + * 相对于截止时间的提醒时间分钟数。例如30表示截止时间前30分钟提醒;0表示截止时提醒。 + *

示例值:30 + */ + private Integer relativeFireMinute; + + /** + * 提醒时间设置的 ID + *

示例值:10 + * + * @param id + * @return + */ + public Builder id(String id) { + this.id = id; + return this; + } + + + /** + * 相对于截止时间的提醒时间分钟数。例如30表示截止时间前30分钟提醒;0表示截止时提醒。 + *

示例值:30 + * + * @param relativeFireMinute + * @return + */ + public Builder relativeFireMinute(Integer relativeFireMinute) { + this.relativeFireMinute = relativeFireMinute; + return this; + } + + + public Reminder build() { + return new Reminder(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveCustomFieldReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveCustomFieldReq.java new file mode 100644 index 000000000..9b0fbab01 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveCustomFieldReq.java @@ -0,0 +1,100 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Path; + +public class RemoveCustomFieldReq { + /** + * 自定义字段GUID + *

示例值:0110a4bd-f24b-4a93-8c1a-1732b94f9593 + */ + @Path + @SerializedName("custom_field_guid") + private String customFieldGuid; + @Body + private RemoveCustomFieldReqBody body; + + // builder 开始 + public RemoveCustomFieldReq() { + } + + public RemoveCustomFieldReq(Builder builder) { + /** + * 自定义字段GUID + *

示例值:0110a4bd-f24b-4a93-8c1a-1732b94f9593 + */ + this.customFieldGuid = builder.customFieldGuid; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getCustomFieldGuid() { + return this.customFieldGuid; + } + + public void setCustomFieldGuid(String customFieldGuid) { + this.customFieldGuid = customFieldGuid; + } + + public RemoveCustomFieldReqBody getRemoveCustomFieldReqBody() { + return this.body; + } + + public void setRemoveCustomFieldReqBody(RemoveCustomFieldReqBody body) { + this.body = body; + } + + public static class Builder { + + private String customFieldGuid; // 自定义字段GUID + private RemoveCustomFieldReqBody body; + + /** + * 自定义字段GUID + *

示例值:0110a4bd-f24b-4a93-8c1a-1732b94f9593 + * + * @param customFieldGuid + * @return + */ + public Builder customFieldGuid(String customFieldGuid) { + this.customFieldGuid = customFieldGuid; + return this; + } + + public RemoveCustomFieldReqBody getRemoveCustomFieldReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder removeCustomFieldReqBody(RemoveCustomFieldReqBody body) { + this.body = body; + return this; + } + + public RemoveCustomFieldReq build() { + return new RemoveCustomFieldReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveCustomFieldReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveCustomFieldReqBody.java new file mode 100644 index 000000000..6f527b3df --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveCustomFieldReqBody.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class RemoveCustomFieldReqBody { + /** + * 要从某个资源移除自定义字段的资源类型,目前只支持清单"tasklist"。 + *

示例值:tasklist + */ + @SerializedName("resource_type") + private String resourceType; + /** + * 要从某个资源移除自定义字段的资源id,`resource_type`为"tasklist"时,需填写清单的GUID + *

示例值:0110a4bd-f24b-4a93-8c1a-1732b94f9593 + */ + @SerializedName("resource_id") + private String resourceId; + + // builder 开始 + public RemoveCustomFieldReqBody() { + } + + public RemoveCustomFieldReqBody(Builder builder) { + /** + * 要从某个资源移除自定义字段的资源类型,目前只支持清单"tasklist"。 + *

示例值:tasklist + */ + this.resourceType = builder.resourceType; + /** + * 要从某个资源移除自定义字段的资源id,`resource_type`为"tasklist"时,需填写清单的GUID + *

示例值:0110a4bd-f24b-4a93-8c1a-1732b94f9593 + */ + this.resourceId = builder.resourceId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getResourceType() { + return this.resourceType; + } + + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + public String getResourceId() { + return this.resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public static class Builder { + /** + * 要从某个资源移除自定义字段的资源类型,目前只支持清单"tasklist"。 + *

示例值:tasklist + */ + private String resourceType; + /** + * 要从某个资源移除自定义字段的资源id,`resource_type`为"tasklist"时,需填写清单的GUID + *

示例值:0110a4bd-f24b-4a93-8c1a-1732b94f9593 + */ + private String resourceId; + + /** + * 要从某个资源移除自定义字段的资源类型,目前只支持清单"tasklist"。 + *

示例值:tasklist + * + * @param resourceType + * @return + */ + public Builder resourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + + /** + * 要从某个资源移除自定义字段的资源id,`resource_type`为"tasklist"时,需填写清单的GUID + *

示例值:0110a4bd-f24b-4a93-8c1a-1732b94f9593 + * + * @param resourceId + * @return + */ + public Builder resourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + + public RemoveCustomFieldReqBody build() { + return new RemoveCustomFieldReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveCustomFieldResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveCustomFieldResp.java new file mode 100644 index 000000000..da283b041 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveCustomFieldResp.java @@ -0,0 +1,20 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; +import com.lark.oapi.core.response.EmptyData; + +public class RemoveCustomFieldResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveDependenciesTaskReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveDependenciesTaskReq.java new file mode 100644 index 000000000..1fd8c03b6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveDependenciesTaskReq.java @@ -0,0 +1,100 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Path; + +public class RemoveDependenciesTaskReq { + /** + * 要移除依赖的任务GUID + *

示例值:93b7bd05-35e6-4371-b3c9-6b7cbd7100c0 + */ + @Path + @SerializedName("task_guid") + private String taskGuid; + @Body + private RemoveDependenciesTaskReqBody body; + + // builder 开始 + public RemoveDependenciesTaskReq() { + } + + public RemoveDependenciesTaskReq(Builder builder) { + /** + * 要移除依赖的任务GUID + *

示例值:93b7bd05-35e6-4371-b3c9-6b7cbd7100c0 + */ + this.taskGuid = builder.taskGuid; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getTaskGuid() { + return this.taskGuid; + } + + public void setTaskGuid(String taskGuid) { + this.taskGuid = taskGuid; + } + + public RemoveDependenciesTaskReqBody getRemoveDependenciesTaskReqBody() { + return this.body; + } + + public void setRemoveDependenciesTaskReqBody(RemoveDependenciesTaskReqBody body) { + this.body = body; + } + + public static class Builder { + + private String taskGuid; // 要移除依赖的任务GUID + private RemoveDependenciesTaskReqBody body; + + /** + * 要移除依赖的任务GUID + *

示例值:93b7bd05-35e6-4371-b3c9-6b7cbd7100c0 + * + * @param taskGuid + * @return + */ + public Builder taskGuid(String taskGuid) { + this.taskGuid = taskGuid; + return this; + } + + public RemoveDependenciesTaskReqBody getRemoveDependenciesTaskReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder removeDependenciesTaskReqBody(RemoveDependenciesTaskReqBody body) { + this.body = body; + return this; + } + + public RemoveDependenciesTaskReq build() { + return new RemoveDependenciesTaskReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveDependenciesTaskReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveDependenciesTaskReqBody.java new file mode 100644 index 000000000..933f981bf --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveDependenciesTaskReqBody.java @@ -0,0 +1,74 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class RemoveDependenciesTaskReqBody { + /** + * 要移除的依赖 + *

示例值: + */ + @SerializedName("dependencies") + private TaskDependency[] dependencies; + + // builder 开始 + public RemoveDependenciesTaskReqBody() { + } + + public RemoveDependenciesTaskReqBody(Builder builder) { + /** + * 要移除的依赖 + *

示例值: + */ + this.dependencies = builder.dependencies; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public TaskDependency[] getDependencies() { + return this.dependencies; + } + + public void setDependencies(TaskDependency[] dependencies) { + this.dependencies = dependencies; + } + + public static class Builder { + /** + * 要移除的依赖 + *

示例值: + */ + private TaskDependency[] dependencies; + + /** + * 要移除的依赖 + *

示例值: + * + * @param dependencies + * @return + */ + public Builder dependencies(TaskDependency[] dependencies) { + this.dependencies = dependencies; + return this; + } + + + public RemoveDependenciesTaskReqBody build() { + return new RemoveDependenciesTaskReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveDependenciesTaskResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveDependenciesTaskResp.java new file mode 100644 index 000000000..36831385d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveDependenciesTaskResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class RemoveDependenciesTaskResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveDependenciesTaskRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveDependenciesTaskRespBody.java new file mode 100644 index 000000000..f3164d1de --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveDependenciesTaskRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class RemoveDependenciesTaskRespBody { + /** + * 移除之后的任务GUID + *

示例值: + */ + @SerializedName("dependencies") + private TaskDependency[] dependencies; + + public TaskDependency[] getDependencies() { + return this.dependencies; + } + + public void setDependencies(TaskDependency[] dependencies) { + this.dependencies = dependencies; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTaskReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTaskReq.java new file mode 100644 index 000000000..365aed516 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTaskReq.java @@ -0,0 +1,133 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class RemoveMembersTaskReq { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 要添加负责人的任务全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + @Path + @SerializedName("task_guid") + private String taskGuid; + @Body + private RemoveMembersTaskReqBody body; + + // builder 开始 + public RemoveMembersTaskReq() { + } + + public RemoveMembersTaskReq(Builder builder) { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 要添加负责人的任务全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + this.taskGuid = builder.taskGuid; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getTaskGuid() { + return this.taskGuid; + } + + public void setTaskGuid(String taskGuid) { + this.taskGuid = taskGuid; + } + + public RemoveMembersTaskReqBody getRemoveMembersTaskReqBody() { + return this.body; + } + + public void setRemoveMembersTaskReqBody(RemoveMembersTaskReqBody body) { + this.body = body; + } + + public static class Builder { + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private String taskGuid; // 要添加负责人的任务全局唯一ID + private RemoveMembersTaskReqBody body; + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 要添加负责人的任务全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + * + * @param taskGuid + * @return + */ + public Builder taskGuid(String taskGuid) { + this.taskGuid = taskGuid; + return this; + } + + public RemoveMembersTaskReqBody getRemoveMembersTaskReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder removeMembersTaskReqBody(RemoveMembersTaskReqBody body) { + this.body = body; + return this; + } + + public RemoveMembersTaskReq build() { + return new RemoveMembersTaskReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTaskReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTaskReqBody.java new file mode 100644 index 000000000..ffc3c932e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTaskReqBody.java @@ -0,0 +1,74 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class RemoveMembersTaskReqBody { + /** + * 要移除的member列表 + *

示例值: + */ + @SerializedName("members") + private Member[] members; + + // builder 开始 + public RemoveMembersTaskReqBody() { + } + + public RemoveMembersTaskReqBody(Builder builder) { + /** + * 要移除的member列表 + *

示例值: + */ + this.members = builder.members; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Member[] getMembers() { + return this.members; + } + + public void setMembers(Member[] members) { + this.members = members; + } + + public static class Builder { + /** + * 要移除的member列表 + *

示例值: + */ + private Member[] members; + + /** + * 要移除的member列表 + *

示例值: + * + * @param members + * @return + */ + public Builder members(Member[] members) { + this.members = members; + return this; + } + + + public RemoveMembersTaskReqBody build() { + return new RemoveMembersTaskReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTaskResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTaskResp.java new file mode 100644 index 000000000..e1716ea47 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTaskResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class RemoveMembersTaskResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTaskRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTaskRespBody.java new file mode 100644 index 000000000..51fd215bd --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTaskRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class RemoveMembersTaskRespBody { + /** + * 移除成员后的任务数据 + *

示例值: + */ + @SerializedName("task") + private Task task; + + public Task getTask() { + return this.task; + } + + public void setTask(Task task) { + this.task = task; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTasklistReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTasklistReq.java new file mode 100644 index 000000000..a153394f7 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTasklistReq.java @@ -0,0 +1,133 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class RemoveMembersTasklistReq { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 要移除协作人的清单全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + @Path + @SerializedName("tasklist_guid") + private String tasklistGuid; + @Body + private RemoveMembersTasklistReqBody body; + + // builder 开始 + public RemoveMembersTasklistReq() { + } + + public RemoveMembersTasklistReq(Builder builder) { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 要移除协作人的清单全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + this.tasklistGuid = builder.tasklistGuid; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getTasklistGuid() { + return this.tasklistGuid; + } + + public void setTasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + } + + public RemoveMembersTasklistReqBody getRemoveMembersTasklistReqBody() { + return this.body; + } + + public void setRemoveMembersTasklistReqBody(RemoveMembersTasklistReqBody body) { + this.body = body; + } + + public static class Builder { + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private String tasklistGuid; // 要移除协作人的清单全局唯一ID + private RemoveMembersTasklistReqBody body; + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 要移除协作人的清单全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + * + * @param tasklistGuid + * @return + */ + public Builder tasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + return this; + } + + public RemoveMembersTasklistReqBody getRemoveMembersTasklistReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder removeMembersTasklistReqBody(RemoveMembersTasklistReqBody body) { + this.body = body; + return this; + } + + public RemoveMembersTasklistReq build() { + return new RemoveMembersTasklistReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTasklistReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTasklistReqBody.java new file mode 100644 index 000000000..0078968d1 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTasklistReqBody.java @@ -0,0 +1,74 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class RemoveMembersTasklistReqBody { + /** + * 要移除的member列表 + *

示例值: + */ + @SerializedName("members") + private Member[] members; + + // builder 开始 + public RemoveMembersTasklistReqBody() { + } + + public RemoveMembersTasklistReqBody(Builder builder) { + /** + * 要移除的member列表 + *

示例值: + */ + this.members = builder.members; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Member[] getMembers() { + return this.members; + } + + public void setMembers(Member[] members) { + this.members = members; + } + + public static class Builder { + /** + * 要移除的member列表 + *

示例值: + */ + private Member[] members; + + /** + * 要移除的member列表 + *

示例值: + * + * @param members + * @return + */ + public Builder members(Member[] members) { + this.members = members; + return this; + } + + + public RemoveMembersTasklistReqBody build() { + return new RemoveMembersTasklistReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTasklistResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTasklistResp.java new file mode 100644 index 000000000..3aaf501aa --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTasklistResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class RemoveMembersTasklistResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTasklistRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTasklistRespBody.java new file mode 100644 index 000000000..900138769 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveMembersTasklistRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class RemoveMembersTasklistRespBody { + /** + * 修改完成后的清单实体 + *

示例值: + */ + @SerializedName("tasklist") + private Tasklist tasklist; + + public Tasklist getTasklist() { + return this.tasklist; + } + + public void setTasklist(Tasklist tasklist) { + this.tasklist = tasklist; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveRemindersTaskReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveRemindersTaskReq.java new file mode 100644 index 000000000..feff1c5e1 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveRemindersTaskReq.java @@ -0,0 +1,133 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class RemoveRemindersTaskReq { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 要添加负责人的任务全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + @Path + @SerializedName("task_guid") + private String taskGuid; + @Body + private RemoveRemindersTaskReqBody body; + + // builder 开始 + public RemoveRemindersTaskReq() { + } + + public RemoveRemindersTaskReq(Builder builder) { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 要添加负责人的任务全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + this.taskGuid = builder.taskGuid; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getTaskGuid() { + return this.taskGuid; + } + + public void setTaskGuid(String taskGuid) { + this.taskGuid = taskGuid; + } + + public RemoveRemindersTaskReqBody getRemoveRemindersTaskReqBody() { + return this.body; + } + + public void setRemoveRemindersTaskReqBody(RemoveRemindersTaskReqBody body) { + this.body = body; + } + + public static class Builder { + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private String taskGuid; // 要添加负责人的任务全局唯一ID + private RemoveRemindersTaskReqBody body; + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 要添加负责人的任务全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + * + * @param taskGuid + * @return + */ + public Builder taskGuid(String taskGuid) { + this.taskGuid = taskGuid; + return this; + } + + public RemoveRemindersTaskReqBody getRemoveRemindersTaskReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder removeRemindersTaskReqBody(RemoveRemindersTaskReqBody body) { + this.body = body; + return this; + } + + public RemoveRemindersTaskReq build() { + return new RemoveRemindersTaskReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveRemindersTaskReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveRemindersTaskReqBody.java new file mode 100644 index 000000000..ef8f6df8a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveRemindersTaskReqBody.java @@ -0,0 +1,74 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class RemoveRemindersTaskReqBody { + /** + * 要移除的reminder的id列表 + *

示例值: + */ + @SerializedName("reminder_ids") + private String[] reminderIds; + + // builder 开始 + public RemoveRemindersTaskReqBody() { + } + + public RemoveRemindersTaskReqBody(Builder builder) { + /** + * 要移除的reminder的id列表 + *

示例值: + */ + this.reminderIds = builder.reminderIds; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String[] getReminderIds() { + return this.reminderIds; + } + + public void setReminderIds(String[] reminderIds) { + this.reminderIds = reminderIds; + } + + public static class Builder { + /** + * 要移除的reminder的id列表 + *

示例值: + */ + private String[] reminderIds; + + /** + * 要移除的reminder的id列表 + *

示例值: + * + * @param reminderIds + * @return + */ + public Builder reminderIds(String[] reminderIds) { + this.reminderIds = reminderIds; + return this; + } + + + public RemoveRemindersTaskReqBody build() { + return new RemoveRemindersTaskReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveRemindersTaskResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveRemindersTaskResp.java new file mode 100644 index 000000000..8316d3662 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveRemindersTaskResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class RemoveRemindersTaskResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveRemindersTaskRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveRemindersTaskRespBody.java new file mode 100644 index 000000000..7bcf36044 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveRemindersTaskRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class RemoveRemindersTaskRespBody { + /** + * 移除提醒后的任务详情 + *

示例值: + */ + @SerializedName("task") + private Task task; + + public Task getTask() { + return this.task; + } + + public void setTask(Task task) { + this.task = task; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveTasklistTaskReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveTasklistTaskReq.java new file mode 100644 index 000000000..16f7a16a8 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveTasklistTaskReq.java @@ -0,0 +1,133 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class RemoveTasklistTaskReq { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 要从清单移除的任务的全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + @Path + @SerializedName("task_guid") + private String taskGuid; + @Body + private RemoveTasklistTaskReqBody body; + + // builder 开始 + public RemoveTasklistTaskReq() { + } + + public RemoveTasklistTaskReq(Builder builder) { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 要从清单移除的任务的全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + this.taskGuid = builder.taskGuid; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getTaskGuid() { + return this.taskGuid; + } + + public void setTaskGuid(String taskGuid) { + this.taskGuid = taskGuid; + } + + public RemoveTasklistTaskReqBody getRemoveTasklistTaskReqBody() { + return this.body; + } + + public void setRemoveTasklistTaskReqBody(RemoveTasklistTaskReqBody body) { + this.body = body; + } + + public static class Builder { + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private String taskGuid; // 要从清单移除的任务的全局唯一ID + private RemoveTasklistTaskReqBody body; + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 要从清单移除的任务的全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + * + * @param taskGuid + * @return + */ + public Builder taskGuid(String taskGuid) { + this.taskGuid = taskGuid; + return this; + } + + public RemoveTasklistTaskReqBody getRemoveTasklistTaskReqBody() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder removeTasklistTaskReqBody(RemoveTasklistTaskReqBody body) { + this.body = body; + return this; + } + + public RemoveTasklistTaskReq build() { + return new RemoveTasklistTaskReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveTasklistTaskReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveTasklistTaskReqBody.java new file mode 100644 index 000000000..9f7118eaa --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveTasklistTaskReqBody.java @@ -0,0 +1,74 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class RemoveTasklistTaskReqBody { + /** + * 要移除的清单的全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + @SerializedName("tasklist_guid") + private String tasklistGuid; + + // builder 开始 + public RemoveTasklistTaskReqBody() { + } + + public RemoveTasklistTaskReqBody(Builder builder) { + /** + * 要移除的清单的全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + this.tasklistGuid = builder.tasklistGuid; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getTasklistGuid() { + return this.tasklistGuid; + } + + public void setTasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + } + + public static class Builder { + /** + * 要移除的清单的全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + private String tasklistGuid; + + /** + * 要移除的清单的全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + * + * @param tasklistGuid + * @return + */ + public Builder tasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + return this; + } + + + public RemoveTasklistTaskReqBody build() { + return new RemoveTasklistTaskReqBody(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveTasklistTaskResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveTasklistTaskResp.java new file mode 100644 index 000000000..f9346d365 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveTasklistTaskResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class RemoveTasklistTaskResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveTasklistTaskRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveTasklistTaskRespBody.java new file mode 100644 index 000000000..aca41db0b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/RemoveTasklistTaskRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class RemoveTasklistTaskRespBody { + /** + * 添加后的任务详情 + *

示例值: + */ + @SerializedName("task") + private Task task; + + public Task getTask() { + return this.task; + } + + public void setTask(Task task) { + this.task = task; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Resource.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Resource.java new file mode 100644 index 000000000..5980faf63 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Resource.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Resource { + /** + * 资源类型 + *

示例值:task + */ + @SerializedName("type") + private String type; + /** + * 资源ID + *

示例值:e6e37dcc-f75a-5936-f589-12fb4b5c80c2 + */ + @SerializedName("id") + private String id; + + // builder 开始 + public Resource() { + } + + public Resource(Builder builder) { + /** + * 资源类型 + *

示例值:task + */ + this.type = builder.type; + /** + * 资源ID + *

示例值:e6e37dcc-f75a-5936-f589-12fb4b5c80c2 + */ + this.id = builder.id; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public static class Builder { + /** + * 资源类型 + *

示例值:task + */ + private String type; + /** + * 资源ID + *

示例值:e6e37dcc-f75a-5936-f589-12fb4b5c80c2 + */ + private String id; + + /** + * 资源类型 + *

示例值:task + * + * @param type + * @return + */ + public Builder type(String type) { + this.type = type; + return this; + } + + + /** + * 资源ID + *

示例值:e6e37dcc-f75a-5936-f589-12fb4b5c80c2 + * + * @param id + * @return + */ + public Builder id(String id) { + this.id = id; + return this; + } + + + public Resource build() { + return new Resource(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Section.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Section.java new file mode 100644 index 000000000..253d10b59 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Section.java @@ -0,0 +1,333 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Section { + /** + * 自定义分组的guid + *

示例值:e6e37dcc-f75a-5936-f589-12fb4b5c80c2 + */ + @SerializedName("guid") + private String guid; + /** + * 自定义分组的名字 + *

示例值:已经评审过的任务 + */ + @SerializedName("name") + private String name; + /** + * 资源类型 + *

示例值:tasklist + */ + @SerializedName("resource_type") + private String resourceType; + /** + * 分组是否为默认自定义分组 + *

示例值:true + */ + @SerializedName("is_default") + private Boolean isDefault; + /** + * 自定义分组的创建者 + *

示例值: + */ + @SerializedName("creator") + private Member creator; + /** + * 如果该分组归属于清单,展示清单的简要信息 + *

示例值: + */ + @SerializedName("tasklist") + private TasklistSummary tasklist; + /** + * 自定义分组创建时间戳(ms) + *

示例值:1675742789470 + */ + @SerializedName("created_at") + private String createdAt; + /** + * 自定义分组最近一次更新时间戳(ms) + *

示例值:1675742789470 + */ + @SerializedName("updated_at") + private String updatedAt; + + // builder 开始 + public Section() { + } + + public Section(Builder builder) { + /** + * 自定义分组的guid + *

示例值:e6e37dcc-f75a-5936-f589-12fb4b5c80c2 + */ + this.guid = builder.guid; + /** + * 自定义分组的名字 + *

示例值:已经评审过的任务 + */ + this.name = builder.name; + /** + * 资源类型 + *

示例值:tasklist + */ + this.resourceType = builder.resourceType; + /** + * 分组是否为默认自定义分组 + *

示例值:true + */ + this.isDefault = builder.isDefault; + /** + * 自定义分组的创建者 + *

示例值: + */ + this.creator = builder.creator; + /** + * 如果该分组归属于清单,展示清单的简要信息 + *

示例值: + */ + this.tasklist = builder.tasklist; + /** + * 自定义分组创建时间戳(ms) + *

示例值:1675742789470 + */ + this.createdAt = builder.createdAt; + /** + * 自定义分组最近一次更新时间戳(ms) + *

示例值:1675742789470 + */ + this.updatedAt = builder.updatedAt; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getGuid() { + return this.guid; + } + + public void setGuid(String guid) { + this.guid = guid; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getResourceType() { + return this.resourceType; + } + + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + public Boolean getIsDefault() { + return this.isDefault; + } + + public void setIsDefault(Boolean isDefault) { + this.isDefault = isDefault; + } + + public Member getCreator() { + return this.creator; + } + + public void setCreator(Member creator) { + this.creator = creator; + } + + public TasklistSummary getTasklist() { + return this.tasklist; + } + + public void setTasklist(TasklistSummary tasklist) { + this.tasklist = tasklist; + } + + public String getCreatedAt() { + return this.createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public String getUpdatedAt() { + return this.updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + public static class Builder { + /** + * 自定义分组的guid + *

示例值:e6e37dcc-f75a-5936-f589-12fb4b5c80c2 + */ + private String guid; + /** + * 自定义分组的名字 + *

示例值:已经评审过的任务 + */ + private String name; + /** + * 资源类型 + *

示例值:tasklist + */ + private String resourceType; + /** + * 分组是否为默认自定义分组 + *

示例值:true + */ + private Boolean isDefault; + /** + * 自定义分组的创建者 + *

示例值: + */ + private Member creator; + /** + * 如果该分组归属于清单,展示清单的简要信息 + *

示例值: + */ + private TasklistSummary tasklist; + /** + * 自定义分组创建时间戳(ms) + *

示例值:1675742789470 + */ + private String createdAt; + /** + * 自定义分组最近一次更新时间戳(ms) + *

示例值:1675742789470 + */ + private String updatedAt; + + /** + * 自定义分组的guid + *

示例值:e6e37dcc-f75a-5936-f589-12fb4b5c80c2 + * + * @param guid + * @return + */ + public Builder guid(String guid) { + this.guid = guid; + return this; + } + + + /** + * 自定义分组的名字 + *

示例值:已经评审过的任务 + * + * @param name + * @return + */ + public Builder name(String name) { + this.name = name; + return this; + } + + + /** + * 资源类型 + *

示例值:tasklist + * + * @param resourceType + * @return + */ + public Builder resourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + + /** + * 分组是否为默认自定义分组 + *

示例值:true + * + * @param isDefault + * @return + */ + public Builder isDefault(Boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + + /** + * 自定义分组的创建者 + *

示例值: + * + * @param creator + * @return + */ + public Builder creator(Member creator) { + this.creator = creator; + return this; + } + + + /** + * 如果该分组归属于清单,展示清单的简要信息 + *

示例值: + * + * @param tasklist + * @return + */ + public Builder tasklist(TasklistSummary tasklist) { + this.tasklist = tasklist; + return this; + } + + + /** + * 自定义分组创建时间戳(ms) + *

示例值:1675742789470 + * + * @param createdAt + * @return + */ + public Builder createdAt(String createdAt) { + this.createdAt = createdAt; + return this; + } + + + /** + * 自定义分组最近一次更新时间戳(ms) + *

示例值:1675742789470 + * + * @param updatedAt + * @return + */ + public Builder updatedAt(String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + + public Section build() { + return new Section(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/SectionSummary.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/SectionSummary.java new file mode 100644 index 000000000..34f77a0f2 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/SectionSummary.java @@ -0,0 +1,148 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class SectionSummary { + /** + * 自定义分组的全局唯一ID + *

示例值:e6e37dcc-f75a-5936-f589-12fb4b5c80c2 + */ + @SerializedName("guid") + private String guid; + /** + * 自定义分组的名称 + *

示例值:审核过的任务 + */ + @SerializedName("name") + private String name; + /** + * 是否是默认分组 + *

示例值:true + */ + @SerializedName("is_default") + private Boolean isDefault; + + // builder 开始 + public SectionSummary() { + } + + public SectionSummary(Builder builder) { + /** + * 自定义分组的全局唯一ID + *

示例值:e6e37dcc-f75a-5936-f589-12fb4b5c80c2 + */ + this.guid = builder.guid; + /** + * 自定义分组的名称 + *

示例值:审核过的任务 + */ + this.name = builder.name; + /** + * 是否是默认分组 + *

示例值:true + */ + this.isDefault = builder.isDefault; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getGuid() { + return this.guid; + } + + public void setGuid(String guid) { + this.guid = guid; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public Boolean getIsDefault() { + return this.isDefault; + } + + public void setIsDefault(Boolean isDefault) { + this.isDefault = isDefault; + } + + public static class Builder { + /** + * 自定义分组的全局唯一ID + *

示例值:e6e37dcc-f75a-5936-f589-12fb4b5c80c2 + */ + private String guid; + /** + * 自定义分组的名称 + *

示例值:审核过的任务 + */ + private String name; + /** + * 是否是默认分组 + *

示例值:true + */ + private Boolean isDefault; + + /** + * 自定义分组的全局唯一ID + *

示例值:e6e37dcc-f75a-5936-f589-12fb4b5c80c2 + * + * @param guid + * @return + */ + public Builder guid(String guid) { + this.guid = guid; + return this; + } + + + /** + * 自定义分组的名称 + *

示例值:审核过的任务 + * + * @param name + * @return + */ + public Builder name(String name) { + this.name = name; + return this; + } + + + /** + * 是否是默认分组 + *

示例值:true + * + * @param isDefault + * @return + */ + public Builder isDefault(Boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + + public SectionSummary build() { + return new SectionSummary(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/SelectSetting.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/SelectSetting.java new file mode 100644 index 000000000..3722e9e13 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/SelectSetting.java @@ -0,0 +1,74 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class SelectSetting { + /** + * 选项 + *

示例值: + */ + @SerializedName("options") + private Option[] options; + + // builder 开始 + public SelectSetting() { + } + + public SelectSetting(Builder builder) { + /** + * 选项 + *

示例值: + */ + this.options = builder.options; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Option[] getOptions() { + return this.options; + } + + public void setOptions(Option[] options) { + this.options = options; + } + + public static class Builder { + /** + * 选项 + *

示例值: + */ + private Option[] options; + + /** + * 选项 + *

示例值: + * + * @param options + * @return + */ + public Builder options(Option[] options) { + this.options = options; + return this; + } + + + public SelectSetting build() { + return new SelectSetting(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Start.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Start.java new file mode 100644 index 000000000..3cc19028d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Start.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Start { + /** + * 开始时间/日期的时间戳,距1970-01-01 00:00:00的毫秒数。如果开始时间是一个日期,需要把日期转换成时间戳,并设置 is_all_day=true + *

示例值:1675454764000 + */ + @SerializedName("timestamp") + private String timestamp; + /** + * 是否开始于一个日期。如果设为true,timestamp中只有日期的部分会被解析和存储。 + *

示例值:true + */ + @SerializedName("is_all_day") + private Boolean isAllDay; + + // builder 开始 + public Start() { + } + + public Start(Builder builder) { + /** + * 开始时间/日期的时间戳,距1970-01-01 00:00:00的毫秒数。如果开始时间是一个日期,需要把日期转换成时间戳,并设置 is_all_day=true + *

示例值:1675454764000 + */ + this.timestamp = builder.timestamp; + /** + * 是否开始于一个日期。如果设为true,timestamp中只有日期的部分会被解析和存储。 + *

示例值:true + */ + this.isAllDay = builder.isAllDay; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getTimestamp() { + return this.timestamp; + } + + public void setTimestamp(String timestamp) { + this.timestamp = timestamp; + } + + public Boolean getIsAllDay() { + return this.isAllDay; + } + + public void setIsAllDay(Boolean isAllDay) { + this.isAllDay = isAllDay; + } + + public static class Builder { + /** + * 开始时间/日期的时间戳,距1970-01-01 00:00:00的毫秒数。如果开始时间是一个日期,需要把日期转换成时间戳,并设置 is_all_day=true + *

示例值:1675454764000 + */ + private String timestamp; + /** + * 是否开始于一个日期。如果设为true,timestamp中只有日期的部分会被解析和存储。 + *

示例值:true + */ + private Boolean isAllDay; + + /** + * 开始时间/日期的时间戳,距1970-01-01 00:00:00的毫秒数。如果开始时间是一个日期,需要把日期转换成时间戳,并设置 is_all_day=true + *

示例值:1675454764000 + * + * @param timestamp + * @return + */ + public Builder timestamp(String timestamp) { + this.timestamp = timestamp; + return this; + } + + + /** + * 是否开始于一个日期。如果设为true,timestamp中只有日期的部分会被解析和存储。 + *

示例值:true + * + * @param isAllDay + * @return + */ + public Builder isAllDay(Boolean isAllDay) { + this.isAllDay = isAllDay; + return this; + } + + + public Start build() { + return new Start(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Task.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Task.java new file mode 100644 index 000000000..f8fe9d751 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Task.java @@ -0,0 +1,1048 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Task { + /** + * 任务guid,任务的唯一ID + *

示例值:83912691-2e43-47fc-94a4-d512e03984fa + */ + @SerializedName("guid") + private String guid; + /** + * 任务标题 + *

示例值:进行销售年中总结 + */ + @SerializedName("summary") + private String summary; + /** + * 任务描述 + *

示例值:进行销售年中总结 + */ + @SerializedName("description") + private String description; + /** + * 任务截止时间 + *

示例值:1675742789470 + */ + @SerializedName("due") + private Due due; + /** + * 任务的提醒配置列表。目前每个任务最多有1个。 + *

示例值: + */ + @SerializedName("reminders") + private Reminder[] reminders; + /** + * 任务创建者 + *

示例值: + */ + @SerializedName("creator") + private Member creator; + /** + * 任务成员列表 + *

示例值: + */ + @SerializedName("members") + private Member[] members; + /** + * 任务完成的时间戳(ms) + *

示例值:1675742789470 + */ + @SerializedName("completed_at") + private String completedAt; + /** + * 任务的附件列表 + *

示例值: + */ + @SerializedName("attachments") + private Attachment[] attachments; + /** + * 任务关联的第三方平台来源信息。创建是设置后就不可更改。 + *

示例值: + */ + @SerializedName("origin") + private Origin origin; + /** + * 任务附带的自定义数据。 + *

示例值:dGVzdA== + */ + @SerializedName("extra") + private String extra; + /** + * 任务所属清单的名字。调用者只能看到有权限访问的清单的列表。 + *

示例值: + */ + @SerializedName("tasklists") + private TaskInTasklistInfo[] tasklists; + /** + * 如果任务为重复任务,返回重复任务的配置 + *

示例值:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR + */ + @SerializedName("repeat_rule") + private String repeatRule; + /** + * 如果当前任务为某个任务的子任务,返回父任务的guid + *

示例值:e297ddff-06ca-4166-b917-4ce57cd3a7a0 + */ + @SerializedName("parent_task_guid") + private String parentTaskGuid; + /** + * 任务的模式。1 - 会签任务;2 - 或签任务 + *

示例值:2 + */ + @SerializedName("mode") + private Integer mode; + /** + * 任务创建的来源 + *

示例值:6 + */ + @SerializedName("source") + private Integer source; + /** + * 任务的自定义完成配置 + *

示例值: + */ + @SerializedName("custom_complete") + private CustomComplete customComplete; + /** + * 任务界面上的代码 + *

示例值:t6272302 + */ + @SerializedName("task_id") + private String taskId; + /** + * 任务创建时间戳(ms) + *

示例值:1675742789470 + */ + @SerializedName("created_at") + private String createdAt; + /** + * 任务最后一次更新的时间戳(ms) + *

示例值:1675742789470 + */ + @SerializedName("updated_at") + private String updatedAt; + /** + * 任务的状态,支持"todo"和"done"两种状态 + *

示例值:todo + */ + @SerializedName("status") + private String status; + /** + * 任务的分享链接 + *

示例值:https://applink.feishu.cn/client/todo/detail?guid=70577c8f-91ab-4c91-b359-a21a751054e8&suite_entity_num=t192012 + */ + @SerializedName("url") + private String url; + /** + * 任务的开始时间 + *

示例值: + */ + @SerializedName("start") + private Start start; + /** + * 该任务的子任务的个数。 + *

示例值:1 + */ + @SerializedName("subtask_count") + private Integer subtaskCount; + /** + * 是否是里程碑任务 + *

示例值:false + */ + @SerializedName("is_milestone") + private Boolean isMilestone; + /** + * 任务的自定义字段值 + *

示例值: + */ + @SerializedName("custom_fields") + private CustomFieldValue[] customFields; + /** + * 任务依赖 + *

示例值: + */ + @SerializedName("dependencies") + private TaskDependency[] dependencies; + + // builder 开始 + public Task() { + } + + public Task(Builder builder) { + /** + * 任务guid,任务的唯一ID + *

示例值:83912691-2e43-47fc-94a4-d512e03984fa + */ + this.guid = builder.guid; + /** + * 任务标题 + *

示例值:进行销售年中总结 + */ + this.summary = builder.summary; + /** + * 任务描述 + *

示例值:进行销售年中总结 + */ + this.description = builder.description; + /** + * 任务截止时间 + *

示例值:1675742789470 + */ + this.due = builder.due; + /** + * 任务的提醒配置列表。目前每个任务最多有1个。 + *

示例值: + */ + this.reminders = builder.reminders; + /** + * 任务创建者 + *

示例值: + */ + this.creator = builder.creator; + /** + * 任务成员列表 + *

示例值: + */ + this.members = builder.members; + /** + * 任务完成的时间戳(ms) + *

示例值:1675742789470 + */ + this.completedAt = builder.completedAt; + /** + * 任务的附件列表 + *

示例值: + */ + this.attachments = builder.attachments; + /** + * 任务关联的第三方平台来源信息。创建是设置后就不可更改。 + *

示例值: + */ + this.origin = builder.origin; + /** + * 任务附带的自定义数据。 + *

示例值:dGVzdA== + */ + this.extra = builder.extra; + /** + * 任务所属清单的名字。调用者只能看到有权限访问的清单的列表。 + *

示例值: + */ + this.tasklists = builder.tasklists; + /** + * 如果任务为重复任务,返回重复任务的配置 + *

示例值:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR + */ + this.repeatRule = builder.repeatRule; + /** + * 如果当前任务为某个任务的子任务,返回父任务的guid + *

示例值:e297ddff-06ca-4166-b917-4ce57cd3a7a0 + */ + this.parentTaskGuid = builder.parentTaskGuid; + /** + * 任务的模式。1 - 会签任务;2 - 或签任务 + *

示例值:2 + */ + this.mode = builder.mode; + /** + * 任务创建的来源 + *

示例值:6 + */ + this.source = builder.source; + /** + * 任务的自定义完成配置 + *

示例值: + */ + this.customComplete = builder.customComplete; + /** + * 任务界面上的代码 + *

示例值:t6272302 + */ + this.taskId = builder.taskId; + /** + * 任务创建时间戳(ms) + *

示例值:1675742789470 + */ + this.createdAt = builder.createdAt; + /** + * 任务最后一次更新的时间戳(ms) + *

示例值:1675742789470 + */ + this.updatedAt = builder.updatedAt; + /** + * 任务的状态,支持"todo"和"done"两种状态 + *

示例值:todo + */ + this.status = builder.status; + /** + * 任务的分享链接 + *

示例值:https://applink.feishu.cn/client/todo/detail?guid=70577c8f-91ab-4c91-b359-a21a751054e8&suite_entity_num=t192012 + */ + this.url = builder.url; + /** + * 任务的开始时间 + *

示例值: + */ + this.start = builder.start; + /** + * 该任务的子任务的个数。 + *

示例值:1 + */ + this.subtaskCount = builder.subtaskCount; + /** + * 是否是里程碑任务 + *

示例值:false + */ + this.isMilestone = builder.isMilestone; + /** + * 任务的自定义字段值 + *

示例值: + */ + this.customFields = builder.customFields; + /** + * 任务依赖 + *

示例值: + */ + this.dependencies = builder.dependencies; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getGuid() { + return this.guid; + } + + public void setGuid(String guid) { + this.guid = guid; + } + + public String getSummary() { + return this.summary; + } + + public void setSummary(String summary) { + this.summary = summary; + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Due getDue() { + return this.due; + } + + public void setDue(Due due) { + this.due = due; + } + + public Reminder[] getReminders() { + return this.reminders; + } + + public void setReminders(Reminder[] reminders) { + this.reminders = reminders; + } + + public Member getCreator() { + return this.creator; + } + + public void setCreator(Member creator) { + this.creator = creator; + } + + public Member[] getMembers() { + return this.members; + } + + public void setMembers(Member[] members) { + this.members = members; + } + + public String getCompletedAt() { + return this.completedAt; + } + + public void setCompletedAt(String completedAt) { + this.completedAt = completedAt; + } + + public Attachment[] getAttachments() { + return this.attachments; + } + + public void setAttachments(Attachment[] attachments) { + this.attachments = attachments; + } + + public Origin getOrigin() { + return this.origin; + } + + public void setOrigin(Origin origin) { + this.origin = origin; + } + + public String getExtra() { + return this.extra; + } + + public void setExtra(String extra) { + this.extra = extra; + } + + public TaskInTasklistInfo[] getTasklists() { + return this.tasklists; + } + + public void setTasklists(TaskInTasklistInfo[] tasklists) { + this.tasklists = tasklists; + } + + public String getRepeatRule() { + return this.repeatRule; + } + + public void setRepeatRule(String repeatRule) { + this.repeatRule = repeatRule; + } + + public String getParentTaskGuid() { + return this.parentTaskGuid; + } + + public void setParentTaskGuid(String parentTaskGuid) { + this.parentTaskGuid = parentTaskGuid; + } + + public Integer getMode() { + return this.mode; + } + + public void setMode(Integer mode) { + this.mode = mode; + } + + public Integer getSource() { + return this.source; + } + + public void setSource(Integer source) { + this.source = source; + } + + public CustomComplete getCustomComplete() { + return this.customComplete; + } + + public void setCustomComplete(CustomComplete customComplete) { + this.customComplete = customComplete; + } + + public String getTaskId() { + return this.taskId; + } + + public void setTaskId(String taskId) { + this.taskId = taskId; + } + + public String getCreatedAt() { + return this.createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public String getUpdatedAt() { + return this.updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } + + public Start getStart() { + return this.start; + } + + public void setStart(Start start) { + this.start = start; + } + + public Integer getSubtaskCount() { + return this.subtaskCount; + } + + public void setSubtaskCount(Integer subtaskCount) { + this.subtaskCount = subtaskCount; + } + + public Boolean getIsMilestone() { + return this.isMilestone; + } + + public void setIsMilestone(Boolean isMilestone) { + this.isMilestone = isMilestone; + } + + public CustomFieldValue[] getCustomFields() { + return this.customFields; + } + + public void setCustomFields(CustomFieldValue[] customFields) { + this.customFields = customFields; + } + + public TaskDependency[] getDependencies() { + return this.dependencies; + } + + public void setDependencies(TaskDependency[] dependencies) { + this.dependencies = dependencies; + } + + public static class Builder { + /** + * 任务guid,任务的唯一ID + *

示例值:83912691-2e43-47fc-94a4-d512e03984fa + */ + private String guid; + /** + * 任务标题 + *

示例值:进行销售年中总结 + */ + private String summary; + /** + * 任务描述 + *

示例值:进行销售年中总结 + */ + private String description; + /** + * 任务截止时间 + *

示例值:1675742789470 + */ + private Due due; + /** + * 任务的提醒配置列表。目前每个任务最多有1个。 + *

示例值: + */ + private Reminder[] reminders; + /** + * 任务创建者 + *

示例值: + */ + private Member creator; + /** + * 任务成员列表 + *

示例值: + */ + private Member[] members; + /** + * 任务完成的时间戳(ms) + *

示例值:1675742789470 + */ + private String completedAt; + /** + * 任务的附件列表 + *

示例值: + */ + private Attachment[] attachments; + /** + * 任务关联的第三方平台来源信息。创建是设置后就不可更改。 + *

示例值: + */ + private Origin origin; + /** + * 任务附带的自定义数据。 + *

示例值:dGVzdA== + */ + private String extra; + /** + * 任务所属清单的名字。调用者只能看到有权限访问的清单的列表。 + *

示例值: + */ + private TaskInTasklistInfo[] tasklists; + /** + * 如果任务为重复任务,返回重复任务的配置 + *

示例值:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR + */ + private String repeatRule; + /** + * 如果当前任务为某个任务的子任务,返回父任务的guid + *

示例值:e297ddff-06ca-4166-b917-4ce57cd3a7a0 + */ + private String parentTaskGuid; + /** + * 任务的模式。1 - 会签任务;2 - 或签任务 + *

示例值:2 + */ + private Integer mode; + /** + * 任务创建的来源 + *

示例值:6 + */ + private Integer source; + /** + * 任务的自定义完成配置 + *

示例值: + */ + private CustomComplete customComplete; + /** + * 任务界面上的代码 + *

示例值:t6272302 + */ + private String taskId; + /** + * 任务创建时间戳(ms) + *

示例值:1675742789470 + */ + private String createdAt; + /** + * 任务最后一次更新的时间戳(ms) + *

示例值:1675742789470 + */ + private String updatedAt; + /** + * 任务的状态,支持"todo"和"done"两种状态 + *

示例值:todo + */ + private String status; + /** + * 任务的分享链接 + *

示例值:https://applink.feishu.cn/client/todo/detail?guid=70577c8f-91ab-4c91-b359-a21a751054e8&suite_entity_num=t192012 + */ + private String url; + /** + * 任务的开始时间 + *

示例值: + */ + private Start start; + /** + * 该任务的子任务的个数。 + *

示例值:1 + */ + private Integer subtaskCount; + /** + * 是否是里程碑任务 + *

示例值:false + */ + private Boolean isMilestone; + /** + * 任务的自定义字段值 + *

示例值: + */ + private CustomFieldValue[] customFields; + /** + * 任务依赖 + *

示例值: + */ + private TaskDependency[] dependencies; + + /** + * 任务guid,任务的唯一ID + *

示例值:83912691-2e43-47fc-94a4-d512e03984fa + * + * @param guid + * @return + */ + public Builder guid(String guid) { + this.guid = guid; + return this; + } + + + /** + * 任务标题 + *

示例值:进行销售年中总结 + * + * @param summary + * @return + */ + public Builder summary(String summary) { + this.summary = summary; + return this; + } + + + /** + * 任务描述 + *

示例值:进行销售年中总结 + * + * @param description + * @return + */ + public Builder description(String description) { + this.description = description; + return this; + } + + + /** + * 任务截止时间 + *

示例值:1675742789470 + * + * @param due + * @return + */ + public Builder due(Due due) { + this.due = due; + return this; + } + + + /** + * 任务的提醒配置列表。目前每个任务最多有1个。 + *

示例值: + * + * @param reminders + * @return + */ + public Builder reminders(Reminder[] reminders) { + this.reminders = reminders; + return this; + } + + + /** + * 任务创建者 + *

示例值: + * + * @param creator + * @return + */ + public Builder creator(Member creator) { + this.creator = creator; + return this; + } + + + /** + * 任务成员列表 + *

示例值: + * + * @param members + * @return + */ + public Builder members(Member[] members) { + this.members = members; + return this; + } + + + /** + * 任务完成的时间戳(ms) + *

示例值:1675742789470 + * + * @param completedAt + * @return + */ + public Builder completedAt(String completedAt) { + this.completedAt = completedAt; + return this; + } + + + /** + * 任务的附件列表 + *

示例值: + * + * @param attachments + * @return + */ + public Builder attachments(Attachment[] attachments) { + this.attachments = attachments; + return this; + } + + + /** + * 任务关联的第三方平台来源信息。创建是设置后就不可更改。 + *

示例值: + * + * @param origin + * @return + */ + public Builder origin(Origin origin) { + this.origin = origin; + return this; + } + + + /** + * 任务附带的自定义数据。 + *

示例值:dGVzdA== + * + * @param extra + * @return + */ + public Builder extra(String extra) { + this.extra = extra; + return this; + } + + + /** + * 任务所属清单的名字。调用者只能看到有权限访问的清单的列表。 + *

示例值: + * + * @param tasklists + * @return + */ + public Builder tasklists(TaskInTasklistInfo[] tasklists) { + this.tasklists = tasklists; + return this; + } + + + /** + * 如果任务为重复任务,返回重复任务的配置 + *

示例值:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR + * + * @param repeatRule + * @return + */ + public Builder repeatRule(String repeatRule) { + this.repeatRule = repeatRule; + return this; + } + + + /** + * 如果当前任务为某个任务的子任务,返回父任务的guid + *

示例值:e297ddff-06ca-4166-b917-4ce57cd3a7a0 + * + * @param parentTaskGuid + * @return + */ + public Builder parentTaskGuid(String parentTaskGuid) { + this.parentTaskGuid = parentTaskGuid; + return this; + } + + + /** + * 任务的模式。1 - 会签任务;2 - 或签任务 + *

示例值:2 + * + * @param mode + * @return + */ + public Builder mode(Integer mode) { + this.mode = mode; + return this; + } + + + /** + * 任务创建的来源 + *

示例值:6 + * + * @param source + * @return + */ + public Builder source(Integer source) { + this.source = source; + return this; + } + + /** + * 任务创建的来源 + *

示例值:6 + * + * @param source {@link com.lark.oapi.service.task.v2.enums.TaskSourceEnum} + * @return + */ + public Builder source(com.lark.oapi.service.task.v2.enums.TaskSourceEnum source) { + this.source = source.getValue(); + return this; + } + + + /** + * 任务的自定义完成配置 + *

示例值: + * + * @param customComplete + * @return + */ + public Builder customComplete(CustomComplete customComplete) { + this.customComplete = customComplete; + return this; + } + + + /** + * 任务界面上的代码 + *

示例值:t6272302 + * + * @param taskId + * @return + */ + public Builder taskId(String taskId) { + this.taskId = taskId; + return this; + } + + + /** + * 任务创建时间戳(ms) + *

示例值:1675742789470 + * + * @param createdAt + * @return + */ + public Builder createdAt(String createdAt) { + this.createdAt = createdAt; + return this; + } + + + /** + * 任务最后一次更新的时间戳(ms) + *

示例值:1675742789470 + * + * @param updatedAt + * @return + */ + public Builder updatedAt(String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + + /** + * 任务的状态,支持"todo"和"done"两种状态 + *

示例值:todo + * + * @param status + * @return + */ + public Builder status(String status) { + this.status = status; + return this; + } + + + /** + * 任务的分享链接 + *

示例值:https://applink.feishu.cn/client/todo/detail?guid=70577c8f-91ab-4c91-b359-a21a751054e8&suite_entity_num=t192012 + * + * @param url + * @return + */ + public Builder url(String url) { + this.url = url; + return this; + } + + + /** + * 任务的开始时间 + *

示例值: + * + * @param start + * @return + */ + public Builder start(Start start) { + this.start = start; + return this; + } + + + /** + * 该任务的子任务的个数。 + *

示例值:1 + * + * @param subtaskCount + * @return + */ + public Builder subtaskCount(Integer subtaskCount) { + this.subtaskCount = subtaskCount; + return this; + } + + + /** + * 是否是里程碑任务 + *

示例值:false + * + * @param isMilestone + * @return + */ + public Builder isMilestone(Boolean isMilestone) { + this.isMilestone = isMilestone; + return this; + } + + + /** + * 任务的自定义字段值 + *

示例值: + * + * @param customFields + * @return + */ + public Builder customFields(CustomFieldValue[] customFields) { + this.customFields = customFields; + return this; + } + + + /** + * 任务依赖 + *

示例值: + * + * @param dependencies + * @return + */ + public Builder dependencies(TaskDependency[] dependencies) { + this.dependencies = dependencies; + return this; + } + + + public Task build() { + return new Task(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TaskDependency.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TaskDependency.java new file mode 100644 index 000000000..341cdf906 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TaskDependency.java @@ -0,0 +1,123 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class TaskDependency { + /** + * 依赖类型 + *

示例值:next + */ + @SerializedName("type") + private String type; + /** + * 依赖任务的GUID + *

示例值:93b7bd05-35e6-4371-b3c9-6b7cbd7100c0 + */ + @SerializedName("task_guid") + private String taskGuid; + + // builder 开始 + public TaskDependency() { + } + + public TaskDependency(Builder builder) { + /** + * 依赖类型 + *

示例值:next + */ + this.type = builder.type; + /** + * 依赖任务的GUID + *

示例值:93b7bd05-35e6-4371-b3c9-6b7cbd7100c0 + */ + this.taskGuid = builder.taskGuid; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getTaskGuid() { + return this.taskGuid; + } + + public void setTaskGuid(String taskGuid) { + this.taskGuid = taskGuid; + } + + public static class Builder { + /** + * 依赖类型 + *

示例值:next + */ + private String type; + /** + * 依赖任务的GUID + *

示例值:93b7bd05-35e6-4371-b3c9-6b7cbd7100c0 + */ + private String taskGuid; + + /** + * 依赖类型 + *

示例值:next + * + * @param type + * @return + */ + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * 依赖类型 + *

示例值:next + * + * @param type {@link com.lark.oapi.service.task.v2.enums.TaskDependencyDependencyTypeEnum} + * @return + */ + public Builder type(com.lark.oapi.service.task.v2.enums.TaskDependencyDependencyTypeEnum type) { + this.type = type.getValue(); + return this; + } + + + /** + * 依赖任务的GUID + *

示例值:93b7bd05-35e6-4371-b3c9-6b7cbd7100c0 + * + * @param taskGuid + * @return + */ + public Builder taskGuid(String taskGuid) { + this.taskGuid = taskGuid; + return this; + } + + + public TaskDependency build() { + return new TaskDependency(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TaskInTasklistInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TaskInTasklistInfo.java new file mode 100644 index 000000000..06405f229 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TaskInTasklistInfo.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class TaskInTasklistInfo { + /** + * 任务所在清单的guid + *

示例值:cc371766-6584-cf50-a222-c22cd9055004 + */ + @SerializedName("tasklist_guid") + private String tasklistGuid; + /** + * 任务所在清单的自定义分组guid + *

示例值:e6e37dcc-f75a-5936-f589-12fb4b5c80c2 + */ + @SerializedName("section_guid") + private String sectionGuid; + + // builder 开始 + public TaskInTasklistInfo() { + } + + public TaskInTasklistInfo(Builder builder) { + /** + * 任务所在清单的guid + *

示例值:cc371766-6584-cf50-a222-c22cd9055004 + */ + this.tasklistGuid = builder.tasklistGuid; + /** + * 任务所在清单的自定义分组guid + *

示例值:e6e37dcc-f75a-5936-f589-12fb4b5c80c2 + */ + this.sectionGuid = builder.sectionGuid; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getTasklistGuid() { + return this.tasklistGuid; + } + + public void setTasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + } + + public String getSectionGuid() { + return this.sectionGuid; + } + + public void setSectionGuid(String sectionGuid) { + this.sectionGuid = sectionGuid; + } + + public static class Builder { + /** + * 任务所在清单的guid + *

示例值:cc371766-6584-cf50-a222-c22cd9055004 + */ + private String tasklistGuid; + /** + * 任务所在清单的自定义分组guid + *

示例值:e6e37dcc-f75a-5936-f589-12fb4b5c80c2 + */ + private String sectionGuid; + + /** + * 任务所在清单的guid + *

示例值:cc371766-6584-cf50-a222-c22cd9055004 + * + * @param tasklistGuid + * @return + */ + public Builder tasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + return this; + } + + + /** + * 任务所在清单的自定义分组guid + *

示例值:e6e37dcc-f75a-5936-f589-12fb4b5c80c2 + * + * @param sectionGuid + * @return + */ + public Builder sectionGuid(String sectionGuid) { + this.sectionGuid = sectionGuid; + return this; + } + + + public TaskInTasklistInfo build() { + return new TaskInTasklistInfo(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TaskStatistics.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TaskStatistics.java new file mode 100644 index 000000000..96992ff5f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TaskStatistics.java @@ -0,0 +1,148 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class TaskStatistics { + /** + * 任务总数 + *

示例值:12 + */ + @SerializedName("total_tasks_count") + private Integer totalTasksCount; + /** + * 已完成任务的数量 + *

示例值:5 + */ + @SerializedName("total_completed_tasks_count") + private Integer totalCompletedTasksCount; + /** + * 未完成任务的数量 + *

示例值:7 + */ + @SerializedName("total_uncompleted_tasks_count") + private Integer totalUncompletedTasksCount; + + // builder 开始 + public TaskStatistics() { + } + + public TaskStatistics(Builder builder) { + /** + * 任务总数 + *

示例值:12 + */ + this.totalTasksCount = builder.totalTasksCount; + /** + * 已完成任务的数量 + *

示例值:5 + */ + this.totalCompletedTasksCount = builder.totalCompletedTasksCount; + /** + * 未完成任务的数量 + *

示例值:7 + */ + this.totalUncompletedTasksCount = builder.totalUncompletedTasksCount; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Integer getTotalTasksCount() { + return this.totalTasksCount; + } + + public void setTotalTasksCount(Integer totalTasksCount) { + this.totalTasksCount = totalTasksCount; + } + + public Integer getTotalCompletedTasksCount() { + return this.totalCompletedTasksCount; + } + + public void setTotalCompletedTasksCount(Integer totalCompletedTasksCount) { + this.totalCompletedTasksCount = totalCompletedTasksCount; + } + + public Integer getTotalUncompletedTasksCount() { + return this.totalUncompletedTasksCount; + } + + public void setTotalUncompletedTasksCount(Integer totalUncompletedTasksCount) { + this.totalUncompletedTasksCount = totalUncompletedTasksCount; + } + + public static class Builder { + /** + * 任务总数 + *

示例值:12 + */ + private Integer totalTasksCount; + /** + * 已完成任务的数量 + *

示例值:5 + */ + private Integer totalCompletedTasksCount; + /** + * 未完成任务的数量 + *

示例值:7 + */ + private Integer totalUncompletedTasksCount; + + /** + * 任务总数 + *

示例值:12 + * + * @param totalTasksCount + * @return + */ + public Builder totalTasksCount(Integer totalTasksCount) { + this.totalTasksCount = totalTasksCount; + return this; + } + + + /** + * 已完成任务的数量 + *

示例值:5 + * + * @param totalCompletedTasksCount + * @return + */ + public Builder totalCompletedTasksCount(Integer totalCompletedTasksCount) { + this.totalCompletedTasksCount = totalCompletedTasksCount; + return this; + } + + + /** + * 未完成任务的数量 + *

示例值:7 + * + * @param totalUncompletedTasksCount + * @return + */ + public Builder totalUncompletedTasksCount(Integer totalUncompletedTasksCount) { + this.totalUncompletedTasksCount = totalUncompletedTasksCount; + return this; + } + + + public TaskStatistics build() { + return new TaskStatistics(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TaskSubtask.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TaskSubtask.java new file mode 100644 index 000000000..db5b8613e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TaskSubtask.java @@ -0,0 +1,35 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +public class TaskSubtask { + + // builder 开始 + public TaskSubtask() { + } + + public TaskSubtask(Builder builder) { + } + + public static Builder newBuilder() { + return new Builder(); + } + + public static class Builder { + + public TaskSubtask build() { + return new TaskSubtask(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TaskSummary.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TaskSummary.java new file mode 100644 index 000000000..22c1ad51a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TaskSummary.java @@ -0,0 +1,296 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class TaskSummary { + /** + * 任务GUID + *

示例值:e297ddff-06ca-4166-b917-4ce57cd3a7a0 + */ + @SerializedName("guid") + private String guid; + /** + * 任务的标题 + *

示例值:年终总结 + */ + @SerializedName("summary") + private String summary; + /** + * 任务完成的时间戳(ms),为0表示未完成 + *

示例值:1675742789470 + */ + @SerializedName("completed_at") + private String completedAt; + /** + * 任务开始时间 + *

示例值: + */ + @SerializedName("start") + private Start start; + /** + * 任务截止时间 + *

示例值: + */ + @SerializedName("due") + private Due due; + /** + * 任务成员列表 + *

示例值: + */ + @SerializedName("members") + private Member[] members; + /** + * 子任务的个数 + *

示例值:1 + */ + @SerializedName("subtask_count") + private Integer subtaskCount; + + // builder 开始 + public TaskSummary() { + } + + public TaskSummary(Builder builder) { + /** + * 任务GUID + *

示例值:e297ddff-06ca-4166-b917-4ce57cd3a7a0 + */ + this.guid = builder.guid; + /** + * 任务的标题 + *

示例值:年终总结 + */ + this.summary = builder.summary; + /** + * 任务完成的时间戳(ms),为0表示未完成 + *

示例值:1675742789470 + */ + this.completedAt = builder.completedAt; + /** + * 任务开始时间 + *

示例值: + */ + this.start = builder.start; + /** + * 任务截止时间 + *

示例值: + */ + this.due = builder.due; + /** + * 任务成员列表 + *

示例值: + */ + this.members = builder.members; + /** + * 子任务的个数 + *

示例值:1 + */ + this.subtaskCount = builder.subtaskCount; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getGuid() { + return this.guid; + } + + public void setGuid(String guid) { + this.guid = guid; + } + + public String getSummary() { + return this.summary; + } + + public void setSummary(String summary) { + this.summary = summary; + } + + public String getCompletedAt() { + return this.completedAt; + } + + public void setCompletedAt(String completedAt) { + this.completedAt = completedAt; + } + + public Start getStart() { + return this.start; + } + + public void setStart(Start start) { + this.start = start; + } + + public Due getDue() { + return this.due; + } + + public void setDue(Due due) { + this.due = due; + } + + public Member[] getMembers() { + return this.members; + } + + public void setMembers(Member[] members) { + this.members = members; + } + + public Integer getSubtaskCount() { + return this.subtaskCount; + } + + public void setSubtaskCount(Integer subtaskCount) { + this.subtaskCount = subtaskCount; + } + + public static class Builder { + /** + * 任务GUID + *

示例值:e297ddff-06ca-4166-b917-4ce57cd3a7a0 + */ + private String guid; + /** + * 任务的标题 + *

示例值:年终总结 + */ + private String summary; + /** + * 任务完成的时间戳(ms),为0表示未完成 + *

示例值:1675742789470 + */ + private String completedAt; + /** + * 任务开始时间 + *

示例值: + */ + private Start start; + /** + * 任务截止时间 + *

示例值: + */ + private Due due; + /** + * 任务成员列表 + *

示例值: + */ + private Member[] members; + /** + * 子任务的个数 + *

示例值:1 + */ + private Integer subtaskCount; + + /** + * 任务GUID + *

示例值:e297ddff-06ca-4166-b917-4ce57cd3a7a0 + * + * @param guid + * @return + */ + public Builder guid(String guid) { + this.guid = guid; + return this; + } + + + /** + * 任务的标题 + *

示例值:年终总结 + * + * @param summary + * @return + */ + public Builder summary(String summary) { + this.summary = summary; + return this; + } + + + /** + * 任务完成的时间戳(ms),为0表示未完成 + *

示例值:1675742789470 + * + * @param completedAt + * @return + */ + public Builder completedAt(String completedAt) { + this.completedAt = completedAt; + return this; + } + + + /** + * 任务开始时间 + *

示例值: + * + * @param start + * @return + */ + public Builder start(Start start) { + this.start = start; + return this; + } + + + /** + * 任务截止时间 + *

示例值: + * + * @param due + * @return + */ + public Builder due(Due due) { + this.due = due; + return this; + } + + + /** + * 任务成员列表 + *

示例值: + * + * @param members + * @return + */ + public Builder members(Member[] members) { + this.members = members; + return this; + } + + + /** + * 子任务的个数 + *

示例值:1 + * + * @param subtaskCount + * @return + */ + public Builder subtaskCount(Integer subtaskCount) { + this.subtaskCount = subtaskCount; + return this; + } + + + public TaskSummary build() { + return new TaskSummary(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Tasklist.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Tasklist.java new file mode 100644 index 000000000..bbb24a8f9 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/Tasklist.java @@ -0,0 +1,333 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class Tasklist { + /** + * 清单的全局唯一ID + *

示例值:cc371766-6584-cf50-a222-c22cd9055004 + */ + @SerializedName("guid") + private String guid; + /** + * 清单名 + *

示例值:年会总结工作任务清单 + */ + @SerializedName("name") + private String name; + /** + * 清单创建者 + *

示例值: + */ + @SerializedName("creator") + private Member creator; + /** + * 清单负责人 + *

示例值: + */ + @SerializedName("owner") + private Member owner; + /** + * 清单协作人 + *

示例值: + */ + @SerializedName("members") + private Member[] members; + /** + * 该清单分享的applink + *

示例值:https://applink.feishu.cn/client/todo/task_list?guid=b45b360f-1961-4058-b338-7f50c96e1b52 + */ + @SerializedName("url") + private String url; + /** + * 清单创建时间戳(ms) + *

示例值:1675742789470 + */ + @SerializedName("created_at") + private String createdAt; + /** + * 清单最后一次更新时间戳(ms) + *

示例值:1675742789470 + */ + @SerializedName("updated_at") + private String updatedAt; + + // builder 开始 + public Tasklist() { + } + + public Tasklist(Builder builder) { + /** + * 清单的全局唯一ID + *

示例值:cc371766-6584-cf50-a222-c22cd9055004 + */ + this.guid = builder.guid; + /** + * 清单名 + *

示例值:年会总结工作任务清单 + */ + this.name = builder.name; + /** + * 清单创建者 + *

示例值: + */ + this.creator = builder.creator; + /** + * 清单负责人 + *

示例值: + */ + this.owner = builder.owner; + /** + * 清单协作人 + *

示例值: + */ + this.members = builder.members; + /** + * 该清单分享的applink + *

示例值:https://applink.feishu.cn/client/todo/task_list?guid=b45b360f-1961-4058-b338-7f50c96e1b52 + */ + this.url = builder.url; + /** + * 清单创建时间戳(ms) + *

示例值:1675742789470 + */ + this.createdAt = builder.createdAt; + /** + * 清单最后一次更新时间戳(ms) + *

示例值:1675742789470 + */ + this.updatedAt = builder.updatedAt; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getGuid() { + return this.guid; + } + + public void setGuid(String guid) { + this.guid = guid; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public Member getCreator() { + return this.creator; + } + + public void setCreator(Member creator) { + this.creator = creator; + } + + public Member getOwner() { + return this.owner; + } + + public void setOwner(Member owner) { + this.owner = owner; + } + + public Member[] getMembers() { + return this.members; + } + + public void setMembers(Member[] members) { + this.members = members; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getCreatedAt() { + return this.createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public String getUpdatedAt() { + return this.updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + public static class Builder { + /** + * 清单的全局唯一ID + *

示例值:cc371766-6584-cf50-a222-c22cd9055004 + */ + private String guid; + /** + * 清单名 + *

示例值:年会总结工作任务清单 + */ + private String name; + /** + * 清单创建者 + *

示例值: + */ + private Member creator; + /** + * 清单负责人 + *

示例值: + */ + private Member owner; + /** + * 清单协作人 + *

示例值: + */ + private Member[] members; + /** + * 该清单分享的applink + *

示例值:https://applink.feishu.cn/client/todo/task_list?guid=b45b360f-1961-4058-b338-7f50c96e1b52 + */ + private String url; + /** + * 清单创建时间戳(ms) + *

示例值:1675742789470 + */ + private String createdAt; + /** + * 清单最后一次更新时间戳(ms) + *

示例值:1675742789470 + */ + private String updatedAt; + + /** + * 清单的全局唯一ID + *

示例值:cc371766-6584-cf50-a222-c22cd9055004 + * + * @param guid + * @return + */ + public Builder guid(String guid) { + this.guid = guid; + return this; + } + + + /** + * 清单名 + *

示例值:年会总结工作任务清单 + * + * @param name + * @return + */ + public Builder name(String name) { + this.name = name; + return this; + } + + + /** + * 清单创建者 + *

示例值: + * + * @param creator + * @return + */ + public Builder creator(Member creator) { + this.creator = creator; + return this; + } + + + /** + * 清单负责人 + *

示例值: + * + * @param owner + * @return + */ + public Builder owner(Member owner) { + this.owner = owner; + return this; + } + + + /** + * 清单协作人 + *

示例值: + * + * @param members + * @return + */ + public Builder members(Member[] members) { + this.members = members; + return this; + } + + + /** + * 该清单分享的applink + *

示例值:https://applink.feishu.cn/client/todo/task_list?guid=b45b360f-1961-4058-b338-7f50c96e1b52 + * + * @param url + * @return + */ + public Builder url(String url) { + this.url = url; + return this; + } + + + /** + * 清单创建时间戳(ms) + *

示例值:1675742789470 + * + * @param createdAt + * @return + */ + public Builder createdAt(String createdAt) { + this.createdAt = createdAt; + return this; + } + + + /** + * 清单最后一次更新时间戳(ms) + *

示例值:1675742789470 + * + * @param updatedAt + * @return + */ + public Builder updatedAt(String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + + public Tasklist build() { + return new Tasklist(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasklistActivitySubscription.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasklistActivitySubscription.java new file mode 100644 index 000000000..5d808c363 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasklistActivitySubscription.java @@ -0,0 +1,222 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class TasklistActivitySubscription { + /** + * 订阅guid + *

示例值:d19e3a2a-edc0-4e4e-b7cc-950e162b53ae + */ + @SerializedName("guid") + private String guid; + /** + * 订阅名称 + *

示例值:Roadmap订阅 + */ + @SerializedName("name") + private String name; + /** + * 订阅者 + *

示例值: + */ + @SerializedName("subscribers") + private Member[] subscribers; + /** + * 要订阅的清单动态类型 + *

示例值: + */ + @SerializedName("include_keys") + private Integer[] includeKeys; + /** + * 该订阅是否为停用 + *

示例值:false + */ + @SerializedName("disabled") + private Boolean disabled; + + // builder 开始 + public TasklistActivitySubscription() { + } + + public TasklistActivitySubscription(Builder builder) { + /** + * 订阅guid + *

示例值:d19e3a2a-edc0-4e4e-b7cc-950e162b53ae + */ + this.guid = builder.guid; + /** + * 订阅名称 + *

示例值:Roadmap订阅 + */ + this.name = builder.name; + /** + * 订阅者 + *

示例值: + */ + this.subscribers = builder.subscribers; + /** + * 要订阅的清单动态类型 + *

示例值: + */ + this.includeKeys = builder.includeKeys; + /** + * 该订阅是否为停用 + *

示例值:false + */ + this.disabled = builder.disabled; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getGuid() { + return this.guid; + } + + public void setGuid(String guid) { + this.guid = guid; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public Member[] getSubscribers() { + return this.subscribers; + } + + public void setSubscribers(Member[] subscribers) { + this.subscribers = subscribers; + } + + public Integer[] getIncludeKeys() { + return this.includeKeys; + } + + public void setIncludeKeys(Integer[] includeKeys) { + this.includeKeys = includeKeys; + } + + public Boolean getDisabled() { + return this.disabled; + } + + public void setDisabled(Boolean disabled) { + this.disabled = disabled; + } + + public static class Builder { + /** + * 订阅guid + *

示例值:d19e3a2a-edc0-4e4e-b7cc-950e162b53ae + */ + private String guid; + /** + * 订阅名称 + *

示例值:Roadmap订阅 + */ + private String name; + /** + * 订阅者 + *

示例值: + */ + private Member[] subscribers; + /** + * 要订阅的清单动态类型 + *

示例值: + */ + private Integer[] includeKeys; + /** + * 该订阅是否为停用 + *

示例值:false + */ + private Boolean disabled; + + /** + * 订阅guid + *

示例值:d19e3a2a-edc0-4e4e-b7cc-950e162b53ae + * + * @param guid + * @return + */ + public Builder guid(String guid) { + this.guid = guid; + return this; + } + + + /** + * 订阅名称 + *

示例值:Roadmap订阅 + * + * @param name + * @return + */ + public Builder name(String name) { + this.name = name; + return this; + } + + + /** + * 订阅者 + *

示例值: + * + * @param subscribers + * @return + */ + public Builder subscribers(Member[] subscribers) { + this.subscribers = subscribers; + return this; + } + + + /** + * 要订阅的清单动态类型 + *

示例值: + * + * @param includeKeys + * @return + */ + public Builder includeKeys(Integer[] includeKeys) { + this.includeKeys = includeKeys; + return this; + } + + + /** + * 该订阅是否为停用 + *

示例值:false + * + * @param disabled + * @return + */ + public Builder disabled(Boolean disabled) { + this.disabled = disabled; + return this; + } + + + public TasklistActivitySubscription build() { + return new TasklistActivitySubscription(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasklistSummary.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasklistSummary.java new file mode 100644 index 000000000..ec85879a3 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasklistSummary.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class TasklistSummary { + /** + * 清单的全局唯一ID + *

示例值:cc371766-6584-cf50-a222-c22cd9055004 + */ + @SerializedName("guid") + private String guid; + /** + * 清单名字 + *

示例值:活动分工任务列表 + */ + @SerializedName("name") + private String name; + + // builder 开始 + public TasklistSummary() { + } + + public TasklistSummary(Builder builder) { + /** + * 清单的全局唯一ID + *

示例值:cc371766-6584-cf50-a222-c22cd9055004 + */ + this.guid = builder.guid; + /** + * 清单名字 + *

示例值:活动分工任务列表 + */ + this.name = builder.name; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getGuid() { + return this.guid; + } + + public void setGuid(String guid) { + this.guid = guid; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public static class Builder { + /** + * 清单的全局唯一ID + *

示例值:cc371766-6584-cf50-a222-c22cd9055004 + */ + private String guid; + /** + * 清单名字 + *

示例值:活动分工任务列表 + */ + private String name; + + /** + * 清单的全局唯一ID + *

示例值:cc371766-6584-cf50-a222-c22cd9055004 + * + * @param guid + * @return + */ + public Builder guid(String guid) { + this.guid = guid; + return this; + } + + + /** + * 清单名字 + *

示例值:活动分工任务列表 + * + * @param name + * @return + */ + public Builder name(String name) { + this.name = name; + return this; + } + + + public TasklistSummary build() { + return new TasklistSummary(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasklistsTaskReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasklistsTaskReq.java new file mode 100644 index 000000000..16e3e7526 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasklistsTaskReq.java @@ -0,0 +1,72 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Path; + +public class TasklistsTaskReq { + /** + * 要获取清单列表的任务的全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + @Path + @SerializedName("task_guid") + private String taskGuid; + + // builder 开始 + public TasklistsTaskReq() { + } + + public TasklistsTaskReq(Builder builder) { + /** + * 要获取清单列表的任务的全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + this.taskGuid = builder.taskGuid; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getTaskGuid() { + return this.taskGuid; + } + + public void setTaskGuid(String taskGuid) { + this.taskGuid = taskGuid; + } + + public static class Builder { + + private String taskGuid; // 要获取清单列表的任务的全局唯一ID + + /** + * 要获取清单列表的任务的全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + * + * @param taskGuid + * @return + */ + public Builder taskGuid(String taskGuid) { + this.taskGuid = taskGuid; + return this; + } + + public TasklistsTaskReq build() { + return new TasklistsTaskReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasklistsTaskResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasklistsTaskResp.java new file mode 100644 index 000000000..a08fb732c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasklistsTaskResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class TasklistsTaskResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasklistsTaskRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasklistsTaskRespBody.java new file mode 100644 index 000000000..3ceb16501 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasklistsTaskRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class TasklistsTaskRespBody { + /** + * 任务所在清单的摘要信息 + *

示例值: + */ + @SerializedName("tasklists") + private TaskInTasklistInfo[] tasklists; + + public TaskInTasklistInfo[] getTasklists() { + return this.tasklists; + } + + public void setTasklists(TaskInTasklistInfo[] tasklists) { + this.tasklists = tasklists; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasksSectionReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasksSectionReq.java new file mode 100644 index 000000000..3b4566c0a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasksSectionReq.java @@ -0,0 +1,270 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class TasksSectionReq { + /** + * 分页大小 + *

示例值:50 + */ + @Query + @SerializedName("page_size") + private Integer pageSize; + /** + * 分页标记 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + @Query + @SerializedName("page_token") + private String pageToken; + /** + * 按照任务状态过滤,如果不填写则表示不按完成状态过滤 + *

示例值:true + */ + @Query + @SerializedName("completed") + private Boolean completed; + /** + * 按照创建时间筛选的起始时间戳(ms),如不填写则为首个任务的创建时刻 + *

示例值:1675742789470 + */ + @Query + @SerializedName("created_from") + private String createdFrom; + /** + * 按照创建时间筛选的起始时间戳(ms),如不填写则为最后任务的创建时刻 + *

示例值:1675742789470 + */ + @Query + @SerializedName("created_to") + private String createdTo; + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 要获取任务的自定义分组全局唯一ID + *

示例值:9842501a-9f47-4ff5-a622-d319eeecb97f + */ + @Path + @SerializedName("section_guid") + private String sectionGuid; + + // builder 开始 + public TasksSectionReq() { + } + + public TasksSectionReq(Builder builder) { + /** + * 分页大小 + *

示例值:50 + */ + this.pageSize = builder.pageSize; + /** + * 分页标记 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + this.pageToken = builder.pageToken; + /** + * 按照任务状态过滤,如果不填写则表示不按完成状态过滤 + *

示例值:true + */ + this.completed = builder.completed; + /** + * 按照创建时间筛选的起始时间戳(ms),如不填写则为首个任务的创建时刻 + *

示例值:1675742789470 + */ + this.createdFrom = builder.createdFrom; + /** + * 按照创建时间筛选的起始时间戳(ms),如不填写则为最后任务的创建时刻 + *

示例值:1675742789470 + */ + this.createdTo = builder.createdTo; + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 要获取任务的自定义分组全局唯一ID + *

示例值:9842501a-9f47-4ff5-a622-d319eeecb97f + */ + this.sectionGuid = builder.sectionGuid; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Integer getPageSize() { + return this.pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public Boolean getCompleted() { + return this.completed; + } + + public void setCompleted(Boolean completed) { + this.completed = completed; + } + + public String getCreatedFrom() { + return this.createdFrom; + } + + public void setCreatedFrom(String createdFrom) { + this.createdFrom = createdFrom; + } + + public String getCreatedTo() { + return this.createdTo; + } + + public void setCreatedTo(String createdTo) { + this.createdTo = createdTo; + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getSectionGuid() { + return this.sectionGuid; + } + + public void setSectionGuid(String sectionGuid) { + this.sectionGuid = sectionGuid; + } + + public static class Builder { + private Integer pageSize; // 分页大小 + private String pageToken; // 分页标记 + private Boolean completed; // 按照任务状态过滤,如果不填写则表示不按完成状态过滤 + private String createdFrom; // 按照创建时间筛选的起始时间戳(ms),如不填写则为首个任务的创建时刻 + private String createdTo; // 按照创建时间筛选的起始时间戳(ms),如不填写则为最后任务的创建时刻 + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private String sectionGuid; // 要获取任务的自定义分组全局唯一ID + + /** + * 分页大小 + *

示例值:50 + * + * @param pageSize + * @return + */ + public Builder pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * 分页标记 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + * + * @param pageToken + * @return + */ + public Builder pageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + /** + * 按照任务状态过滤,如果不填写则表示不按完成状态过滤 + *

示例值:true + * + * @param completed + * @return + */ + public Builder completed(Boolean completed) { + this.completed = completed; + return this; + } + + /** + * 按照创建时间筛选的起始时间戳(ms),如不填写则为首个任务的创建时刻 + *

示例值:1675742789470 + * + * @param createdFrom + * @return + */ + public Builder createdFrom(String createdFrom) { + this.createdFrom = createdFrom; + return this; + } + + /** + * 按照创建时间筛选的起始时间戳(ms),如不填写则为最后任务的创建时刻 + *

示例值:1675742789470 + * + * @param createdTo + * @return + */ + public Builder createdTo(String createdTo) { + this.createdTo = createdTo; + return this; + } + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 要获取任务的自定义分组全局唯一ID + *

示例值:9842501a-9f47-4ff5-a622-d319eeecb97f + * + * @param sectionGuid + * @return + */ + public Builder sectionGuid(String sectionGuid) { + this.sectionGuid = sectionGuid; + return this; + } + + public TasksSectionReq build() { + return new TasksSectionReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasksSectionResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasksSectionResp.java new file mode 100644 index 000000000..010a6d135 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasksSectionResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class TasksSectionResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasksSectionRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasksSectionRespBody.java new file mode 100644 index 000000000..25ea1d4b5 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasksSectionRespBody.java @@ -0,0 +1,62 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class TasksSectionRespBody { + /** + * 任务摘要信息 + *

示例值: + */ + @SerializedName("items") + private TaskSummary[] items; + /** + * 获取下一页的分页标记,无更多数据时返回空 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + @SerializedName("page_token") + private String pageToken; + /** + * 是否有更多数据 + *

示例值:true + */ + @SerializedName("has_more") + private Boolean hasMore; + + public TaskSummary[] getItems() { + return this.items; + } + + public void setItems(TaskSummary[] items) { + this.items = items; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public Boolean getHasMore() { + return this.hasMore; + } + + public void setHasMore(Boolean hasMore) { + this.hasMore = hasMore; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasksTasklistReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasksTasklistReq.java new file mode 100644 index 000000000..04507b334 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasksTasklistReq.java @@ -0,0 +1,270 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Path; +import com.lark.oapi.core.annotation.Query; + +public class TasksTasklistReq { + /** + * 每页返回的任务数量 + *

示例值:50 + */ + @Query + @SerializedName("page_size") + private Integer pageSize; + /** + * 分页标记。第一次请求不填该参数,表示从头开始查询;查询结果若还有更多数据时会同时返回新的 page_token。使用page_token重新调用本接口可以获取下一页数据。 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + @Query + @SerializedName("page_token") + private String pageToken; + /** + * 只查看特定完成状态的任务,不填写表示不按完成状态过滤 + *

示例值:true + */ + @Query + @SerializedName("completed") + private Boolean completed; + /** + * 任务创建的起始时间戳(ms),闭区间,不填写默认为首个任务的创建时间戳 + *

示例值:1675742789470 + */ + @Query + @SerializedName("created_from") + private String createdFrom; + /** + * 任务创建的结束时间戳(ms),闭区间,不填写默认为最后创建任务的创建时间戳 + *

示例值:1675742789470 + */ + @Query + @SerializedName("created_to") + private String createdTo; + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + /** + * 要获取任务的清单全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + @Path + @SerializedName("tasklist_guid") + private String tasklistGuid; + + // builder 开始 + public TasksTasklistReq() { + } + + public TasksTasklistReq(Builder builder) { + /** + * 每页返回的任务数量 + *

示例值:50 + */ + this.pageSize = builder.pageSize; + /** + * 分页标记。第一次请求不填该参数,表示从头开始查询;查询结果若还有更多数据时会同时返回新的 page_token。使用page_token重新调用本接口可以获取下一页数据。 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + this.pageToken = builder.pageToken; + /** + * 只查看特定完成状态的任务,不填写表示不按完成状态过滤 + *

示例值:true + */ + this.completed = builder.completed; + /** + * 任务创建的起始时间戳(ms),闭区间,不填写默认为首个任务的创建时间戳 + *

示例值:1675742789470 + */ + this.createdFrom = builder.createdFrom; + /** + * 任务创建的结束时间戳(ms),闭区间,不填写默认为最后创建任务的创建时间戳 + *

示例值:1675742789470 + */ + this.createdTo = builder.createdTo; + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + /** + * 要获取任务的清单全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + */ + this.tasklistGuid = builder.tasklistGuid; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Integer getPageSize() { + return this.pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public Boolean getCompleted() { + return this.completed; + } + + public void setCompleted(Boolean completed) { + this.completed = completed; + } + + public String getCreatedFrom() { + return this.createdFrom; + } + + public void setCreatedFrom(String createdFrom) { + this.createdFrom = createdFrom; + } + + public String getCreatedTo() { + return this.createdTo; + } + + public void setCreatedTo(String createdTo) { + this.createdTo = createdTo; + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public String getTasklistGuid() { + return this.tasklistGuid; + } + + public void setTasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + } + + public static class Builder { + private Integer pageSize; // 每页返回的任务数量 + private String pageToken; // 分页标记。第一次请求不填该参数,表示从头开始查询;查询结果若还有更多数据时会同时返回新的 page_token。使用page_token重新调用本接口可以获取下一页数据。 + private Boolean completed; // 只查看特定完成状态的任务,不填写表示不按完成状态过滤 + private String createdFrom; // 任务创建的起始时间戳(ms),闭区间,不填写默认为首个任务的创建时间戳 + private String createdTo; // 任务创建的结束时间戳(ms),闭区间,不填写默认为最后创建任务的创建时间戳 + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private String tasklistGuid; // 要获取任务的清单全局唯一ID + + /** + * 每页返回的任务数量 + *

示例值:50 + * + * @param pageSize + * @return + */ + public Builder pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * 分页标记。第一次请求不填该参数,表示从头开始查询;查询结果若还有更多数据时会同时返回新的 page_token。使用page_token重新调用本接口可以获取下一页数据。 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + * + * @param pageToken + * @return + */ + public Builder pageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + /** + * 只查看特定完成状态的任务,不填写表示不按完成状态过滤 + *

示例值:true + * + * @param completed + * @return + */ + public Builder completed(Boolean completed) { + this.completed = completed; + return this; + } + + /** + * 任务创建的起始时间戳(ms),闭区间,不填写默认为首个任务的创建时间戳 + *

示例值:1675742789470 + * + * @param createdFrom + * @return + */ + public Builder createdFrom(String createdFrom) { + this.createdFrom = createdFrom; + return this; + } + + /** + * 任务创建的结束时间戳(ms),闭区间,不填写默认为最后创建任务的创建时间戳 + *

示例值:1675742789470 + * + * @param createdTo + * @return + */ + public Builder createdTo(String createdTo) { + this.createdTo = createdTo; + return this; + } + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 要获取任务的清单全局唯一ID + *

示例值:d300a75f-c56a-4be9-80d1-e47653028ceb + * + * @param tasklistGuid + * @return + */ + public Builder tasklistGuid(String tasklistGuid) { + this.tasklistGuid = tasklistGuid; + return this; + } + + public TasksTasklistReq build() { + return new TasksTasklistReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasksTasklistResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasksTasklistResp.java new file mode 100644 index 000000000..20088e96c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasksTasklistResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class TasksTasklistResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasksTasklistRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasksTasklistRespBody.java new file mode 100644 index 000000000..d53a5a281 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TasksTasklistRespBody.java @@ -0,0 +1,62 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class TasksTasklistRespBody { + /** + * 任务摘要数据 + *

示例值: + */ + @SerializedName("items") + private TaskSummary[] items; + /** + * 用于获取下一页的分页标记,最后一页时发返回空 + *

示例值:aWQ9NzEwMjMzMjMxMDE= + */ + @SerializedName("page_token") + private String pageToken; + /** + * 是否有更多数据 + *

示例值:true + */ + @SerializedName("has_more") + private Boolean hasMore; + + public TaskSummary[] getItems() { + return this.items; + } + + public void setItems(TaskSummary[] items) { + this.items = items; + } + + public String getPageToken() { + return this.pageToken; + } + + public void setPageToken(String pageToken) { + this.pageToken = pageToken; + } + + public Boolean getHasMore() { + return this.hasMore; + } + + public void setHasMore(Boolean hasMore) { + this.hasMore = hasMore; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TextSetting.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TextSetting.java new file mode 100644 index 000000000..0d4f84536 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/TextSetting.java @@ -0,0 +1,35 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +public class TextSetting { + + // builder 开始 + public TextSetting() { + } + + public TextSetting(Builder builder) { + } + + public static Builder newBuilder() { + return new Builder(); + } + + public static class Builder { + + public TextSetting build() { + return new TextSetting(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/UploadAttachmentReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/UploadAttachmentReq.java new file mode 100644 index 000000000..882e4283f --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/UploadAttachmentReq.java @@ -0,0 +1,111 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.lark.oapi.core.annotation.Body; +import com.lark.oapi.core.annotation.Query; + +public class UploadAttachmentReq { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + @Query + @SerializedName("user_id_type") + private String userIdType; + @Body + private InputAttachment body; + + // builder 开始 + public UploadAttachmentReq() { + } + + public UploadAttachmentReq(Builder builder) { + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + */ + this.userIdType = builder.userIdType; + this.body = builder.body; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public String getUserIdType() { + return this.userIdType; + } + + public void setUserIdType(String userIdType) { + this.userIdType = userIdType; + } + + public InputAttachment getInputAttachment() { + return this.body; + } + + public void setInputAttachment(InputAttachment body) { + this.body = body; + } + + public static class Builder { + private String userIdType; // 表示user的ID的类型,支持open_id, user_id, union_id + private InputAttachment body; + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType + * @return + */ + public Builder userIdType(String userIdType) { + this.userIdType = userIdType; + return this; + } + + /** + * 表示user的ID的类型,支持open_id, user_id, union_id + *

示例值:open_id + * + * @param userIdType {@link com.lark.oapi.service.task.v2.enums.UploadAttachmentUserIdTypeEnum} + * @return + */ + public Builder userIdType(com.lark.oapi.service.task.v2.enums.UploadAttachmentUserIdTypeEnum userIdType) { + this.userIdType = userIdType.getValue(); + return this; + } + + public InputAttachment getInputAttachment() { + return this.body; + } + + /** + * body + * + * @param body + * @return + */ + public Builder inputAttachment(InputAttachment body) { + this.body = body; + return this; + } + + public UploadAttachmentReq build() { + return new UploadAttachmentReq(this); + } + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/UploadAttachmentResp.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/UploadAttachmentResp.java new file mode 100644 index 000000000..17a0dd0d6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/UploadAttachmentResp.java @@ -0,0 +1,19 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.lark.oapi.core.response.BaseResponse; + +public class UploadAttachmentResp extends BaseResponse { +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/UploadAttachmentRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/UploadAttachmentRespBody.java new file mode 100644 index 000000000..8f5e199e7 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/model/UploadAttachmentRespBody.java @@ -0,0 +1,34 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.model; + +import com.google.gson.annotations.SerializedName; + +public class UploadAttachmentRespBody { + /** + * 上传的附件列表 + *

示例值: + */ + @SerializedName("items") + private Attachment[] items; + + public Attachment[] getItems() { + return this.items; + } + + public void setItems(Attachment[] items) { + this.items = items; + } + +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/Attachment.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/Attachment.java new file mode 100644 index 000000000..42fa30ec6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/Attachment.java @@ -0,0 +1,304 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.task.v2.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Attachment { + private static final Logger log = LoggerFactory.getLogger(Attachment.class); + private final Config config; + + public Attachment(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=task&resource=attachment&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteAttachmentSample.java ; + */ + public DeleteAttachmentResp delete(DeleteAttachmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/task/v2/attachments/:attachment_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteAttachmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAttachmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/attachments/:attachment_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=task&resource=attachment&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteAttachmentSample.java ; + */ + public DeleteAttachmentResp delete(DeleteAttachmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/task/v2/attachments/:attachment_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteAttachmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteAttachmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/attachments/:attachment_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=task&resource=attachment&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetAttachmentSample.java ; + */ + public GetAttachmentResp get(GetAttachmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/attachments/:attachment_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetAttachmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAttachmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/attachments/:attachment_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=task&resource=attachment&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetAttachmentSample.java ; + */ + public GetAttachmentResp get(GetAttachmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/attachments/:attachment_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetAttachmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetAttachmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/attachments/:attachment_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=task&resource=attachment&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListAttachmentSample.java ; + */ + public ListAttachmentResp list(ListAttachmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/attachments" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListAttachmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAttachmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/attachments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=task&resource=attachment&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListAttachmentSample.java ; + */ + public ListAttachmentResp list(ListAttachmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/attachments" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListAttachmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAttachmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/attachments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=upload&project=task&resource=attachment&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/UploadAttachmentSample.java ; + */ + public UploadAttachmentResp upload(UploadAttachmentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/attachments/upload" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UploadAttachmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadAttachmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/attachments/upload" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=upload&project=task&resource=attachment&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/UploadAttachmentSample.java ; + */ + public UploadAttachmentResp upload(UploadAttachmentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportUpload(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/attachments/upload" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UploadAttachmentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UploadAttachmentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/attachments/upload" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/Comment.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/Comment.java new file mode 100644 index 000000000..a67d33ae6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/Comment.java @@ -0,0 +1,368 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.task.v2.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Comment { + private static final Logger log = LoggerFactory.getLogger(Comment.class); + private final Config config; + + public Comment(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=task&resource=comment&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateCommentSample.java ; + */ + public CreateCommentResp create(CreateCommentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/comments" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/comments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=task&resource=comment&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateCommentSample.java ; + */ + public CreateCommentResp create(CreateCommentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/comments" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/comments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=task&resource=comment&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteCommentSample.java ; + */ + public DeleteCommentResp delete(DeleteCommentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/task/v2/comments/:comment_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/comments/:comment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=task&resource=comment&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteCommentSample.java ; + */ + public DeleteCommentResp delete(DeleteCommentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/task/v2/comments/:comment_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/comments/:comment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=task&resource=comment&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetCommentSample.java ; + */ + public GetCommentResp get(GetCommentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/comments/:comment_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/comments/:comment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=task&resource=comment&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetCommentSample.java ; + */ + public GetCommentResp get(GetCommentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/comments/:comment_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/comments/:comment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=task&resource=comment&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListCommentSample.java ; + */ + public ListCommentResp list(ListCommentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/comments" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/comments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=task&resource=comment&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListCommentSample.java ; + */ + public ListCommentResp list(ListCommentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/comments" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/comments" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=task&resource=comment&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchCommentSample.java ; + */ + public PatchCommentResp patch(PatchCommentReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/task/v2/comments/:comment_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/comments/:comment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=task&resource=comment&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchCommentSample.java ; + */ + public PatchCommentResp patch(PatchCommentReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/task/v2/comments/:comment_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchCommentResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchCommentResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/comments/:comment_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/CustomField.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/CustomField.java new file mode 100644 index 000000000..85cc32686 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/CustomField.java @@ -0,0 +1,434 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.task.v2.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class CustomField { + private static final Logger log = LoggerFactory.getLogger(CustomField.class); + private final Config config; + + public CustomField(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=add&project=task&resource=custom_field&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddCustomFieldSample.java ; + */ + public AddCustomFieldResp add(AddCustomFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/custom_fields/:custom_field_guid/add" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + AddCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/custom_fields/:custom_field_guid/add" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=add&project=task&resource=custom_field&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddCustomFieldSample.java ; + */ + public AddCustomFieldResp add(AddCustomFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/custom_fields/:custom_field_guid/add" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + AddCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/custom_fields/:custom_field_guid/add" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=task&resource=custom_field&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateCustomFieldSample.java ; + */ + public CreateCustomFieldResp create(CreateCustomFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/custom_fields" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/custom_fields" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=task&resource=custom_field&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateCustomFieldSample.java ; + */ + public CreateCustomFieldResp create(CreateCustomFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/custom_fields" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/custom_fields" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=task&resource=custom_field&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetCustomFieldSample.java ; + */ + public GetCustomFieldResp get(GetCustomFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/custom_fields/:custom_field_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/custom_fields/:custom_field_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=task&resource=custom_field&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetCustomFieldSample.java ; + */ + public GetCustomFieldResp get(GetCustomFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/custom_fields/:custom_field_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/custom_fields/:custom_field_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=task&resource=custom_field&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListCustomFieldSample.java ; + */ + public ListCustomFieldResp list(ListCustomFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/custom_fields" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/custom_fields" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=task&resource=custom_field&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListCustomFieldSample.java ; + */ + public ListCustomFieldResp list(ListCustomFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/custom_fields" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/custom_fields" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=task&resource=custom_field&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchCustomFieldSample.java ; + */ + public PatchCustomFieldResp patch(PatchCustomFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/task/v2/custom_fields/:custom_field_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/custom_fields/:custom_field_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=task&resource=custom_field&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchCustomFieldSample.java ; + */ + public PatchCustomFieldResp patch(PatchCustomFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/task/v2/custom_fields/:custom_field_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/custom_fields/:custom_field_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove&project=task&resource=custom_field&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveCustomFieldSample.java ; + */ + public RemoveCustomFieldResp remove(RemoveCustomFieldReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/custom_fields/:custom_field_guid/remove" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + RemoveCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RemoveCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/custom_fields/:custom_field_guid/remove" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove&project=task&resource=custom_field&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveCustomFieldSample.java ; + */ + public RemoveCustomFieldResp remove(RemoveCustomFieldReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/custom_fields/:custom_field_guid/remove" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + RemoveCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RemoveCustomFieldResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/custom_fields/:custom_field_guid/remove" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/CustomFieldOption.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/CustomFieldOption.java new file mode 100644 index 000000000..0a01044d0 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/CustomFieldOption.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.task.v2.model.CreateCustomFieldOptionReq; +import com.lark.oapi.service.task.v2.model.CreateCustomFieldOptionResp; +import com.lark.oapi.service.task.v2.model.PatchCustomFieldOptionReq; +import com.lark.oapi.service.task.v2.model.PatchCustomFieldOptionResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class CustomFieldOption { + private static final Logger log = LoggerFactory.getLogger(CustomFieldOption.class); + private final Config config; + + public CustomFieldOption(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=task&resource=custom_field.option&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateCustomFieldOptionSample.java ; + */ + public CreateCustomFieldOptionResp create(CreateCustomFieldOptionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/custom_fields/:custom_field_guid/options" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateCustomFieldOptionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCustomFieldOptionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/custom_fields/:custom_field_guid/options" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=task&resource=custom_field.option&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateCustomFieldOptionSample.java ; + */ + public CreateCustomFieldOptionResp create(CreateCustomFieldOptionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/custom_fields/:custom_field_guid/options" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateCustomFieldOptionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateCustomFieldOptionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/custom_fields/:custom_field_guid/options" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=task&resource=custom_field.option&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchCustomFieldOptionSample.java ; + */ + public PatchCustomFieldOptionResp patch(PatchCustomFieldOptionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/task/v2/custom_fields/:custom_field_guid/options/:option_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchCustomFieldOptionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchCustomFieldOptionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/custom_fields/:custom_field_guid/options/:option_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=task&resource=custom_field.option&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchCustomFieldOptionSample.java ; + */ + public PatchCustomFieldOptionResp patch(PatchCustomFieldOptionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/task/v2/custom_fields/:custom_field_guid/options/:option_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchCustomFieldOptionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchCustomFieldOptionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/custom_fields/:custom_field_guid/options/:option_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/Section.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/Section.java new file mode 100644 index 000000000..bc8509ce4 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/Section.java @@ -0,0 +1,434 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.task.v2.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Section { + private static final Logger log = LoggerFactory.getLogger(Section.class); + private final Config config; + + public Section(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=task&resource=section&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateSectionSample.java ; + */ + public CreateSectionResp create(CreateSectionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/sections" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateSectionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSectionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/sections" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=task&resource=section&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateSectionSample.java ; + */ + public CreateSectionResp create(CreateSectionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/sections" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateSectionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSectionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/sections" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=task&resource=section&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteSectionSample.java ; + */ + public DeleteSectionResp delete(DeleteSectionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/task/v2/sections/:section_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteSectionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSectionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/sections/:section_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=task&resource=section&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteSectionSample.java ; + */ + public DeleteSectionResp delete(DeleteSectionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/task/v2/sections/:section_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteSectionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSectionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/sections/:section_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=task&resource=section&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetSectionSample.java ; + */ + public GetSectionResp get(GetSectionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/sections/:section_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetSectionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSectionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/sections/:section_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=task&resource=section&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetSectionSample.java ; + */ + public GetSectionResp get(GetSectionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/sections/:section_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetSectionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSectionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/sections/:section_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=task&resource=section&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListSectionSample.java ; + */ + public ListSectionResp list(ListSectionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/sections" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListSectionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListSectionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/sections" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=task&resource=section&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListSectionSample.java ; + */ + public ListSectionResp list(ListSectionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/sections" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListSectionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListSectionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/sections" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=task&resource=section&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchSectionSample.java ; + */ + public PatchSectionResp patch(PatchSectionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/task/v2/sections/:section_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchSectionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchSectionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/sections/:section_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=task&resource=section&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchSectionSample.java ; + */ + public PatchSectionResp patch(PatchSectionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/task/v2/sections/:section_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchSectionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchSectionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/sections/:section_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=tasks&project=task&resource=section&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/TasksSectionSample.java ; + */ + public TasksSectionResp tasks(TasksSectionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/sections/:section_guid/tasks" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + TasksSectionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TasksSectionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/sections/:section_guid/tasks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=tasks&project=task&resource=section&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/TasksSectionSample.java ; + */ + public TasksSectionResp tasks(TasksSectionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/sections/:section_guid/tasks" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + TasksSectionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TasksSectionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/sections/:section_guid/tasks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/Task.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/Task.java new file mode 100644 index 000000000..ecbd3a023 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/Task.java @@ -0,0 +1,962 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.task.v2.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Task { + private static final Logger log = LoggerFactory.getLogger(Task.class); + private final Config config; + + public Task(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=add_dependencies&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddDependenciesTaskSample.java ; + */ + public AddDependenciesTaskResp addDependencies(AddDependenciesTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasks/:task_guid/add_dependencies" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + AddDependenciesTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddDependenciesTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid/add_dependencies" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=add_dependencies&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddDependenciesTaskSample.java ; + */ + public AddDependenciesTaskResp addDependencies(AddDependenciesTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasks/:task_guid/add_dependencies" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + AddDependenciesTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddDependenciesTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid/add_dependencies" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=add_members&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddMembersTaskSample.java ; + */ + public AddMembersTaskResp addMembers(AddMembersTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasks/:task_guid/add_members" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + AddMembersTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddMembersTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid/add_members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=add_members&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddMembersTaskSample.java ; + */ + public AddMembersTaskResp addMembers(AddMembersTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasks/:task_guid/add_members" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + AddMembersTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddMembersTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid/add_members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=add_reminders&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddRemindersTaskSample.java ; + */ + public AddRemindersTaskResp addReminders(AddRemindersTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasks/:task_guid/add_reminders" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + AddRemindersTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddRemindersTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid/add_reminders" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=add_reminders&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddRemindersTaskSample.java ; + */ + public AddRemindersTaskResp addReminders(AddRemindersTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasks/:task_guid/add_reminders" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + AddRemindersTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddRemindersTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid/add_reminders" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=add_tasklist&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddTasklistTaskSample.java ; + */ + public AddTasklistTaskResp addTasklist(AddTasklistTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasks/:task_guid/add_tasklist" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + AddTasklistTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddTasklistTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid/add_tasklist" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=add_tasklist&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddTasklistTaskSample.java ; + */ + public AddTasklistTaskResp addTasklist(AddTasklistTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasks/:task_guid/add_tasklist" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + AddTasklistTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddTasklistTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid/add_tasklist" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateTaskSample.java ; + */ + public CreateTaskResp create(CreateTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasks" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateTaskSample.java ; + */ + public CreateTaskResp create(CreateTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasks" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteTaskSample.java ; + */ + public DeleteTaskResp delete(DeleteTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/task/v2/tasks/:task_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteTaskSample.java ; + */ + public DeleteTaskResp delete(DeleteTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/task/v2/tasks/:task_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetTaskSample.java ; + */ + public GetTaskResp get(GetTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/tasks/:task_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetTaskSample.java ; + */ + public GetTaskResp get(GetTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/tasks/:task_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListTaskSample.java ; + */ + public ListTaskResp list(ListTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/tasks" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + ListTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListTaskSample.java ; + */ + public ListTaskResp list(ListTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/tasks" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + ListTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchTaskSample.java ; + */ + public PatchTaskResp patch(PatchTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/task/v2/tasks/:task_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchTaskSample.java ; + */ + public PatchTaskResp patch(PatchTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/task/v2/tasks/:task_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_dependencies&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveDependenciesTaskSample.java ; + */ + public RemoveDependenciesTaskResp removeDependencies(RemoveDependenciesTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasks/:task_guid/remove_dependencies" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + RemoveDependenciesTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RemoveDependenciesTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid/remove_dependencies" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_dependencies&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveDependenciesTaskSample.java ; + */ + public RemoveDependenciesTaskResp removeDependencies(RemoveDependenciesTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasks/:task_guid/remove_dependencies" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + RemoveDependenciesTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RemoveDependenciesTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid/remove_dependencies" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_members&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveMembersTaskSample.java ; + */ + public RemoveMembersTaskResp removeMembers(RemoveMembersTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasks/:task_guid/remove_members" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + RemoveMembersTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RemoveMembersTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid/remove_members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_members&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveMembersTaskSample.java ; + */ + public RemoveMembersTaskResp removeMembers(RemoveMembersTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasks/:task_guid/remove_members" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + RemoveMembersTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RemoveMembersTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid/remove_members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_reminders&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveRemindersTaskSample.java ; + */ + public RemoveRemindersTaskResp removeReminders(RemoveRemindersTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasks/:task_guid/remove_reminders" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + RemoveRemindersTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RemoveRemindersTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid/remove_reminders" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_reminders&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveRemindersTaskSample.java ; + */ + public RemoveRemindersTaskResp removeReminders(RemoveRemindersTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasks/:task_guid/remove_reminders" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + RemoveRemindersTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RemoveRemindersTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid/remove_reminders" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_tasklist&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveTasklistTaskSample.java ; + */ + public RemoveTasklistTaskResp removeTasklist(RemoveTasklistTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasks/:task_guid/remove_tasklist" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + RemoveTasklistTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RemoveTasklistTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid/remove_tasklist" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_tasklist&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveTasklistTaskSample.java ; + */ + public RemoveTasklistTaskResp removeTasklist(RemoveTasklistTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasks/:task_guid/remove_tasklist" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + RemoveTasklistTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RemoveTasklistTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid/remove_tasklist" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=tasklists&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/TasklistsTaskSample.java ; + */ + public TasklistsTaskResp tasklists(TasklistsTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/tasks/:task_guid/tasklists" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + TasklistsTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TasklistsTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid/tasklists" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=tasklists&project=task&resource=task&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/TasklistsTaskSample.java ; + */ + public TasklistsTaskResp tasklists(TasklistsTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/tasks/:task_guid/tasklists" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + TasklistsTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TasklistsTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid/tasklists" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/TaskSubtask.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/TaskSubtask.java new file mode 100644 index 000000000..bb1512c99 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/TaskSubtask.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.task.v2.model.CreateTaskSubtaskReq; +import com.lark.oapi.service.task.v2.model.CreateTaskSubtaskResp; +import com.lark.oapi.service.task.v2.model.ListTaskSubtaskReq; +import com.lark.oapi.service.task.v2.model.ListTaskSubtaskResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class TaskSubtask { + private static final Logger log = LoggerFactory.getLogger(TaskSubtask.class); + private final Config config; + + public TaskSubtask(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=task&resource=task.subtask&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateTaskSubtaskSample.java ; + */ + public CreateTaskSubtaskResp create(CreateTaskSubtaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasks/:task_guid/subtasks" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateTaskSubtaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTaskSubtaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid/subtasks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=task&resource=task.subtask&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateTaskSubtaskSample.java ; + */ + public CreateTaskSubtaskResp create(CreateTaskSubtaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasks/:task_guid/subtasks" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateTaskSubtaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTaskSubtaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid/subtasks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=task&resource=task.subtask&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListTaskSubtaskSample.java ; + */ + public ListTaskSubtaskResp list(ListTaskSubtaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/tasks/:task_guid/subtasks" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListTaskSubtaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTaskSubtaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid/subtasks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=task&resource=task.subtask&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListTaskSubtaskSample.java ; + */ + public ListTaskSubtaskResp list(ListTaskSubtaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/tasks/:task_guid/subtasks" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListTaskSubtaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTaskSubtaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasks/:task_guid/subtasks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/Tasklist.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/Tasklist.java new file mode 100644 index 000000000..39119c8d5 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/Tasklist.java @@ -0,0 +1,566 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.task.v2.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Tasklist { + private static final Logger log = LoggerFactory.getLogger(Tasklist.class); + private final Config config; + + public Tasklist(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=add_members&project=task&resource=tasklist&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddMembersTasklistSample.java ; + */ + public AddMembersTasklistResp addMembers(AddMembersTasklistReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasklists/:tasklist_guid/add_members" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + AddMembersTasklistResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddMembersTasklistResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasklists/:tasklist_guid/add_members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=add_members&project=task&resource=tasklist&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddMembersTasklistSample.java ; + */ + public AddMembersTasklistResp addMembers(AddMembersTasklistReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasklists/:tasklist_guid/add_members" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + AddMembersTasklistResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, AddMembersTasklistResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasklists/:tasklist_guid/add_members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=task&resource=tasklist&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateTasklistSample.java ; + */ + public CreateTasklistResp create(CreateTasklistReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasklists" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateTasklistResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTasklistResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasklists" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=task&resource=tasklist&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateTasklistSample.java ; + */ + public CreateTasklistResp create(CreateTasklistReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasklists" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateTasklistResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTasklistResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasklists" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=task&resource=tasklist&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteTasklistSample.java ; + */ + public DeleteTasklistResp delete(DeleteTasklistReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/task/v2/tasklists/:tasklist_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteTasklistResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTasklistResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasklists/:tasklist_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=task&resource=tasklist&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteTasklistSample.java ; + */ + public DeleteTasklistResp delete(DeleteTasklistReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/task/v2/tasklists/:tasklist_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteTasklistResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTasklistResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasklists/:tasklist_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=task&resource=tasklist&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetTasklistSample.java ; + */ + public GetTasklistResp get(GetTasklistReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/tasklists/:tasklist_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetTasklistResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTasklistResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasklists/:tasklist_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=task&resource=tasklist&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetTasklistSample.java ; + */ + public GetTasklistResp get(GetTasklistReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/tasklists/:tasklist_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetTasklistResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTasklistResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasklists/:tasklist_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=task&resource=tasklist&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListTasklistSample.java ; + */ + public ListTasklistResp list(ListTasklistReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/tasklists" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListTasklistResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTasklistResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasklists" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=task&resource=tasklist&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListTasklistSample.java ; + */ + public ListTasklistResp list(ListTasklistReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/tasklists" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListTasklistResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTasklistResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasklists" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=task&resource=tasklist&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchTasklistSample.java ; + */ + public PatchTasklistResp patch(PatchTasklistReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/task/v2/tasklists/:tasklist_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchTasklistResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchTasklistResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasklists/:tasklist_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=task&resource=tasklist&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchTasklistSample.java ; + */ + public PatchTasklistResp patch(PatchTasklistReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/task/v2/tasklists/:tasklist_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchTasklistResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchTasklistResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasklists/:tasklist_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_members&project=task&resource=tasklist&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveMembersTasklistSample.java ; + */ + public RemoveMembersTasklistResp removeMembers(RemoveMembersTasklistReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasklists/:tasklist_guid/remove_members" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + RemoveMembersTasklistResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RemoveMembersTasklistResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasklists/:tasklist_guid/remove_members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_members&project=task&resource=tasklist&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveMembersTasklistSample.java ; + */ + public RemoveMembersTasklistResp removeMembers(RemoveMembersTasklistReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasklists/:tasklist_guid/remove_members" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + RemoveMembersTasklistResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, RemoveMembersTasklistResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasklists/:tasklist_guid/remove_members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=tasks&project=task&resource=tasklist&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/TasksTasklistSample.java ; + */ + public TasksTasklistResp tasks(TasksTasklistReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/tasklists/:tasklist_guid/tasks" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + TasksTasklistResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TasksTasklistResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasklists/:tasklist_guid/tasks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=tasks&project=task&resource=tasklist&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/TasksTasklistSample.java ; + */ + public TasksTasklistResp tasks(TasksTasklistReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/tasklists/:tasklist_guid/tasks" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + TasksTasklistResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TasksTasklistResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasklists/:tasklist_guid/tasks" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/TasklistActivitySubscription.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/TasklistActivitySubscription.java new file mode 100644 index 000000000..2296a28d9 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/task/v2/resource/TasklistActivitySubscription.java @@ -0,0 +1,368 @@ +// Code generated by lark suite 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 com.lark.oapi.service.task.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.task.v2.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class TasklistActivitySubscription { + private static final Logger log = LoggerFactory.getLogger(TasklistActivitySubscription.class); + private final Config config; + + public TasklistActivitySubscription(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=task&resource=tasklist.activity_subscription&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateTasklistActivitySubscriptionSample.java ; + */ + public CreateTasklistActivitySubscriptionResp create(CreateTasklistActivitySubscriptionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateTasklistActivitySubscriptionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTasklistActivitySubscriptionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=task&resource=tasklist.activity_subscription&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateTasklistActivitySubscriptionSample.java ; + */ + public CreateTasklistActivitySubscriptionResp create(CreateTasklistActivitySubscriptionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateTasklistActivitySubscriptionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateTasklistActivitySubscriptionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=task&resource=tasklist.activity_subscription&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteTasklistActivitySubscriptionSample.java ; + */ + public DeleteTasklistActivitySubscriptionResp delete(DeleteTasklistActivitySubscriptionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteTasklistActivitySubscriptionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTasklistActivitySubscriptionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=task&resource=tasklist.activity_subscription&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteTasklistActivitySubscriptionSample.java ; + */ + public DeleteTasklistActivitySubscriptionResp delete(DeleteTasklistActivitySubscriptionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteTasklistActivitySubscriptionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteTasklistActivitySubscriptionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=task&resource=tasklist.activity_subscription&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetTasklistActivitySubscriptionSample.java ; + */ + public GetTasklistActivitySubscriptionResp get(GetTasklistActivitySubscriptionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetTasklistActivitySubscriptionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTasklistActivitySubscriptionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=task&resource=tasklist.activity_subscription&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetTasklistActivitySubscriptionSample.java ; + */ + public GetTasklistActivitySubscriptionResp get(GetTasklistActivitySubscriptionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetTasklistActivitySubscriptionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTasklistActivitySubscriptionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=task&resource=tasklist.activity_subscription&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListTasklistActivitySubscriptionSample.java ; + */ + public ListTasklistActivitySubscriptionResp list(ListTasklistActivitySubscriptionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListTasklistActivitySubscriptionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTasklistActivitySubscriptionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=task&resource=tasklist.activity_subscription&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListTasklistActivitySubscriptionSample.java ; + */ + public ListTasklistActivitySubscriptionResp list(ListTasklistActivitySubscriptionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListTasklistActivitySubscriptionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListTasklistActivitySubscriptionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=task&resource=tasklist.activity_subscription&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchTasklistActivitySubscriptionSample.java ; + */ + public PatchTasklistActivitySubscriptionResp patch(PatchTasklistActivitySubscriptionReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchTasklistActivitySubscriptionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchTasklistActivitySubscriptionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=task&resource=tasklist.activity_subscription&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchTasklistActivitySubscriptionSample.java ; + */ + public PatchTasklistActivitySubscriptionResp patch(PatchTasklistActivitySubscriptionReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchTasklistActivitySubscriptionResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchTasklistActivitySubscriptionResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/tenant/TenantService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/tenant/TenantService.java new file mode 100644 index 000000000..5c7b16a5c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/tenant/TenantService.java @@ -0,0 +1,42 @@ +// Code generated by lark suite 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 com.lark.oapi.service.tenant; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.tenant.v2.V2; +import com.lark.oapi.service.tenant.v2.resource.Tenant; +import com.lark.oapi.service.tenant.v2.resource.TenantProductAssignInfo; + +public class TenantService { + private final V2 v2; + private final Tenant tenant; // 企业信息 + private final TenantProductAssignInfo tenantProductAssignInfo; // tenant.product_assign_info + + public TenantService(Config config) { + this.v2 = new V2(config); + this.tenant = new Tenant(config); + this.tenantProductAssignInfo = new TenantProductAssignInfo(config); + } + + public V2 v2() { + return v2; + } + + public Tenant tenant() { + return tenant; + } + + public TenantProductAssignInfo tenantProductAssignInfo() { + return tenantProductAssignInfo; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/tenant/v2/TenantService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/tenant/v2/TenantService.java deleted file mode 100644 index 772ebeba2..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/tenant/v2/TenantService.java +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.tenant.v2; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.tenant.v2.model.QueryTenantProductAssignInfoResp; -import com.lark.oapi.service.tenant.v2.model.QueryTenantResp; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class TenantService { - private static final Logger log = LoggerFactory.getLogger(TenantService.class); - private final Tenant tenant; // 企业信息 - private final TenantProductAssignInfo tenantProductAssignInfo; // tenant.product_assign_info - - public TenantService(Config config) { - this.tenant = new Tenant(config); - this.tenantProductAssignInfo = new TenantProductAssignInfo(config); - } - - /** - * 企业信息 - * - * @return - */ - public Tenant tenant() { - return tenant; - } - - /** - * tenant.product_assign_info - * - * @return - */ - public TenantProductAssignInfo tenantProductAssignInfo() { - return tenantProductAssignInfo; - } - - public static class Tenant { - private final Config config; - - public Tenant(Config config) { - this.config = config; - } - - /** - * 获取企业信息,获取企业名称、企业编号等企业信息 - *

如果ISV应用是企业创建时默认安装,并且180天内企业未打开或使用过此应用,则无法通过此接口获取到企业信息。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/tenant-v2/tenant/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/tenantv2/QueryTenantSample.java ; - */ - public QueryTenantResp query(RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/tenant/v2/tenant/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , null); - - // 反序列化 - QueryTenantResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryTenantResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/tenant/v2/tenant/query" - , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - return resp; - } - - /** - * 获取企业信息,获取企业名称、企业编号等企业信息 - *

如果ISV应用是企业创建时默认安装,并且180天内企业未打开或使用过此应用,则无法通过此接口获取到企业信息。 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/tenant-v2/tenant/query ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/tenantv2/QueryTenantSample.java ; - */ - public QueryTenantResp query() throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/tenant/v2/tenant/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , null); - - // 反序列化 - QueryTenantResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryTenantResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/tenant/v2/tenant/query" - , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - return resp; - } - } - - public static class TenantProductAssignInfo { - private final Config config; - - public TenantProductAssignInfo(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=tenant&resource=tenant.product_assign_info&version=v2 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/tenantv2/QueryTenantProductAssignInfoSample.java ; - */ - public QueryTenantProductAssignInfoResp query(RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/tenant/v2/tenant/assign_info_list/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , null); - - // 反序列化 - QueryTenantProductAssignInfoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryTenantProductAssignInfoResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/tenant/v2/tenant/assign_info_list/query" - , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=tenant&resource=tenant.product_assign_info&version=v2 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/tenantv2/QueryTenantProductAssignInfoSample.java ; - */ - public QueryTenantProductAssignInfoResp query() throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/tenant/v2/tenant/assign_info_list/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , null); - - // 反序列化 - QueryTenantProductAssignInfoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryTenantProductAssignInfoResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/tenant/v2/tenant/assign_info_list/query" - , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/tenant/v2/V2.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/tenant/v2/V2.java new file mode 100644 index 000000000..34b40933a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/tenant/v2/V2.java @@ -0,0 +1,36 @@ +// Code generated by lark suite 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 com.lark.oapi.service.tenant.v2; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.tenant.v2.resource.Tenant; +import com.lark.oapi.service.tenant.v2.resource.TenantProductAssignInfo; + +public class V2 { + private final Tenant tenant; // 企业信息 + private final TenantProductAssignInfo tenantProductAssignInfo; // tenant.product_assign_info + + public V2(Config config) { + this.tenant = new Tenant(config); + this.tenantProductAssignInfo = new TenantProductAssignInfo(config); + } + + public Tenant tenant() { + return tenant; + } + + public TenantProductAssignInfo tenantProductAssignInfo() { + return tenantProductAssignInfo; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/tenant/v2/resource/Tenant.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/tenant/v2/resource/Tenant.java new file mode 100644 index 000000000..53fbe849e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/tenant/v2/resource/Tenant.java @@ -0,0 +1,104 @@ +// Code generated by lark suite 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 com.lark.oapi.service.tenant.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.tenant.v2.model.QueryTenantResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Tenant { + private static final Logger log = LoggerFactory.getLogger(Tenant.class); + private final Config config; + + public Tenant(Config config) { + this.config = config; + } + + + /** + * 获取企业信息,获取企业名称、企业编号等企业信息 + *

如果ISV应用是企业创建时默认安装,并且180天内企业未打开或使用过此应用,则无法通过此接口获取到企业信息。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/tenant-v2/tenant/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/tenantv2/QueryTenantSample.java ; + */ + public QueryTenantResp query(RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/tenant/v2/tenant/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , null); + + // 反序列化 + QueryTenantResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryTenantResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/tenant/v2/tenant/query" + , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + return resp; + } + + /** + * 获取企业信息,获取企业名称、企业编号等企业信息 + *

如果ISV应用是企业创建时默认安装,并且180天内企业未打开或使用过此应用,则无法通过此接口获取到企业信息。 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/tenant-v2/tenant/query ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/tenantv2/QueryTenantSample.java ; + */ + public QueryTenantResp query() throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/tenant/v2/tenant/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , null); + + // 反序列化 + QueryTenantResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryTenantResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/tenant/v2/tenant/query" + , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/tenant/v2/resource/TenantProductAssignInfo.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/tenant/v2/resource/TenantProductAssignInfo.java new file mode 100644 index 000000000..ff45de441 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/tenant/v2/resource/TenantProductAssignInfo.java @@ -0,0 +1,102 @@ +// Code generated by lark suite 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 com.lark.oapi.service.tenant.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.tenant.v2.model.QueryTenantProductAssignInfoResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class TenantProductAssignInfo { + private static final Logger log = LoggerFactory.getLogger(TenantProductAssignInfo.class); + private final Config config; + + public TenantProductAssignInfo(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=tenant&resource=tenant.product_assign_info&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/tenantv2/QueryTenantProductAssignInfoSample.java ; + */ + public QueryTenantProductAssignInfoResp query(RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/tenant/v2/tenant/assign_info_list/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , null); + + // 反序列化 + QueryTenantProductAssignInfoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryTenantProductAssignInfoResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/tenant/v2/tenant/assign_info_list/query" + , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=tenant&resource=tenant.product_assign_info&version=v2 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/tenantv2/QueryTenantProductAssignInfoSample.java ; + */ + public QueryTenantProductAssignInfoResp query() throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/tenant/v2/tenant/assign_info_list/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , null); + + // 反序列化 + QueryTenantProductAssignInfoResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryTenantProductAssignInfoResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/tenant/v2/tenant/assign_info_list/query" + , Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/translation/TranslationService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/translation/TranslationService.java new file mode 100644 index 000000000..915589e76 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/translation/TranslationService.java @@ -0,0 +1,35 @@ +// Code generated by lark suite 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 com.lark.oapi.service.translation; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.translation.v1.V1; +import com.lark.oapi.service.translation.v1.resource.Text; + +public class TranslationService { + private final V1 v1; + private final Text text; // 文本 + + public TranslationService(Config config) { + this.v1 = new V1(config); + this.text = new Text(config); + } + + public V1 v1() { + return v1; + } + + public Text text() { + return text; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/translation/v1/TranslationService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/translation/v1/TranslationService.java deleted file mode 100644 index 4bd7b1209..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/translation/v1/TranslationService.java +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.translation.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.translation.v1.model.DetectTextReq; -import com.lark.oapi.service.translation.v1.model.DetectTextResp; -import com.lark.oapi.service.translation.v1.model.TranslateTextReq; -import com.lark.oapi.service.translation.v1.model.TranslateTextResp; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class TranslationService { - private static final Logger log = LoggerFactory.getLogger(TranslationService.class); - private final Text text; // 文本 - - public TranslationService(Config config) { - this.text = new Text(config); - } - - /** - * 文本 - * - * @return - */ - public Text text() { - return text; - } - - public static class Text { - private final Config config; - - public Text(Config config) { - this.config = config; - } - - /** - * 文本语种识别,机器翻译 (MT),支持 100 多种语言识别,返回符合 ISO 639-1 标准 - *

单租户限流:20QPS,同租户下的应用没有限流,共享本租户的 20QPS 限流 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/translation-v1/text/detect ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/translationv1/DetectTextSample.java ; - */ - public DetectTextResp detect(DetectTextReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/translation/v1/text/detect" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DetectTextResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DetectTextResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/translation/v1/text/detect" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 文本语种识别,机器翻译 (MT),支持 100 多种语言识别,返回符合 ISO 639-1 标准 - *

单租户限流:20QPS,同租户下的应用没有限流,共享本租户的 20QPS 限流 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/translation-v1/text/detect ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/translationv1/DetectTextSample.java ; - */ - public DetectTextResp detect(DetectTextReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/translation/v1/text/detect" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - DetectTextResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DetectTextResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/translation/v1/text/detect" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 文本翻译,机器翻译 (MT),支持以下语种互译:;"zh": 汉语;;"zh-Hant": 繁体汉语;;"en": 英语;;"ja": 日语;;"ru": 俄语;;"de": 德语;;"fr": 法语;;"it": 意大利语;;"pl": 波兰语;;"th": 泰语;;"hi": 印地语;;"id": 印尼语;;"es": 西班牙语;;"pt": 葡萄牙语;;"ko": 朝鲜语;;"vi": 越南语; - *

单租户限流:20QPS,同租户下的应用没有限流,共享本租户的 20QPS 限流 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/translation-v1/text/translate ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/translationv1/TranslateTextSample.java ; - */ - public TranslateTextResp translate(TranslateTextReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/translation/v1/text/translate" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - TranslateTextResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TranslateTextResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/translation/v1/text/translate" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 文本翻译,机器翻译 (MT),支持以下语种互译:;"zh": 汉语;;"zh-Hant": 繁体汉语;;"en": 英语;;"ja": 日语;;"ru": 俄语;;"de": 德语;;"fr": 法语;;"it": 意大利语;;"pl": 波兰语;;"th": 泰语;;"hi": 印地语;;"id": 印尼语;;"es": 西班牙语;;"pt": 葡萄牙语;;"ko": 朝鲜语;;"vi": 越南语; - *

单租户限流:20QPS,同租户下的应用没有限流,共享本租户的 20QPS 限流 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/translation-v1/text/translate ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/translationv1/TranslateTextSample.java ; - */ - public TranslateTextResp translate(TranslateTextReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/translation/v1/text/translate" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - TranslateTextResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TranslateTextResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/translation/v1/text/translate" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/translation/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/translation/v1/V1.java new file mode 100644 index 000000000..c1ef38932 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/translation/v1/V1.java @@ -0,0 +1,29 @@ +// Code generated by lark suite 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 com.lark.oapi.service.translation.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.translation.v1.resource.Text; + +public class V1 { + private final Text text; // 文本 + + public V1(Config config) { + this.text = new Text(config); + } + + public Text text() { + return text; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/translation/v1/resource/Text.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/translation/v1/resource/Text.java new file mode 100644 index 000000000..a460f995c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/translation/v1/resource/Text.java @@ -0,0 +1,177 @@ +// Code generated by lark suite 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 com.lark.oapi.service.translation.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.translation.v1.model.DetectTextReq; +import com.lark.oapi.service.translation.v1.model.DetectTextResp; +import com.lark.oapi.service.translation.v1.model.TranslateTextReq; +import com.lark.oapi.service.translation.v1.model.TranslateTextResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Text { + private static final Logger log = LoggerFactory.getLogger(Text.class); + private final Config config; + + public Text(Config config) { + this.config = config; + } + + + /** + * 文本语种识别,机器翻译 (MT),支持 100 多种语言识别,返回符合 ISO 639-1 标准 + *

单租户限流:20QPS,同租户下的应用没有限流,共享本租户的 20QPS 限流 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/translation-v1/text/detect ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/translationv1/DetectTextSample.java ; + */ + public DetectTextResp detect(DetectTextReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/translation/v1/text/detect" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DetectTextResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DetectTextResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/translation/v1/text/detect" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 文本语种识别,机器翻译 (MT),支持 100 多种语言识别,返回符合 ISO 639-1 标准 + *

单租户限流:20QPS,同租户下的应用没有限流,共享本租户的 20QPS 限流 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/translation-v1/text/detect ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/translationv1/DetectTextSample.java ; + */ + public DetectTextResp detect(DetectTextReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/translation/v1/text/detect" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + DetectTextResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DetectTextResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/translation/v1/text/detect" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 文本翻译,机器翻译 (MT),支持以下语种互译:;"zh": 汉语;;"zh-Hant": 繁体汉语;;"en": 英语;;"ja": 日语;;"ru": 俄语;;"de": 德语;;"fr": 法语;;"it": 意大利语;;"pl": 波兰语;;"th": 泰语;;"hi": 印地语;;"id": 印尼语;;"es": 西班牙语;;"pt": 葡萄牙语;;"ko": 朝鲜语;;"vi": 越南语; + *

单租户限流:20QPS,同租户下的应用没有限流,共享本租户的 20QPS 限流 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/translation-v1/text/translate ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/translationv1/TranslateTextSample.java ; + */ + public TranslateTextResp translate(TranslateTextReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/translation/v1/text/translate" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + TranslateTextResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TranslateTextResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/translation/v1/text/translate" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 文本翻译,机器翻译 (MT),支持以下语种互译:;"zh": 汉语;;"zh-Hant": 繁体汉语;;"en": 英语;;"ja": 日语;;"ru": 俄语;;"de": 德语;;"fr": 法语;;"it": 意大利语;;"pl": 波兰语;;"th": 泰语;;"hi": 印地语;;"id": 印尼语;;"es": 西班牙语;;"pt": 葡萄牙语;;"ko": 朝鲜语;;"vi": 越南语; + *

单租户限流:20QPS,同租户下的应用没有限流,共享本租户的 20QPS 限流 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/translation-v1/text/translate ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/translationv1/TranslateTextSample.java ; + */ + public TranslateTextResp translate(TranslateTextReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/translation/v1/text/translate" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + TranslateTextResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, TranslateTextResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/translation/v1/text/translate" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/VcService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/VcService.java new file mode 100644 index 000000000..597f94474 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/VcService.java @@ -0,0 +1,274 @@ +// Code generated by lark suite 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 com.lark.oapi.service.vc; + +import com.lark.oapi.core.Config; +import com.lark.oapi.event.IEventHandler; +import com.lark.oapi.service.vc.v1.V1; +import com.lark.oapi.service.vc.v1.model.*; +import com.lark.oapi.service.vc.v1.resource.Alert; +import com.lark.oapi.service.vc.v1.resource.Meeting; +import com.lark.oapi.service.vc.v1.resource.MeetingRecording; +import com.lark.oapi.service.vc.v1.resource.Report; +import com.lark.oapi.service.vc.v1.resource.Reserve; +import com.lark.oapi.service.vc.v1.resource.Room; +import com.lark.oapi.service.vc.v1.resource.RoomConfig; +import com.lark.oapi.service.vc.v1.resource.RoomLevel; +import com.lark.oapi.service.vc.v1.resource.ScopeConfig; +import com.lark.oapi.service.vc.v1.resource.*; + +public class VcService { + private final V1 v1; + private final Alert alert; // 告警中心 + private final Export export; // 导出 + private final Meeting meeting; // 会议 + private final MeetingRecording meetingRecording; // 录制 + private final MeetingList meetingList; // meeting_list + private final ParticipantList participantList; // participant_list + private final ParticipantQualityList participantQualityList; // participant_quality_list + private final Report report; // 会议报告 + private final Reserve reserve; // 预约 + private final ReserveConfig reserveConfig; // reserve_config + private final ReserveConfigAdmin reserveConfigAdmin; // reserve_config.admin + private final ReserveConfigDisableInform reserveConfigDisableInform; // reserve_config.disable_inform + private final ReserveConfigForm reserveConfigForm; // reserve_config.form + private final ResourceReservationList resourceReservationList; // resource_reservation_list + private final Room room; // 会议室 + private final RoomConfig roomConfig; // room_config + private final RoomLevel roomLevel; // 会议室层级 + private final ScopeConfig scopeConfig; // 会议室配置 + + public VcService(Config config) { + this.v1 = new V1(config); + this.alert = new Alert(config); + this.export = new Export(config); + this.meeting = new Meeting(config); + this.meetingRecording = new MeetingRecording(config); + this.meetingList = new MeetingList(config); + this.participantList = new ParticipantList(config); + this.participantQualityList = new ParticipantQualityList(config); + this.report = new Report(config); + this.reserve = new Reserve(config); + this.reserveConfig = new ReserveConfig(config); + this.reserveConfigAdmin = new ReserveConfigAdmin(config); + this.reserveConfigDisableInform = new ReserveConfigDisableInform(config); + this.reserveConfigForm = new ReserveConfigForm(config); + this.resourceReservationList = new ResourceReservationList(config); + this.room = new Room(config); + this.roomConfig = new RoomConfig(config); + this.roomLevel = new RoomLevel(config); + this.scopeConfig = new ScopeConfig(config); + } + + public V1 v1() { + return v1; + } + + public Alert alert() { + return alert; + } + + public Export export() { + return export; + } + + public Meeting meeting() { + return meeting; + } + + public MeetingRecording meetingRecording() { + return meetingRecording; + } + + public MeetingList meetingList() { + return meetingList; + } + + public ParticipantList participantList() { + return participantList; + } + + public ParticipantQualityList participantQualityList() { + return participantQualityList; + } + + public Report report() { + return report; + } + + public Reserve reserve() { + return reserve; + } + + public ReserveConfig reserveConfig() { + return reserveConfig; + } + + public ReserveConfigAdmin reserveConfigAdmin() { + return reserveConfigAdmin; + } + + public ReserveConfigDisableInform reserveConfigDisableInform() { + return reserveConfigDisableInform; + } + + public ReserveConfigForm reserveConfigForm() { + return reserveConfigForm; + } + + public ResourceReservationList resourceReservationList() { + return resourceReservationList; + } + + public Room room() { + return room; + } + + public RoomConfig roomConfig() { + return roomConfig; + } + + public RoomLevel roomLevel() { + return roomLevel; + } + + public ScopeConfig scopeConfig() { + return scopeConfig; + } + + public abstract static class P2MeetingAllMeetingEndedV1Handler implements IEventHandler { + @Override + public P2MeetingAllMeetingEndedV1 getEvent() { + return new P2MeetingAllMeetingEndedV1(); + } + } + + public abstract static class P2MeetingAllMeetingStartedV1Handler implements IEventHandler { + @Override + public P2MeetingAllMeetingStartedV1 getEvent() { + return new P2MeetingAllMeetingStartedV1(); + } + } + + public abstract static class P2MeetingJoinMeetingV1Handler implements IEventHandler { + @Override + public P2MeetingJoinMeetingV1 getEvent() { + return new P2MeetingJoinMeetingV1(); + } + } + + public abstract static class P2MeetingLeaveMeetingV1Handler implements IEventHandler { + @Override + public P2MeetingLeaveMeetingV1 getEvent() { + return new P2MeetingLeaveMeetingV1(); + } + } + + public abstract static class P2MeetingEndedV1Handler implements IEventHandler { + @Override + public P2MeetingEndedV1 getEvent() { + return new P2MeetingEndedV1(); + } + } + + public abstract static class P2MeetingStartedV1Handler implements IEventHandler { + @Override + public P2MeetingStartedV1 getEvent() { + return new P2MeetingStartedV1(); + } + } + + public abstract static class P2MeetingRecordingEndedV1Handler implements IEventHandler { + @Override + public P2MeetingRecordingEndedV1 getEvent() { + return new P2MeetingRecordingEndedV1(); + } + } + + public abstract static class P2MeetingRecordingReadyV1Handler implements IEventHandler { + @Override + public P2MeetingRecordingReadyV1 getEvent() { + return new P2MeetingRecordingReadyV1(); + } + } + + public abstract static class P2MeetingRecordingStartedV1Handler implements IEventHandler { + @Override + public P2MeetingRecordingStartedV1 getEvent() { + return new P2MeetingRecordingStartedV1(); + } + } + + public abstract static class P2MeetingShareEndedV1Handler implements IEventHandler { + @Override + public P2MeetingShareEndedV1 getEvent() { + return new P2MeetingShareEndedV1(); + } + } + + public abstract static class P2MeetingShareStartedV1Handler implements IEventHandler { + @Override + public P2MeetingShareStartedV1 getEvent() { + return new P2MeetingShareStartedV1(); + } + } + + public abstract static class P2ReserveConfigUpdatedV1Handler implements IEventHandler { + @Override + public P2ReserveConfigUpdatedV1 getEvent() { + return new P2ReserveConfigUpdatedV1(); + } + } + + public abstract static class P2RoomCreatedV1Handler implements IEventHandler { + @Override + public P2RoomCreatedV1 getEvent() { + return new P2RoomCreatedV1(); + } + } + + public abstract static class P2RoomDeletedV1Handler implements IEventHandler { + @Override + public P2RoomDeletedV1 getEvent() { + return new P2RoomDeletedV1(); + } + } + + public abstract static class P2RoomUpdatedV1Handler implements IEventHandler { + @Override + public P2RoomUpdatedV1 getEvent() { + return new P2RoomUpdatedV1(); + } + } + + public abstract static class P2RoomLevelCreatedV1Handler implements IEventHandler { + @Override + public P2RoomLevelCreatedV1 getEvent() { + return new P2RoomLevelCreatedV1(); + } + } + + public abstract static class P2RoomLevelDeletedV1Handler implements IEventHandler { + @Override + public P2RoomLevelDeletedV1 getEvent() { + return new P2RoomLevelDeletedV1(); + } + } + + public abstract static class P2RoomLevelUpdatedV1Handler implements IEventHandler { + @Override + public P2RoomLevelUpdatedV1 getEvent() { + return new P2RoomLevelUpdatedV1(); + } + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/V1.java new file mode 100644 index 000000000..af37a3ab3 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/V1.java @@ -0,0 +1,131 @@ +// Code generated by lark suite 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 com.lark.oapi.service.vc.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.vc.v1.resource.*; + +public class V1 { + private final Alert alert; // 告警中心 + private final Export export; // 导出 + private final Meeting meeting; // 会议 + private final MeetingRecording meetingRecording; // 录制 + private final MeetingList meetingList; // meeting_list + private final ParticipantList participantList; // participant_list + private final ParticipantQualityList participantQualityList; // participant_quality_list + private final Report report; // 会议报告 + private final Reserve reserve; // 预约 + private final ReserveConfig reserveConfig; // reserve_config + private final ReserveConfigAdmin reserveConfigAdmin; // reserve_config.admin + private final ReserveConfigDisableInform reserveConfigDisableInform; // reserve_config.disable_inform + private final ReserveConfigForm reserveConfigForm; // reserve_config.form + private final ResourceReservationList resourceReservationList; // resource_reservation_list + private final Room room; // 会议室 + private final RoomConfig roomConfig; // room_config + private final RoomLevel roomLevel; // 会议室层级 + private final ScopeConfig scopeConfig; // 会议室配置 + + public V1(Config config) { + this.alert = new Alert(config); + this.export = new Export(config); + this.meeting = new Meeting(config); + this.meetingRecording = new MeetingRecording(config); + this.meetingList = new MeetingList(config); + this.participantList = new ParticipantList(config); + this.participantQualityList = new ParticipantQualityList(config); + this.report = new Report(config); + this.reserve = new Reserve(config); + this.reserveConfig = new ReserveConfig(config); + this.reserveConfigAdmin = new ReserveConfigAdmin(config); + this.reserveConfigDisableInform = new ReserveConfigDisableInform(config); + this.reserveConfigForm = new ReserveConfigForm(config); + this.resourceReservationList = new ResourceReservationList(config); + this.room = new Room(config); + this.roomConfig = new RoomConfig(config); + this.roomLevel = new RoomLevel(config); + this.scopeConfig = new ScopeConfig(config); + } + + public Alert alert() { + return alert; + } + + public Export export() { + return export; + } + + public Meeting meeting() { + return meeting; + } + + public MeetingRecording meetingRecording() { + return meetingRecording; + } + + public MeetingList meetingList() { + return meetingList; + } + + public ParticipantList participantList() { + return participantList; + } + + public ParticipantQualityList participantQualityList() { + return participantQualityList; + } + + public Report report() { + return report; + } + + public Reserve reserve() { + return reserve; + } + + public ReserveConfig reserveConfig() { + return reserveConfig; + } + + public ReserveConfigAdmin reserveConfigAdmin() { + return reserveConfigAdmin; + } + + public ReserveConfigDisableInform reserveConfigDisableInform() { + return reserveConfigDisableInform; + } + + public ReserveConfigForm reserveConfigForm() { + return reserveConfigForm; + } + + public ResourceReservationList resourceReservationList() { + return resourceReservationList; + } + + public Room room() { + return room; + } + + public RoomConfig roomConfig() { + return roomConfig; + } + + public RoomLevel roomLevel() { + return roomLevel; + } + + public ScopeConfig scopeConfig() { + return scopeConfig; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/VcService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/VcService.java deleted file mode 100644 index cb603d618..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/VcService.java +++ /dev/null @@ -1,4252 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.vc.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.event.IEventHandler; -import com.lark.oapi.service.vc.v1.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.ByteArrayOutputStream; -import java.nio.charset.StandardCharsets; - -public class VcService { - private static final Logger log = LoggerFactory.getLogger(VcService.class); - private final Alert alert; // 告警中心 - private final Export export; // 导出 - private final Meeting meeting; // 会议 - private final MeetingRecording meetingRecording; // 录制 - private final MeetingList meetingList; // meeting_list - private final ParticipantList participantList; // participant_list - private final ParticipantQualityList participantQualityList; // participant_quality_list - private final Report report; // 会议报告 - private final Reserve reserve; // 预约 - private final ReserveConfig reserveConfig; // reserve_config - private final ReserveConfigAdmin reserveConfigAdmin; // reserve_config.admin - private final ReserveConfigDisableInform reserveConfigDisableInform; // reserve_config.disable_inform - private final ReserveConfigForm reserveConfigForm; // reserve_config.form - private final ResourceReservationList resourceReservationList; // resource_reservation_list - private final Room room; // 会议室 - private final RoomConfig roomConfig; // room_config - private final RoomLevel roomLevel; // 会议室层级 - private final ScopeConfig scopeConfig; // 会议室配置 - - public VcService(Config config) { - this.alert = new Alert(config); - this.export = new Export(config); - this.meeting = new Meeting(config); - this.meetingRecording = new MeetingRecording(config); - this.meetingList = new MeetingList(config); - this.participantList = new ParticipantList(config); - this.participantQualityList = new ParticipantQualityList(config); - this.report = new Report(config); - this.reserve = new Reserve(config); - this.reserveConfig = new ReserveConfig(config); - this.reserveConfigAdmin = new ReserveConfigAdmin(config); - this.reserveConfigDisableInform = new ReserveConfigDisableInform(config); - this.reserveConfigForm = new ReserveConfigForm(config); - this.resourceReservationList = new ResourceReservationList(config); - this.room = new Room(config); - this.roomConfig = new RoomConfig(config); - this.roomLevel = new RoomLevel(config); - this.scopeConfig = new ScopeConfig(config); - } - - /** - * 告警中心 - * - * @return - */ - public Alert alert() { - return alert; - } - - /** - * 导出 - * - * @return - */ - public Export export() { - return export; - } - - /** - * 会议 - * - * @return - */ - public Meeting meeting() { - return meeting; - } - - /** - * 录制 - * - * @return - */ - public MeetingRecording meetingRecording() { - return meetingRecording; - } - - /** - * meeting_list - * - * @return - */ - public MeetingList meetingList() { - return meetingList; - } - - /** - * participant_list - * - * @return - */ - public ParticipantList participantList() { - return participantList; - } - - /** - * participant_quality_list - * - * @return - */ - public ParticipantQualityList participantQualityList() { - return participantQualityList; - } - - /** - * 会议报告 - * - * @return - */ - public Report report() { - return report; - } - - /** - * 预约 - * - * @return - */ - public Reserve reserve() { - return reserve; - } - - /** - * reserve_config - * - * @return - */ - public ReserveConfig reserveConfig() { - return reserveConfig; - } - - /** - * reserve_config.admin - * - * @return - */ - public ReserveConfigAdmin reserveConfigAdmin() { - return reserveConfigAdmin; - } - - /** - * reserve_config.disable_inform - * - * @return - */ - public ReserveConfigDisableInform reserveConfigDisableInform() { - return reserveConfigDisableInform; - } - - /** - * reserve_config.form - * - * @return - */ - public ReserveConfigForm reserveConfigForm() { - return reserveConfigForm; - } - - /** - * resource_reservation_list - * - * @return - */ - public ResourceReservationList resourceReservationList() { - return resourceReservationList; - } - - /** - * 会议室 - * - * @return - */ - public Room room() { - return room; - } - - /** - * room_config - * - * @return - */ - public RoomConfig roomConfig() { - return roomConfig; - } - - /** - * 会议室层级 - * - * @return - */ - public RoomLevel roomLevel() { - return roomLevel; - } - - /** - * 会议室配置 - * - * @return - */ - public ScopeConfig scopeConfig() { - return scopeConfig; - } - - public static class Alert { - private final Config config; - - public Alert(Config config) { - this.config = config; - } - - /** - * 获取告警记录,获取特定条件下租户的设备告警记录 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/alert/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListAlertSample.java ; - */ - public ListAlertResp list(ListAlertReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/alerts" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListAlertResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAlertResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/alerts" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取告警记录,获取特定条件下租户的设备告警记录 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/alert/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListAlertSample.java ; - */ - public ListAlertResp list(ListAlertReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/alerts" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - ListAlertResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAlertResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/alerts" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Export { - private final Config config; - - public Export(Config config) { - this.config = config; - } - - /** - * 下载导出文件,下载导出文件 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/download ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DownloadExportSample.java ; - */ - public DownloadExportResp download(DownloadExportReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/exports/download" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - if (httpResponse.getStatusCode() == 200) { - DownloadExportResp resp = new DownloadExportResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - DownloadExportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadExportResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/exports/download" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 下载导出文件,下载导出文件 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/download ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DownloadExportSample.java ; - */ - public DownloadExportResp download(DownloadExportReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - reqOptions.setSupportDownLoad(true); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/exports/download" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 下载请求,返回流 - if (httpResponse.getStatusCode() == 200) { - DownloadExportResp resp = new DownloadExportResp(); - resp.setRawResponse(httpResponse); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(httpResponse.getBody()); - resp.setData(outputStream); - resp.setFileName(httpResponse.getFileName()); - return resp; - } - // 反序列化 - DownloadExportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadExportResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/exports/download" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询导出任务结果,查看异步导出的进度 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetExportSample.java ; - */ - public GetExportResp get(GetExportReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/exports/:task_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetExportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetExportResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/exports/:task_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询导出任务结果,查看异步导出的进度 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetExportSample.java ; - */ - public GetExportResp get(GetExportReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/exports/:task_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetExportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetExportResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/exports/:task_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 导出会议明细,导出会议明细,具体权限要求请参考「导出概述」 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/meeting_list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/MeetingListExportSample.java ; - */ - public MeetingListExportResp meetingList(MeetingListExportReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/exports/meeting_list" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - MeetingListExportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MeetingListExportResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/exports/meeting_list" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 导出会议明细,导出会议明细,具体权限要求请参考「导出概述」 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/meeting_list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/MeetingListExportSample.java ; - */ - public MeetingListExportResp meetingList(MeetingListExportReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/exports/meeting_list" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - MeetingListExportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MeetingListExportResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/exports/meeting_list" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 导出参会人明细,导出某个会议的参会人详情列表,具体权限要求请参考「导出概述」 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/participant_list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ParticipantListExportSample.java ; - */ - public ParticipantListExportResp participantList(ParticipantListExportReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/exports/participant_list" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ParticipantListExportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ParticipantListExportResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/exports/participant_list" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 导出参会人明细,导出某个会议的参会人详情列表,具体权限要求请参考「导出概述」 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/participant_list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ParticipantListExportSample.java ; - */ - public ParticipantListExportResp participantList(ParticipantListExportReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/exports/participant_list" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ParticipantListExportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ParticipantListExportResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/exports/participant_list" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 导出参会人会议质量数据,导出某场会议某个参会人的音视频&共享质量数据;,具体权限要求请参考「导出概述」 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/participant_quality_list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ParticipantQualityListExportSample.java ; - */ - public ParticipantQualityListExportResp participantQualityList(ParticipantQualityListExportReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/exports/participant_quality_list" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ParticipantQualityListExportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ParticipantQualityListExportResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/exports/participant_quality_list" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 导出参会人会议质量数据,导出某场会议某个参会人的音视频&共享质量数据;,具体权限要求请参考「导出概述」 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/participant_quality_list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ParticipantQualityListExportSample.java ; - */ - public ParticipantQualityListExportResp participantQualityList(ParticipantQualityListExportReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/exports/participant_quality_list" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ParticipantQualityListExportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ParticipantQualityListExportResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/exports/participant_quality_list" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 导出会议室预定数据,导出会议室预定数据,具体权限要求请参考「导出概述」 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/resource_reservation_list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ResourceReservationListExportSample.java ; - */ - public ResourceReservationListExportResp resourceReservationList(ResourceReservationListExportReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/exports/resource_reservation_list" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ResourceReservationListExportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ResourceReservationListExportResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/exports/resource_reservation_list" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 导出会议室预定数据,导出会议室预定数据,具体权限要求请参考「导出概述」 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/resource_reservation_list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ResourceReservationListExportSample.java ; - */ - public ResourceReservationListExportResp resourceReservationList(ResourceReservationListExportReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/exports/resource_reservation_list" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ResourceReservationListExportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ResourceReservationListExportResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/exports/resource_reservation_list" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Meeting { - private final Config config; - - public Meeting(Config config) { - this.config = config; - } - - /** - * 结束会议,结束一个进行中的会议 - *

会议正在进行中,且操作者须具有相应的权限(如果操作者为用户,必须是会中当前主持人) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/end ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/EndMeetingSample.java ; - */ - public EndMeetingResp end(EndMeetingReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/vc/v1/meetings/:meeting_id/end" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - EndMeetingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, EndMeetingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/end" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 结束会议,结束一个进行中的会议 - *

会议正在进行中,且操作者须具有相应的权限(如果操作者为用户,必须是会中当前主持人) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/end ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/EndMeetingSample.java ; - */ - public EndMeetingResp end(EndMeetingReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/vc/v1/meetings/:meeting_id/end" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - EndMeetingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, EndMeetingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/end" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取会议详情,获取一个会议的详细数据 - *

只能获取归属于自己的会议,支持查询最近90天内的会议 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetMeetingSample.java ; - */ - public GetMeetingResp get(GetMeetingReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/meetings/:meeting_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetMeetingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMeetingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取会议详情,获取一个会议的详细数据 - *

只能获取归属于自己的会议,支持查询最近90天内的会议 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetMeetingSample.java ; - */ - public GetMeetingResp get(GetMeetingReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/meetings/:meeting_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetMeetingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMeetingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 邀请参会人,邀请参会人进入会议 - *

发起邀请的操作者必须具有相应的权限(如果操作者为用户,则必须在会中),如果会议被锁定、或参会人数如果达到上限,则会邀请失败 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/invite ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/InviteMeetingSample.java ; - */ - public InviteMeetingResp invite(InviteMeetingReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/vc/v1/meetings/:meeting_id/invite" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - InviteMeetingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, InviteMeetingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/invite" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 邀请参会人,邀请参会人进入会议 - *

发起邀请的操作者必须具有相应的权限(如果操作者为用户,则必须在会中),如果会议被锁定、或参会人数如果达到上限,则会邀请失败 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/invite ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/InviteMeetingSample.java ; - */ - public InviteMeetingResp invite(InviteMeetingReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/vc/v1/meetings/:meeting_id/invite" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - InviteMeetingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, InviteMeetingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/invite" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 移除参会人,将参会人从会议中移除 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/kickout ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/KickoutMeetingSample.java ; - */ - public KickoutMeetingResp kickout(KickoutMeetingReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/meetings/:meeting_id/kickout" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - KickoutMeetingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, KickoutMeetingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/kickout" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 移除参会人,将参会人从会议中移除 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/kickout ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/KickoutMeetingSample.java ; - */ - public KickoutMeetingResp kickout(KickoutMeetingReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/meetings/:meeting_id/kickout" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - KickoutMeetingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, KickoutMeetingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/kickout" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取与会议号相关联的会议列表,获取指定时间范围(90天内)会议号关联的会议简要信息列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/list_by_no ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListByNoMeetingSample.java ; - */ - public ListByNoMeetingResp listByNo(ListByNoMeetingReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/meetings/list_by_no" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListByNoMeetingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListByNoMeetingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/list_by_no" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取与会议号相关联的会议列表,获取指定时间范围(90天内)会议号关联的会议简要信息列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/list_by_no ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListByNoMeetingSample.java ; - */ - public ListByNoMeetingResp listByNo(ListByNoMeetingReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/meetings/list_by_no" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListByNoMeetingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListByNoMeetingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/list_by_no" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 设置主持人,设置会议的主持人 - *

发起设置主持人的操作者必须具有相应的权限(如果操作者为用户,必须是会中当前主持人);该操作使用CAS并发安全机制,需传入会中当前主持人,如果操作失败可使用返回的最新数据重试 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/set_host ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetHostMeetingSample.java ; - */ - public SetHostMeetingResp setHost(SetHostMeetingReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/vc/v1/meetings/:meeting_id/set_host" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - SetHostMeetingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SetHostMeetingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/set_host" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 设置主持人,设置会议的主持人 - *

发起设置主持人的操作者必须具有相应的权限(如果操作者为用户,必须是会中当前主持人);该操作使用CAS并发安全机制,需传入会中当前主持人,如果操作失败可使用返回的最新数据重试 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/set_host ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetHostMeetingSample.java ; - */ - public SetHostMeetingResp setHost(SetHostMeetingReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/vc/v1/meetings/:meeting_id/set_host" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - SetHostMeetingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SetHostMeetingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/set_host" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class MeetingRecording { - private final Config config; - - public MeetingRecording(Config config) { - this.config = config; - } - - /** - * 获取录制文件,获取一个会议的录制文件。 - *

会议结束后并且收到了"录制完成"的事件方可获取录制文件;只有会议owner(通过开放平台预约的会议即为预约人)有权限获取;录制时间太短(<5s)有可能无法生成录制文件 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting-recording/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetMeetingRecordingSample.java ; - */ - public GetMeetingRecordingResp get(GetMeetingRecordingReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/meetings/:meeting_id/recording" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetMeetingRecordingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMeetingRecordingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/recording" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取录制文件,获取一个会议的录制文件。 - *

会议结束后并且收到了"录制完成"的事件方可获取录制文件;只有会议owner(通过开放平台预约的会议即为预约人)有权限获取;录制时间太短(<5s)有可能无法生成录制文件 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting-recording/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetMeetingRecordingSample.java ; - */ - public GetMeetingRecordingResp get(GetMeetingRecordingReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/meetings/:meeting_id/recording" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetMeetingRecordingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMeetingRecordingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/recording" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 授权录制文件,将一个会议的录制文件授权给组织、用户或公开到公网 - *

会议结束后并且收到了"录制完成"的事件方可进行授权;会议owner(通过开放平台预约的会议即为预约人)才有权限操作 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting-recording/set_permission ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetPermissionMeetingRecordingSample.java ; - */ - public SetPermissionMeetingRecordingResp setPermission(SetPermissionMeetingRecordingReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/vc/v1/meetings/:meeting_id/recording/set_permission" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - SetPermissionMeetingRecordingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SetPermissionMeetingRecordingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/recording/set_permission" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 授权录制文件,将一个会议的录制文件授权给组织、用户或公开到公网 - *

会议结束后并且收到了"录制完成"的事件方可进行授权;会议owner(通过开放平台预约的会议即为预约人)才有权限操作 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting-recording/set_permission ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetPermissionMeetingRecordingSample.java ; - */ - public SetPermissionMeetingRecordingResp setPermission(SetPermissionMeetingRecordingReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/vc/v1/meetings/:meeting_id/recording/set_permission" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - SetPermissionMeetingRecordingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SetPermissionMeetingRecordingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/recording/set_permission" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 开始录制,在会议中开始录制。 - *

会议正在进行中,且操作者具有相应权限(如果操作者为用户,必须是会中当前主持人) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting-recording/start ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/StartMeetingRecordingSample.java ; - */ - public StartMeetingRecordingResp start(StartMeetingRecordingReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/vc/v1/meetings/:meeting_id/recording/start" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - StartMeetingRecordingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, StartMeetingRecordingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/recording/start" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 开始录制,在会议中开始录制。 - *

会议正在进行中,且操作者具有相应权限(如果操作者为用户,必须是会中当前主持人) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting-recording/start ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/StartMeetingRecordingSample.java ; - */ - public StartMeetingRecordingResp start(StartMeetingRecordingReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/vc/v1/meetings/:meeting_id/recording/start" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - StartMeetingRecordingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, StartMeetingRecordingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/recording/start" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 停止录制,在会议中停止录制。 - *

会议正在录制中,且操作者具有相应权限(如果操作者为用户,必须是会中当前主持人) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting-recording/stop ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/StopMeetingRecordingSample.java ; - */ - public StopMeetingRecordingResp stop(StopMeetingRecordingReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/vc/v1/meetings/:meeting_id/recording/stop" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - StopMeetingRecordingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, StopMeetingRecordingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/recording/stop" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 停止录制,在会议中停止录制。 - *

会议正在录制中,且操作者具有相应权限(如果操作者为用户,必须是会中当前主持人) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting-recording/stop ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/StopMeetingRecordingSample.java ; - */ - public StopMeetingRecordingResp stop(StopMeetingRecordingReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/vc/v1/meetings/:meeting_id/recording/stop" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - StopMeetingRecordingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, StopMeetingRecordingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/recording/stop" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class MeetingList { - private final Config config; - - public MeetingList(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=meeting_list&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetMeetingListSample.java ; - */ - public GetMeetingListResp get(GetMeetingListReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/meeting_list" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetMeetingListResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMeetingListResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meeting_list" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=meeting_list&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetMeetingListSample.java ; - */ - public GetMeetingListResp get(GetMeetingListReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/meeting_list" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetMeetingListResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMeetingListResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meeting_list" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ParticipantList { - private final Config config; - - public ParticipantList(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=participant_list&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetParticipantListSample.java ; - */ - public GetParticipantListResp get(GetParticipantListReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/participant_list" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetParticipantListResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetParticipantListResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/participant_list" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=participant_list&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetParticipantListSample.java ; - */ - public GetParticipantListResp get(GetParticipantListReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/participant_list" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetParticipantListResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetParticipantListResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/participant_list" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ParticipantQualityList { - private final Config config; - - public ParticipantQualityList(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=participant_quality_list&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetParticipantQualityListSample.java ; - */ - public GetParticipantQualityListResp get(GetParticipantQualityListReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/participant_quality_list" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetParticipantQualityListResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetParticipantQualityListResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/participant_quality_list" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=participant_quality_list&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetParticipantQualityListSample.java ; - */ - public GetParticipantQualityListResp get(GetParticipantQualityListReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/participant_quality_list" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetParticipantQualityListResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetParticipantQualityListResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/participant_quality_list" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Report { - private final Config config; - - public Report(Config config) { - this.config = config; - } - - /** - * 获取会议报告,获取一段时间内组织的每日会议使用报告。 - *

支持最近90天内的数据查询 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/report/get_daily ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetDailyReportSample.java ; - */ - public GetDailyReportResp getDaily(GetDailyReportReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/reports/get_daily" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetDailyReportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDailyReportResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reports/get_daily" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取会议报告,获取一段时间内组织的每日会议使用报告。 - *

支持最近90天内的数据查询 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/report/get_daily ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetDailyReportSample.java ; - */ - public GetDailyReportResp getDaily(GetDailyReportReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/reports/get_daily" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetDailyReportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDailyReportResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reports/get_daily" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取top用户列表,获取一段时间内组织内会议使用的top用户列表。 - *

支持最近90天内的数据查询;默认返回前10位,最多可查询前100位 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/report/get_top_user ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetTopUserReportSample.java ; - */ - public GetTopUserReportResp getTopUser(GetTopUserReportReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/reports/get_top_user" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetTopUserReportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTopUserReportResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reports/get_top_user" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取top用户列表,获取一段时间内组织内会议使用的top用户列表。 - *

支持最近90天内的数据查询;默认返回前10位,最多可查询前100位 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/report/get_top_user ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetTopUserReportSample.java ; - */ - public GetTopUserReportResp getTopUser(GetTopUserReportReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/reports/get_top_user" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - GetTopUserReportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTopUserReportResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reports/get_top_user" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Reserve { - private final Config config; - - public Reserve(Config config) { - this.config = config; - } - - /** - * 预约会议,创建一个会议预约。 - *

支持预约最近30天内的会议(到期时间距离当前时间不超过30天),预约到期后会议号将被释放,如需继续使用可通过"更新预约"接口进行续期;预约会议时可配置参会人在会中的权限,以达到控制会议的目的 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/apply ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ApplyReserveSample.java ; - */ - public ApplyReserveResp apply(ApplyReserveReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/reserves/apply" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ApplyReserveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ApplyReserveResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserves/apply" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 预约会议,创建一个会议预约。 - *

支持预约最近30天内的会议(到期时间距离当前时间不超过30天),预约到期后会议号将被释放,如需继续使用可通过"更新预约"接口进行续期;预约会议时可配置参会人在会中的权限,以达到控制会议的目的 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/apply ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ApplyReserveSample.java ; - */ - public ApplyReserveResp apply(ApplyReserveReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/reserves/apply" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ApplyReserveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ApplyReserveResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserves/apply" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除预约,删除一个预约 - *

只能删除归属于自己的预约;删除后数据不可恢复 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DeleteReserveSample.java ; - */ - public DeleteReserveResp delete(DeleteReserveReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/vc/v1/reserves/:reserve_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteReserveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteReserveResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserves/:reserve_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除预约,删除一个预约 - *

只能删除归属于自己的预约;删除后数据不可恢复 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DeleteReserveSample.java ; - */ - public DeleteReserveResp delete(DeleteReserveReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/vc/v1/reserves/:reserve_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - DeleteReserveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteReserveResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserves/:reserve_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取预约,获取一个预约的详情 - *

只能获取归属于自己的预约 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveSample.java ; - */ - public GetReserveResp get(GetReserveReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/reserves/:reserve_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetReserveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetReserveResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserves/:reserve_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取预约,获取一个预约的详情 - *

只能获取归属于自己的预约 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveSample.java ; - */ - public GetReserveResp get(GetReserveReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/reserves/:reserve_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetReserveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetReserveResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserves/:reserve_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取活跃会议,获取一个预约的当前活跃会议 - *

只能获取归属于自己的预约的活跃会议(一个预约最多有一个正在进行中的会议) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/get_active_meeting ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetActiveMeetingReserveSample.java ; - */ - public GetActiveMeetingReserveResp getActiveMeeting(GetActiveMeetingReserveReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/reserves/:reserve_id/get_active_meeting" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetActiveMeetingReserveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetActiveMeetingReserveResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserves/:reserve_id/get_active_meeting" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取活跃会议,获取一个预约的当前活跃会议 - *

只能获取归属于自己的预约的活跃会议(一个预约最多有一个正在进行中的会议) ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/get_active_meeting ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetActiveMeetingReserveSample.java ; - */ - public GetActiveMeetingReserveResp getActiveMeeting(GetActiveMeetingReserveReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/reserves/:reserve_id/get_active_meeting" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetActiveMeetingReserveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetActiveMeetingReserveResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserves/:reserve_id/get_active_meeting" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新预约,更新一个预约 - *

只能更新归属于自己的预约,不需要更新的字段不传(如果传空则会被更新为空);可用于续期操作,到期时间距离当前时间不超过30天 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/UpdateReserveSample.java ; - */ - public UpdateReserveResp update(UpdateReserveReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/vc/v1/reserves/:reserve_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateReserveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateReserveResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserves/:reserve_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新预约,更新一个预约 - *

只能更新归属于自己的预约,不需要更新的字段不传(如果传空则会被更新为空);可用于续期操作,到期时间距离当前时间不超过30天 ; - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/UpdateReserveSample.java ; - */ - public UpdateReserveResp update(UpdateReserveReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/vc/v1/reserves/:reserve_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateReserveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateReserveResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserves/:reserve_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ReserveConfig { - private final Config config; - - public ReserveConfig(Config config) { - this.config = config; - } - - /** - * 更新会议室预定范围,更新会议室预定范围 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve_config/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigSample.java ; - */ - public PatchReserveConfigResp patch(PatchReserveConfigReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/vc/v1/reserve_configs/:reserve_config_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchReserveConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchReserveConfigResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新会议室预定范围,更新会议室预定范围 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve_config/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigSample.java ; - */ - public PatchReserveConfigResp patch(PatchReserveConfigReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/vc/v1/reserve_configs/:reserve_config_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchReserveConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchReserveConfigResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取会议室预定范围,获取会议室预定范围 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve_config/reserve_scope ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ReserveScopeReserveConfigSample.java ; - */ - public ReserveScopeReserveConfigResp reserveScope(ReserveScopeReserveConfigReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/reserve_configs/reserve_scope" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ReserveScopeReserveConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ReserveScopeReserveConfigResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/reserve_scope" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取会议室预定范围,获取会议室预定范围 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve_config/reserve_scope ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ReserveScopeReserveConfigSample.java ; - */ - public ReserveScopeReserveConfigResp reserveScope(ReserveScopeReserveConfigReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/reserve_configs/reserve_scope" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ReserveScopeReserveConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ReserveScopeReserveConfigResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/reserve_scope" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ReserveConfigAdmin { - private final Config config; - - public ReserveConfigAdmin(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=reserve_config.admin&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveConfigAdminSample.java ; - */ - public GetReserveConfigAdminResp get(GetReserveConfigAdminReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetReserveConfigAdminResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetReserveConfigAdminResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=reserve_config.admin&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveConfigAdminSample.java ; - */ - public GetReserveConfigAdminResp get(GetReserveConfigAdminReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetReserveConfigAdminResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetReserveConfigAdminResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=vc&resource=reserve_config.admin&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigAdminSample.java ; - */ - public PatchReserveConfigAdminResp patch(PatchReserveConfigAdminReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchReserveConfigAdminResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchReserveConfigAdminResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=vc&resource=reserve_config.admin&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigAdminSample.java ; - */ - public PatchReserveConfigAdminResp patch(PatchReserveConfigAdminReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchReserveConfigAdminResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchReserveConfigAdminResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ReserveConfigDisableInform { - private final Config config; - - public ReserveConfigDisableInform(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=reserve_config.disable_inform&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveConfigDisableInformSample.java ; - */ - public GetReserveConfigDisableInformResp get(GetReserveConfigDisableInformReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetReserveConfigDisableInformResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetReserveConfigDisableInformResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=reserve_config.disable_inform&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveConfigDisableInformSample.java ; - */ - public GetReserveConfigDisableInformResp get(GetReserveConfigDisableInformReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetReserveConfigDisableInformResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetReserveConfigDisableInformResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=vc&resource=reserve_config.disable_inform&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigDisableInformSample.java ; - */ - public PatchReserveConfigDisableInformResp patch(PatchReserveConfigDisableInformReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchReserveConfigDisableInformResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchReserveConfigDisableInformResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=vc&resource=reserve_config.disable_inform&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigDisableInformSample.java ; - */ - public PatchReserveConfigDisableInformResp patch(PatchReserveConfigDisableInformReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchReserveConfigDisableInformResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchReserveConfigDisableInformResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ReserveConfigForm { - private final Config config; - - public ReserveConfigForm(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=reserve_config.form&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveConfigFormSample.java ; - */ - public GetReserveConfigFormResp get(GetReserveConfigFormReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/reserve_configs/:reserve_config_id/form" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetReserveConfigFormResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetReserveConfigFormResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id/form" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=reserve_config.form&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveConfigFormSample.java ; - */ - public GetReserveConfigFormResp get(GetReserveConfigFormReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/reserve_configs/:reserve_config_id/form" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetReserveConfigFormResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetReserveConfigFormResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id/form" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=vc&resource=reserve_config.form&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigFormSample.java ; - */ - public PatchReserveConfigFormResp patch(PatchReserveConfigFormReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/vc/v1/reserve_configs/:reserve_config_id/form" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchReserveConfigFormResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchReserveConfigFormResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id/form" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=vc&resource=reserve_config.form&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigFormSample.java ; - */ - public PatchReserveConfigFormResp patch(PatchReserveConfigFormReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/vc/v1/reserve_configs/:reserve_config_id/form" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchReserveConfigFormResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchReserveConfigFormResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id/form" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ResourceReservationList { - private final Config config; - - public ResourceReservationList(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=resource_reservation_list&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetResourceReservationListSample.java ; - */ - public GetResourceReservationListResp get(GetResourceReservationListReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/resource_reservation_list" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetResourceReservationListResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetResourceReservationListResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/resource_reservation_list" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=resource_reservation_list&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetResourceReservationListSample.java ; - */ - public GetResourceReservationListResp get(GetResourceReservationListReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/resource_reservation_list" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetResourceReservationListResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetResourceReservationListResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/resource_reservation_list" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Room { - private final Config config; - - public Room(Config config) { - this.config = config; - } - - /** - * 创建会议室,该接口用于创建会议室 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/CreateRoomSample.java ; - */ - public CreateRoomResp create(CreateRoomReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/rooms" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateRoomResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建会议室,该接口用于创建会议室 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/CreateRoomSample.java ; - */ - public CreateRoomResp create(CreateRoomReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/rooms" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateRoomResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除会议室,该接口可以用来删除某个会议室 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DeleteRoomSample.java ; - */ - public DeleteRoomResp delete(DeleteRoomReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/vc/v1/rooms/:room_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteRoomResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms/:room_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除会议室,该接口可以用来删除某个会议室 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DeleteRoomSample.java ; - */ - public DeleteRoomResp delete(DeleteRoomReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/vc/v1/rooms/:room_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteRoomResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms/:room_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询会议室详情,该接口可以使用会议室ID查询会议室详情 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetRoomSample.java ; - */ - public GetRoomResp get(GetRoomReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/rooms/:room_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetRoomResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms/:room_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询会议室详情,该接口可以使用会议室ID查询会议室详情 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetRoomSample.java ; - */ - public GetRoomResp get(GetRoomReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/rooms/:room_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetRoomResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms/:room_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询会议室列表,该接口可以用来查询某个会议室层级下会议室列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListRoomSample.java ; - */ - public ListRoomResp list(ListRoomReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/rooms" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListRoomResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询会议室列表,该接口可以用来查询某个会议室层级下会议室列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListRoomSample.java ; - */ - public ListRoomResp list(ListRoomReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/rooms" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListRoomResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询会议室详情,该接口可以使用会议室ID批量查询会议室详情 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/mget ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/MgetRoomSample.java ; - */ - public MgetRoomResp mget(MgetRoomReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/rooms/mget" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - MgetRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MgetRoomResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms/mget" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询会议室详情,该接口可以使用会议室ID批量查询会议室详情 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/mget ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/MgetRoomSample.java ; - */ - public MgetRoomResp mget(MgetRoomReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/rooms/mget" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - MgetRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MgetRoomResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms/mget" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新会议室,该接口可以用来更新某个会议室的信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchRoomSample.java ; - */ - public PatchRoomResp patch(PatchRoomReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/vc/v1/rooms/:room_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchRoomResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms/:room_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新会议室,该接口可以用来更新某个会议室的信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchRoomSample.java ; - */ - public PatchRoomResp patch(PatchRoomReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/vc/v1/rooms/:room_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchRoomResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms/:room_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 搜索会议室,该接口可以用来搜索会议室,支持使用关键词进行搜索,也支持使用自定义会议室ID进行查询 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/search ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SearchRoomSample.java ; - */ - public SearchRoomResp search(SearchRoomReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/rooms/search" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - SearchRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchRoomResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 搜索会议室,该接口可以用来搜索会议室,支持使用关键词进行搜索,也支持使用自定义会议室ID进行查询 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/search ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SearchRoomSample.java ; - */ - public SearchRoomResp search(SearchRoomReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/rooms/search" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - SearchRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchRoomResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class RoomConfig { - private final Config config; - - public RoomConfig(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=vc&resource=room_config&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/QueryRoomConfigSample.java ; - */ - public QueryRoomConfigResp query(QueryRoomConfigReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/room_configs/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryRoomConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryRoomConfigResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_configs/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=vc&resource=room_config&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/QueryRoomConfigSample.java ; - */ - public QueryRoomConfigResp query(QueryRoomConfigReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/room_configs/query" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - QueryRoomConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryRoomConfigResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_configs/query" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=set&project=vc&resource=room_config&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetRoomConfigSample.java ; - */ - public SetRoomConfigResp set(SetRoomConfigReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/room_configs/set" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SetRoomConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SetRoomConfigResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_configs/set" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=set&project=vc&resource=room_config&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetRoomConfigSample.java ; - */ - public SetRoomConfigResp set(SetRoomConfigReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/room_configs/set" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SetRoomConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SetRoomConfigResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_configs/set" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=set_checkboard_access_code&project=vc&resource=room_config&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetCheckboardAccessCodeRoomConfigSample.java ; - */ - public SetCheckboardAccessCodeRoomConfigResp setCheckboardAccessCode(SetCheckboardAccessCodeRoomConfigReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/room_configs/set_checkboard_access_code" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SetCheckboardAccessCodeRoomConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SetCheckboardAccessCodeRoomConfigResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_configs/set_checkboard_access_code" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=set_checkboard_access_code&project=vc&resource=room_config&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetCheckboardAccessCodeRoomConfigSample.java ; - */ - public SetCheckboardAccessCodeRoomConfigResp setCheckboardAccessCode(SetCheckboardAccessCodeRoomConfigReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/room_configs/set_checkboard_access_code" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SetCheckboardAccessCodeRoomConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SetCheckboardAccessCodeRoomConfigResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_configs/set_checkboard_access_code" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=set_room_access_code&project=vc&resource=room_config&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetRoomAccessCodeRoomConfigSample.java ; - */ - public SetRoomAccessCodeRoomConfigResp setRoomAccessCode(SetRoomAccessCodeRoomConfigReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/room_configs/set_room_access_code" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SetRoomAccessCodeRoomConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SetRoomAccessCodeRoomConfigResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_configs/set_room_access_code" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=set_room_access_code&project=vc&resource=room_config&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetRoomAccessCodeRoomConfigSample.java ; - */ - public SetRoomAccessCodeRoomConfigResp setRoomAccessCode(SetRoomAccessCodeRoomConfigReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/room_configs/set_room_access_code" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SetRoomAccessCodeRoomConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SetRoomAccessCodeRoomConfigResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_configs/set_room_access_code" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class RoomLevel { - private final Config config; - - public RoomLevel(Config config) { - this.config = config; - } - - /** - * 创建会议室层级,该接口用于创建会议室层级 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/CreateRoomLevelSample.java ; - */ - public CreateRoomLevelResp create(CreateRoomLevelReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/room_levels" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateRoomLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建会议室层级,该接口用于创建会议室层级 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/CreateRoomLevelSample.java ; - */ - public CreateRoomLevelResp create(CreateRoomLevelReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/room_levels" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateRoomLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除会议室层级,该接口可以用来删除某个会议室层级 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/del ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DelRoomLevelSample.java ; - */ - public DelRoomLevelResp del(DelRoomLevelReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/room_levels/del" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DelRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DelRoomLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels/del" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除会议室层级,该接口可以用来删除某个会议室层级 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/del ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DelRoomLevelSample.java ; - */ - public DelRoomLevelResp del(DelRoomLevelReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/room_levels/del" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DelRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DelRoomLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels/del" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询会议室层级详情,该接口可以使用会议室层级ID查询会议室层级详情 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetRoomLevelSample.java ; - */ - public GetRoomLevelResp get(GetRoomLevelReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/room_levels/:room_level_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetRoomLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels/:room_level_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询会议室层级详情,该接口可以使用会议室层级ID查询会议室层级详情 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetRoomLevelSample.java ; - */ - public GetRoomLevelResp get(GetRoomLevelReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/room_levels/:room_level_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetRoomLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels/:room_level_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询会议室层级列表,该接口用来查询某个会议室层级下的子层级列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListRoomLevelSample.java ; - */ - public ListRoomLevelResp list(ListRoomLevelReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/room_levels" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListRoomLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询会议室层级列表,该接口用来查询某个会议室层级下的子层级列表 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListRoomLevelSample.java ; - */ - public ListRoomLevelResp list(ListRoomLevelReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/room_levels" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - ListRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListRoomLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询会议室层级详情,该接口可以使用会议室层级ID批量查询会议室层级详情 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/mget ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/MgetRoomLevelSample.java ; - */ - public MgetRoomLevelResp mget(MgetRoomLevelReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/room_levels/mget" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - MgetRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MgetRoomLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels/mget" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 批量查询会议室层级详情,该接口可以使用会议室层级ID批量查询会议室层级详情 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/mget ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/MgetRoomLevelSample.java ; - */ - public MgetRoomLevelResp mget(MgetRoomLevelReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/room_levels/mget" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - MgetRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MgetRoomLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels/mget" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新会议室层级,该接口可以用来更新某个会议室层级的信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchRoomLevelSample.java ; - */ - public PatchRoomLevelResp patch(PatchRoomLevelReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/vc/v1/room_levels/:room_level_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchRoomLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels/:room_level_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新会议室层级,该接口可以用来更新某个会议室层级的信息 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/patch ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchRoomLevelSample.java ; - */ - public PatchRoomLevelResp patch(PatchRoomLevelReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" - , "/open-apis/vc/v1/room_levels/:room_level_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - PatchRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchRoomLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels/:room_level_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 搜索会议室层级,该接口可以用来搜索会议室层级,支持使用自定义会议室层级ID进行查询 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/search ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SearchRoomLevelSample.java ; - */ - public SearchRoomLevelResp search(SearchRoomLevelReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/room_levels/search" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - SearchRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchRoomLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 搜索会议室层级,该接口可以用来搜索会议室层级,支持使用自定义会议室层级ID进行查询 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/search ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SearchRoomLevelSample.java ; - */ - public SearchRoomLevelResp search(SearchRoomLevelReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/room_levels/search" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - SearchRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchRoomLevelResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class ScopeConfig { - private final Config config; - - public ScopeConfig(Config config) { - this.config = config; - } - - /** - * 设置会议室配置,该接口可以用来设置某个会议层级范围下或者某个会议室的配置 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/scope_config/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/CreateScopeConfigSample.java ; - */ - public CreateScopeConfigResp create(CreateScopeConfigReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/scope_config" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateScopeConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateScopeConfigResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/scope_config" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 设置会议室配置,该接口可以用来设置某个会议层级范围下或者某个会议室的配置 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/scope_config/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/CreateScopeConfigSample.java ; - */ - public CreateScopeConfigResp create(CreateScopeConfigReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/vc/v1/scope_config" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CreateScopeConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateScopeConfigResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/scope_config" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询会议室配置,该接口可以用来查询某个会议层级范围下或者某个会议室的配置 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/scope_config/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetScopeConfigSample.java ; - */ - public GetScopeConfigResp get(GetScopeConfigReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/scope_config" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetScopeConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetScopeConfigResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/scope_config" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 查询会议室配置,该接口可以用来查询某个会议层级范围下或者某个会议室的配置 - *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/scope_config/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetScopeConfigSample.java ; - */ - public GetScopeConfigResp get(GetScopeConfigReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/vc/v1/scope_config" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetScopeConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetScopeConfigResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/scope_config" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public abstract static class P2MeetingAllMeetingEndedV1Handler implements IEventHandler { - @Override - public P2MeetingAllMeetingEndedV1 getEvent() { - return new P2MeetingAllMeetingEndedV1(); - } - } - - public abstract static class P2MeetingAllMeetingStartedV1Handler implements IEventHandler { - @Override - public P2MeetingAllMeetingStartedV1 getEvent() { - return new P2MeetingAllMeetingStartedV1(); - } - } - - public abstract static class P2MeetingJoinMeetingV1Handler implements IEventHandler { - @Override - public P2MeetingJoinMeetingV1 getEvent() { - return new P2MeetingJoinMeetingV1(); - } - } - - public abstract static class P2MeetingLeaveMeetingV1Handler implements IEventHandler { - @Override - public P2MeetingLeaveMeetingV1 getEvent() { - return new P2MeetingLeaveMeetingV1(); - } - } - - public abstract static class P2MeetingEndedV1Handler implements IEventHandler { - @Override - public P2MeetingEndedV1 getEvent() { - return new P2MeetingEndedV1(); - } - } - - public abstract static class P2MeetingStartedV1Handler implements IEventHandler { - @Override - public P2MeetingStartedV1 getEvent() { - return new P2MeetingStartedV1(); - } - } - - public abstract static class P2MeetingRecordingEndedV1Handler implements IEventHandler { - @Override - public P2MeetingRecordingEndedV1 getEvent() { - return new P2MeetingRecordingEndedV1(); - } - } - - public abstract static class P2MeetingRecordingReadyV1Handler implements IEventHandler { - @Override - public P2MeetingRecordingReadyV1 getEvent() { - return new P2MeetingRecordingReadyV1(); - } - } - - public abstract static class P2MeetingRecordingStartedV1Handler implements IEventHandler { - @Override - public P2MeetingRecordingStartedV1 getEvent() { - return new P2MeetingRecordingStartedV1(); - } - } - - public abstract static class P2MeetingShareEndedV1Handler implements IEventHandler { - @Override - public P2MeetingShareEndedV1 getEvent() { - return new P2MeetingShareEndedV1(); - } - } - - public abstract static class P2MeetingShareStartedV1Handler implements IEventHandler { - @Override - public P2MeetingShareStartedV1 getEvent() { - return new P2MeetingShareStartedV1(); - } - } - - public abstract static class P2ReserveConfigUpdatedV1Handler implements IEventHandler { - @Override - public P2ReserveConfigUpdatedV1 getEvent() { - return new P2ReserveConfigUpdatedV1(); - } - } - - public abstract static class P2RoomCreatedV1Handler implements IEventHandler { - @Override - public P2RoomCreatedV1 getEvent() { - return new P2RoomCreatedV1(); - } - } - - public abstract static class P2RoomDeletedV1Handler implements IEventHandler { - @Override - public P2RoomDeletedV1 getEvent() { - return new P2RoomDeletedV1(); - } - } - - public abstract static class P2RoomUpdatedV1Handler implements IEventHandler { - @Override - public P2RoomUpdatedV1 getEvent() { - return new P2RoomUpdatedV1(); - } - } - - public abstract static class P2RoomLevelCreatedV1Handler implements IEventHandler { - @Override - public P2RoomLevelCreatedV1 getEvent() { - return new P2RoomLevelCreatedV1(); - } - } - - public abstract static class P2RoomLevelDeletedV1Handler implements IEventHandler { - @Override - public P2RoomLevelDeletedV1 getEvent() { - return new P2RoomLevelDeletedV1(); - } - } - - public abstract static class P2RoomLevelUpdatedV1Handler implements IEventHandler { - @Override - public P2RoomLevelUpdatedV1 getEvent() { - return new P2RoomLevelUpdatedV1(); - } - } -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/enums/GetMeetingListMeetingStatusTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/enums/GetMeetingListMeetingStatusTypeEnum.java new file mode 100644 index 000000000..9f74aa81c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/enums/GetMeetingListMeetingStatusTypeEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.vc.v1.enums; + +/** + * 会议状态 + */ +public enum GetMeetingListMeetingStatusTypeEnum { + ONGOING(1), // 进行中 + PAST(2), // 已结束 + ; + private Integer value; + + GetMeetingListMeetingStatusTypeEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/enums/GetParticipantListMeetingStatusTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/enums/GetParticipantListMeetingStatusTypeEnum.java new file mode 100644 index 000000000..9f7205585 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/enums/GetParticipantListMeetingStatusTypeEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.vc.v1.enums; + +/** + * 会议状态(不传默认为已结束会议) + */ +public enum GetParticipantListMeetingStatusTypeEnum { + ONGOING(1), // 进行中 + PAST(2), // 已结束 + ; + private Integer value; + + GetParticipantListMeetingStatusTypeEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/enums/MeetingListExportMeetingStatusTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/enums/MeetingListExportMeetingStatusTypeEnum.java new file mode 100644 index 000000000..5ea3fea9b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/enums/MeetingListExportMeetingStatusTypeEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.vc.v1.enums; + +/** + * 会议状态(不传默认为已结束会议) + */ +public enum MeetingListExportMeetingStatusTypeEnum { + ONGOING(1), // 进行中 + PAST(2), // 已结束 + ; + private Integer value; + + MeetingListExportMeetingStatusTypeEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/enums/ParticipantListExportMeetingStatusTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/enums/ParticipantListExportMeetingStatusTypeEnum.java new file mode 100644 index 000000000..021d1a87d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/enums/ParticipantListExportMeetingStatusTypeEnum.java @@ -0,0 +1,32 @@ +// Code generated by lark suite 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 com.lark.oapi.service.vc.v1.enums; + +/** + * 会议状态(不传默认为已结束会议) + */ +public enum ParticipantListExportMeetingStatusTypeEnum { + ONGOING(1), // 进行中 + PAST(2), // 已结束 + ; + private Integer value; + + ParticipantListExportMeetingStatusTypeEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/model/GetMeetingListReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/model/GetMeetingListReq.java index 095a53ff5..820546fff 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/model/GetMeetingListReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/model/GetMeetingListReq.java @@ -31,6 +31,13 @@ public class GetMeetingListReq { @Query @SerializedName("end_time") private String endTime; + /** + * 会议状态 + *

示例值:2 + */ + @Query + @SerializedName("meeting_status") + private Integer meetingStatus; /** * 按9位会议号筛选(最多一个筛选条件) *

示例值:123456789 @@ -89,6 +96,11 @@ public GetMeetingListReq(Builder builder) { *

示例值:1655276858 */ this.endTime = builder.endTime; + /** + * 会议状态 + *

示例值:2 + */ + this.meetingStatus = builder.meetingStatus; /** * 按9位会议号筛选(最多一个筛选条件) *

示例值:123456789 @@ -141,6 +153,14 @@ public void setEndTime(String endTime) { this.endTime = endTime; } + public Integer getMeetingStatus() { + return this.meetingStatus; + } + + public void setMeetingStatus(Integer meetingStatus) { + this.meetingStatus = meetingStatus; + } + public String getMeetingNo() { return this.meetingNo; } @@ -192,6 +212,7 @@ public void setUserIdType(String userIdType) { public static class Builder { private String startTime; // 查询开始时间(unix时间,单位sec) private String endTime; // 查询结束时间(unix时间,单位sec) + private Integer meetingStatus; // 会议状态 private String meetingNo; // 按9位会议号筛选(最多一个筛选条件) private String userId; // 按参会Lark用户筛选(最多一个筛选条件) private String roomId; // 按参会Rooms筛选(最多一个筛选条件) @@ -226,6 +247,31 @@ public Builder endTime(String endTime) { } + /** + * 会议状态 + *

示例值:2 + * + * @param meetingStatus + * @return + */ + public Builder meetingStatus(Integer meetingStatus) { + this.meetingStatus = meetingStatus; + return this; + } + + /** + * 会议状态 + *

示例值:2 + * + * @param meetingStatus {@link com.lark.oapi.service.vc.v1.enums.GetMeetingListMeetingStatusTypeEnum} + * @return + */ + public Builder meetingStatus(com.lark.oapi.service.vc.v1.enums.GetMeetingListMeetingStatusTypeEnum meetingStatus) { + this.meetingStatus = meetingStatus.getValue(); + return this; + } + + /** * 按9位会议号筛选(最多一个筛选条件) *

示例值:123456789 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/model/GetParticipantListReq.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/model/GetParticipantListReq.java index 78efa8b8d..4683d5ead 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/model/GetParticipantListReq.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/model/GetParticipantListReq.java @@ -25,12 +25,19 @@ public class GetParticipantListReq { @SerializedName("meeting_start_time") private String meetingStartTime; /** - * 会议结束时间(unix时间,单位sec) + * 会议结束时间(unix时间,单位sec;对于进行中会议则传0) *

示例值:1655276858 */ @Query @SerializedName("meeting_end_time") private String meetingEndTime; + /** + * 会议状态(不传默认为已结束会议) + *

示例值:2 + */ + @Query + @SerializedName("meeting_status") + private Integer meetingStatus; /** * 9位会议号 *

示例值:123456789 @@ -85,10 +92,15 @@ public GetParticipantListReq(Builder builder) { */ this.meetingStartTime = builder.meetingStartTime; /** - * 会议结束时间(unix时间,单位sec) + * 会议结束时间(unix时间,单位sec;对于进行中会议则传0) *

示例值:1655276858 */ this.meetingEndTime = builder.meetingEndTime; + /** + * 会议状态(不传默认为已结束会议) + *

示例值:2 + */ + this.meetingStatus = builder.meetingStatus; /** * 9位会议号 *

示例值:123456789 @@ -141,6 +153,14 @@ public void setMeetingEndTime(String meetingEndTime) { this.meetingEndTime = meetingEndTime; } + public Integer getMeetingStatus() { + return this.meetingStatus; + } + + public void setMeetingStatus(Integer meetingStatus) { + this.meetingStatus = meetingStatus; + } + public String getMeetingNo() { return this.meetingNo; } @@ -191,7 +211,8 @@ public void setUserIdType(String userIdType) { public static class Builder { private String meetingStartTime; // 会议开始时间(需要精确到一分钟,unix时间,单位sec) - private String meetingEndTime; // 会议结束时间(unix时间,单位sec) + private String meetingEndTime; // 会议结束时间(unix时间,单位sec;对于进行中会议则传0) + private Integer meetingStatus; // 会议状态(不传默认为已结束会议) private String meetingNo; // 9位会议号 private String userId; // 按参会Lark用户筛选(最多一个筛选条件) private String roomId; // 按参会Rooms筛选(最多一个筛选条件) @@ -214,7 +235,7 @@ public Builder meetingStartTime(String meetingStartTime) { /** - * 会议结束时间(unix时间,单位sec) + * 会议结束时间(unix时间,单位sec;对于进行中会议则传0) *

示例值:1655276858 * * @param meetingEndTime @@ -226,6 +247,31 @@ public Builder meetingEndTime(String meetingEndTime) { } + /** + * 会议状态(不传默认为已结束会议) + *

示例值:2 + * + * @param meetingStatus + * @return + */ + public Builder meetingStatus(Integer meetingStatus) { + this.meetingStatus = meetingStatus; + return this; + } + + /** + * 会议状态(不传默认为已结束会议) + *

示例值:2 + * + * @param meetingStatus {@link com.lark.oapi.service.vc.v1.enums.GetParticipantListMeetingStatusTypeEnum} + * @return + */ + public Builder meetingStatus(com.lark.oapi.service.vc.v1.enums.GetParticipantListMeetingStatusTypeEnum meetingStatus) { + this.meetingStatus = meetingStatus.getValue(); + return this; + } + + /** * 9位会议号 *

示例值:123456789 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/model/MeetingListExportReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/model/MeetingListExportReqBody.java index a43424e93..91305554b 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/model/MeetingListExportReqBody.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/model/MeetingListExportReqBody.java @@ -28,6 +28,12 @@ public class MeetingListExportReqBody { */ @SerializedName("end_time") private String endTime; + /** + * 会议状态(不传默认为已结束会议) + *

示例值:2 + */ + @SerializedName("meeting_status") + private Integer meetingStatus; /** * 按9位会议号筛选(最多一个筛选条件) *

示例值:123456789 @@ -62,6 +68,11 @@ public MeetingListExportReqBody(Builder builder) { *

示例值:1655276858 */ this.endTime = builder.endTime; + /** + * 会议状态(不传默认为已结束会议) + *

示例值:2 + */ + this.meetingStatus = builder.meetingStatus; /** * 按9位会议号筛选(最多一个筛选条件) *

示例值:123456789 @@ -99,6 +110,14 @@ public void setEndTime(String endTime) { this.endTime = endTime; } + public Integer getMeetingStatus() { + return this.meetingStatus; + } + + public void setMeetingStatus(Integer meetingStatus) { + this.meetingStatus = meetingStatus; + } + public String getMeetingNo() { return this.meetingNo; } @@ -134,6 +153,11 @@ public static class Builder { *

示例值:1655276858 */ private String endTime; + /** + * 会议状态(不传默认为已结束会议) + *

示例值:2 + */ + private Integer meetingStatus; /** * 按9位会议号筛选(最多一个筛选条件) *

示例值:123456789 @@ -176,6 +200,31 @@ public Builder endTime(String endTime) { } + /** + * 会议状态(不传默认为已结束会议) + *

示例值:2 + * + * @param meetingStatus + * @return + */ + public Builder meetingStatus(Integer meetingStatus) { + this.meetingStatus = meetingStatus; + return this; + } + + /** + * 会议状态(不传默认为已结束会议) + *

示例值:2 + * + * @param meetingStatus {@link com.lark.oapi.service.vc.v1.enums.MeetingListExportMeetingStatusTypeEnum} + * @return + */ + public Builder meetingStatus(com.lark.oapi.service.vc.v1.enums.MeetingListExportMeetingStatusTypeEnum meetingStatus) { + this.meetingStatus = meetingStatus.getValue(); + return this; + } + + /** * 按9位会议号筛选(最多一个筛选条件) *

示例值:123456789 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/model/MyAiRoomOpenapiResponse.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/model/MyAiRoomOpenapiResponse.java index 032659034..b7b745348 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/model/MyAiRoomOpenapiResponse.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/model/MyAiRoomOpenapiResponse.java @@ -34,6 +34,12 @@ public class MyAiRoomOpenapiResponse { */ @SerializedName("other_msg") private String otherMsg; + /** + * oapi 传递的消息,用于缓存 + *

示例值:{} + */ + @SerializedName("oapi_msg") + private String oapiMsg; // builder 开始 public MyAiRoomOpenapiResponse() { @@ -55,6 +61,11 @@ public MyAiRoomOpenapiResponse(Builder builder) { *

示例值:{} */ this.otherMsg = builder.otherMsg; + /** + * oapi 传递的消息,用于缓存 + *

示例值:{} + */ + this.oapiMsg = builder.oapiMsg; } public static Builder newBuilder() { @@ -85,6 +96,14 @@ public void setOtherMsg(String otherMsg) { this.otherMsg = otherMsg; } + public String getOapiMsg() { + return this.oapiMsg; + } + + public void setOapiMsg(String oapiMsg) { + this.oapiMsg = oapiMsg; + } + public static class Builder { /** * openapi 返回的意图类型,不同 tool 的不同值都不一样 @@ -101,6 +120,11 @@ public static class Builder { *

示例值:{} */ private String otherMsg; + /** + * oapi 传递的消息,用于缓存 + *

示例值:{} + */ + private String oapiMsg; /** * openapi 返回的意图类型,不同 tool 的不同值都不一样 @@ -141,6 +165,19 @@ public Builder otherMsg(String otherMsg) { } + /** + * oapi 传递的消息,用于缓存 + *

示例值:{} + * + * @param oapiMsg + * @return + */ + public Builder oapiMsg(String oapiMsg) { + this.oapiMsg = oapiMsg; + return this; + } + + public MyAiRoomOpenapiResponse build() { return new MyAiRoomOpenapiResponse(this); } diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/model/ParticipantListExportReqBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/model/ParticipantListExportReqBody.java index fab90d344..8d6e8ed52 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/model/ParticipantListExportReqBody.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/model/ParticipantListExportReqBody.java @@ -28,6 +28,12 @@ public class ParticipantListExportReqBody { */ @SerializedName("meeting_end_time") private String meetingEndTime; + /** + * 会议状态(不传默认为已结束会议) + *

示例值:2 + */ + @SerializedName("meeting_status") + private Integer meetingStatus; /** * 9位会议号 *

示例值:123456789 @@ -62,6 +68,11 @@ public ParticipantListExportReqBody(Builder builder) { *

示例值:1655276858 */ this.meetingEndTime = builder.meetingEndTime; + /** + * 会议状态(不传默认为已结束会议) + *

示例值:2 + */ + this.meetingStatus = builder.meetingStatus; /** * 9位会议号 *

示例值:123456789 @@ -99,6 +110,14 @@ public void setMeetingEndTime(String meetingEndTime) { this.meetingEndTime = meetingEndTime; } + public Integer getMeetingStatus() { + return this.meetingStatus; + } + + public void setMeetingStatus(Integer meetingStatus) { + this.meetingStatus = meetingStatus; + } + public String getMeetingNo() { return this.meetingNo; } @@ -134,6 +153,11 @@ public static class Builder { *

示例值:1655276858 */ private String meetingEndTime; + /** + * 会议状态(不传默认为已结束会议) + *

示例值:2 + */ + private Integer meetingStatus; /** * 9位会议号 *

示例值:123456789 @@ -176,6 +200,31 @@ public Builder meetingEndTime(String meetingEndTime) { } + /** + * 会议状态(不传默认为已结束会议) + *

示例值:2 + * + * @param meetingStatus + * @return + */ + public Builder meetingStatus(Integer meetingStatus) { + this.meetingStatus = meetingStatus; + return this; + } + + /** + * 会议状态(不传默认为已结束会议) + *

示例值:2 + * + * @param meetingStatus {@link com.lark.oapi.service.vc.v1.enums.ParticipantListExportMeetingStatusTypeEnum} + * @return + */ + public Builder meetingStatus(com.lark.oapi.service.vc.v1.enums.ParticipantListExportMeetingStatusTypeEnum meetingStatus) { + this.meetingStatus = meetingStatus.getValue(); + return this; + } + + /** * 9位会议号 *

示例值:123456789 diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/Alert.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/Alert.java new file mode 100644 index 000000000..3b5e81a61 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/Alert.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.vc.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.vc.v1.model.ListAlertReq; +import com.lark.oapi.service.vc.v1.model.ListAlertResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Alert { + private static final Logger log = LoggerFactory.getLogger(Alert.class); + private final Config config; + + public Alert(Config config) { + this.config = config; + } + + + /** + * 获取告警记录,获取特定条件下租户的设备告警记录 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/alert/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListAlertSample.java ; + */ + public ListAlertResp list(ListAlertReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/alerts" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListAlertResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAlertResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/alerts" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取告警记录,获取特定条件下租户的设备告警记录 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/alert/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListAlertSample.java ; + */ + public ListAlertResp list(ListAlertReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/alerts" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + ListAlertResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListAlertResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/alerts" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/Export.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/Export.java new file mode 100644 index 000000000..17d17fb83 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/Export.java @@ -0,0 +1,456 @@ +// Code generated by lark suite 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 com.lark.oapi.service.vc.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.vc.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.ByteArrayOutputStream; +import java.nio.charset.StandardCharsets; + +public class Export { + private static final Logger log = LoggerFactory.getLogger(Export.class); + private final Config config; + + public Export(Config config) { + this.config = config; + } + + + /** + * 下载导出文件,下载导出文件 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/download ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DownloadExportSample.java ; + */ + public DownloadExportResp download(DownloadExportReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/exports/download" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + if (httpResponse.getStatusCode() == 200) { + DownloadExportResp resp = new DownloadExportResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + DownloadExportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadExportResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/exports/download" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 下载导出文件,下载导出文件 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/download ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DownloadExportSample.java ; + */ + public DownloadExportResp download(DownloadExportReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + reqOptions.setSupportDownLoad(true); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/exports/download" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 下载请求,返回流 + if (httpResponse.getStatusCode() == 200) { + DownloadExportResp resp = new DownloadExportResp(); + resp.setRawResponse(httpResponse); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + outputStream.write(httpResponse.getBody()); + resp.setData(outputStream); + resp.setFileName(httpResponse.getFileName()); + return resp; + } + // 反序列化 + DownloadExportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadExportResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/exports/download" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询导出任务结果,查看异步导出的进度 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetExportSample.java ; + */ + public GetExportResp get(GetExportReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/exports/:task_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetExportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetExportResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/exports/:task_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询导出任务结果,查看异步导出的进度 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetExportSample.java ; + */ + public GetExportResp get(GetExportReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/exports/:task_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetExportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetExportResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/exports/:task_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 导出会议明细,导出会议明细,具体权限要求请参考「导出概述」 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/meeting_list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/MeetingListExportSample.java ; + */ + public MeetingListExportResp meetingList(MeetingListExportReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/exports/meeting_list" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + MeetingListExportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MeetingListExportResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/exports/meeting_list" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 导出会议明细,导出会议明细,具体权限要求请参考「导出概述」 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/meeting_list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/MeetingListExportSample.java ; + */ + public MeetingListExportResp meetingList(MeetingListExportReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/exports/meeting_list" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + MeetingListExportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MeetingListExportResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/exports/meeting_list" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 导出参会人明细,导出某个会议的参会人详情列表,具体权限要求请参考「导出概述」 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/participant_list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ParticipantListExportSample.java ; + */ + public ParticipantListExportResp participantList(ParticipantListExportReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/exports/participant_list" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ParticipantListExportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ParticipantListExportResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/exports/participant_list" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 导出参会人明细,导出某个会议的参会人详情列表,具体权限要求请参考「导出概述」 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/participant_list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ParticipantListExportSample.java ; + */ + public ParticipantListExportResp participantList(ParticipantListExportReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/exports/participant_list" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ParticipantListExportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ParticipantListExportResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/exports/participant_list" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 导出参会人会议质量数据,导出某场会议某个参会人的音视频&共享质量数据;,具体权限要求请参考「导出概述」 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/participant_quality_list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ParticipantQualityListExportSample.java ; + */ + public ParticipantQualityListExportResp participantQualityList(ParticipantQualityListExportReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/exports/participant_quality_list" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ParticipantQualityListExportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ParticipantQualityListExportResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/exports/participant_quality_list" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 导出参会人会议质量数据,导出某场会议某个参会人的音视频&共享质量数据;,具体权限要求请参考「导出概述」 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/participant_quality_list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ParticipantQualityListExportSample.java ; + */ + public ParticipantQualityListExportResp participantQualityList(ParticipantQualityListExportReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/exports/participant_quality_list" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ParticipantQualityListExportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ParticipantQualityListExportResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/exports/participant_quality_list" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 导出会议室预定数据,导出会议室预定数据,具体权限要求请参考「导出概述」 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/resource_reservation_list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ResourceReservationListExportSample.java ; + */ + public ResourceReservationListExportResp resourceReservationList(ResourceReservationListExportReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/exports/resource_reservation_list" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ResourceReservationListExportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ResourceReservationListExportResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/exports/resource_reservation_list" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 导出会议室预定数据,导出会议室预定数据,具体权限要求请参考「导出概述」 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/resource_reservation_list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ResourceReservationListExportSample.java ; + */ + public ResourceReservationListExportResp resourceReservationList(ResourceReservationListExportReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/exports/resource_reservation_list" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ResourceReservationListExportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ResourceReservationListExportResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/exports/resource_reservation_list" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/Meeting.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/Meeting.java new file mode 100644 index 000000000..50fdf168e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/Meeting.java @@ -0,0 +1,442 @@ +// Code generated by lark suite 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 com.lark.oapi.service.vc.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.vc.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Meeting { + private static final Logger log = LoggerFactory.getLogger(Meeting.class); + private final Config config; + + public Meeting(Config config) { + this.config = config; + } + + + /** + * 结束会议,结束一个进行中的会议 + *

会议正在进行中,且操作者须具有相应的权限(如果操作者为用户,必须是会中当前主持人) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/end ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/EndMeetingSample.java ; + */ + public EndMeetingResp end(EndMeetingReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/vc/v1/meetings/:meeting_id/end" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + EndMeetingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, EndMeetingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/end" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 结束会议,结束一个进行中的会议 + *

会议正在进行中,且操作者须具有相应的权限(如果操作者为用户,必须是会中当前主持人) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/end ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/EndMeetingSample.java ; + */ + public EndMeetingResp end(EndMeetingReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/vc/v1/meetings/:meeting_id/end" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + EndMeetingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, EndMeetingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/end" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取会议详情,获取一个会议的详细数据 + *

只能获取归属于自己的会议,支持查询最近90天内的会议 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetMeetingSample.java ; + */ + public GetMeetingResp get(GetMeetingReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/meetings/:meeting_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetMeetingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMeetingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取会议详情,获取一个会议的详细数据 + *

只能获取归属于自己的会议,支持查询最近90天内的会议 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetMeetingSample.java ; + */ + public GetMeetingResp get(GetMeetingReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/meetings/:meeting_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetMeetingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMeetingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 邀请参会人,邀请参会人进入会议 + *

发起邀请的操作者必须具有相应的权限(如果操作者为用户,则必须在会中),如果会议被锁定、或参会人数如果达到上限,则会邀请失败 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/invite ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/InviteMeetingSample.java ; + */ + public InviteMeetingResp invite(InviteMeetingReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/vc/v1/meetings/:meeting_id/invite" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + InviteMeetingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, InviteMeetingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/invite" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 邀请参会人,邀请参会人进入会议 + *

发起邀请的操作者必须具有相应的权限(如果操作者为用户,则必须在会中),如果会议被锁定、或参会人数如果达到上限,则会邀请失败 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/invite ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/InviteMeetingSample.java ; + */ + public InviteMeetingResp invite(InviteMeetingReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/vc/v1/meetings/:meeting_id/invite" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + InviteMeetingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, InviteMeetingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/invite" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 移除参会人,将参会人从会议中移除 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/kickout ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/KickoutMeetingSample.java ; + */ + public KickoutMeetingResp kickout(KickoutMeetingReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/meetings/:meeting_id/kickout" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + KickoutMeetingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, KickoutMeetingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/kickout" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 移除参会人,将参会人从会议中移除 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/kickout ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/KickoutMeetingSample.java ; + */ + public KickoutMeetingResp kickout(KickoutMeetingReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/meetings/:meeting_id/kickout" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + KickoutMeetingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, KickoutMeetingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/kickout" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取与会议号相关联的会议列表,获取指定时间范围(90天内)会议号关联的会议简要信息列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/list_by_no ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListByNoMeetingSample.java ; + */ + public ListByNoMeetingResp listByNo(ListByNoMeetingReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/meetings/list_by_no" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListByNoMeetingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListByNoMeetingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/list_by_no" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取与会议号相关联的会议列表,获取指定时间范围(90天内)会议号关联的会议简要信息列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/list_by_no ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListByNoMeetingSample.java ; + */ + public ListByNoMeetingResp listByNo(ListByNoMeetingReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/meetings/list_by_no" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListByNoMeetingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListByNoMeetingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/list_by_no" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 设置主持人,设置会议的主持人 + *

发起设置主持人的操作者必须具有相应的权限(如果操作者为用户,必须是会中当前主持人);该操作使用CAS并发安全机制,需传入会中当前主持人,如果操作失败可使用返回的最新数据重试 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/set_host ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetHostMeetingSample.java ; + */ + public SetHostMeetingResp setHost(SetHostMeetingReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/vc/v1/meetings/:meeting_id/set_host" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + SetHostMeetingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SetHostMeetingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/set_host" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 设置主持人,设置会议的主持人 + *

发起设置主持人的操作者必须具有相应的权限(如果操作者为用户,必须是会中当前主持人);该操作使用CAS并发安全机制,需传入会中当前主持人,如果操作失败可使用返回的最新数据重试 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/set_host ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetHostMeetingSample.java ; + */ + public SetHostMeetingResp setHost(SetHostMeetingReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/vc/v1/meetings/:meeting_id/set_host" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + SetHostMeetingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SetHostMeetingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/set_host" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/MeetingList.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/MeetingList.java new file mode 100644 index 000000000..8b5509c7c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/MeetingList.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.vc.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.vc.v1.model.GetMeetingListReq; +import com.lark.oapi.service.vc.v1.model.GetMeetingListResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class MeetingList { + private static final Logger log = LoggerFactory.getLogger(MeetingList.class); + private final Config config; + + public MeetingList(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=meeting_list&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetMeetingListSample.java ; + */ + public GetMeetingListResp get(GetMeetingListReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/meeting_list" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetMeetingListResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMeetingListResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meeting_list" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=meeting_list&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetMeetingListSample.java ; + */ + public GetMeetingListResp get(GetMeetingListReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/meeting_list" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetMeetingListResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMeetingListResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meeting_list" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/MeetingRecording.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/MeetingRecording.java new file mode 100644 index 000000000..ab8b21742 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/MeetingRecording.java @@ -0,0 +1,310 @@ +// Code generated by lark suite 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 com.lark.oapi.service.vc.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.vc.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class MeetingRecording { + private static final Logger log = LoggerFactory.getLogger(MeetingRecording.class); + private final Config config; + + public MeetingRecording(Config config) { + this.config = config; + } + + + /** + * 获取录制文件,获取一个会议的录制文件。 + *

会议结束后并且收到了"录制完成"的事件方可获取录制文件;只有会议owner(通过开放平台预约的会议即为预约人)有权限获取;录制时间太短(<5s)有可能无法生成录制文件 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting-recording/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetMeetingRecordingSample.java ; + */ + public GetMeetingRecordingResp get(GetMeetingRecordingReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/meetings/:meeting_id/recording" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetMeetingRecordingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMeetingRecordingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/recording" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取录制文件,获取一个会议的录制文件。 + *

会议结束后并且收到了"录制完成"的事件方可获取录制文件;只有会议owner(通过开放平台预约的会议即为预约人)有权限获取;录制时间太短(<5s)有可能无法生成录制文件 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting-recording/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetMeetingRecordingSample.java ; + */ + public GetMeetingRecordingResp get(GetMeetingRecordingReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/meetings/:meeting_id/recording" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetMeetingRecordingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetMeetingRecordingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/recording" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 授权录制文件,将一个会议的录制文件授权给组织、用户或公开到公网 + *

会议结束后并且收到了"录制完成"的事件方可进行授权;会议owner(通过开放平台预约的会议即为预约人)才有权限操作 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting-recording/set_permission ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetPermissionMeetingRecordingSample.java ; + */ + public SetPermissionMeetingRecordingResp setPermission(SetPermissionMeetingRecordingReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/vc/v1/meetings/:meeting_id/recording/set_permission" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + SetPermissionMeetingRecordingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SetPermissionMeetingRecordingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/recording/set_permission" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 授权录制文件,将一个会议的录制文件授权给组织、用户或公开到公网 + *

会议结束后并且收到了"录制完成"的事件方可进行授权;会议owner(通过开放平台预约的会议即为预约人)才有权限操作 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting-recording/set_permission ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetPermissionMeetingRecordingSample.java ; + */ + public SetPermissionMeetingRecordingResp setPermission(SetPermissionMeetingRecordingReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/vc/v1/meetings/:meeting_id/recording/set_permission" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + SetPermissionMeetingRecordingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SetPermissionMeetingRecordingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/recording/set_permission" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 开始录制,在会议中开始录制。 + *

会议正在进行中,且操作者具有相应权限(如果操作者为用户,必须是会中当前主持人) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting-recording/start ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/StartMeetingRecordingSample.java ; + */ + public StartMeetingRecordingResp start(StartMeetingRecordingReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/vc/v1/meetings/:meeting_id/recording/start" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + StartMeetingRecordingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, StartMeetingRecordingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/recording/start" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 开始录制,在会议中开始录制。 + *

会议正在进行中,且操作者具有相应权限(如果操作者为用户,必须是会中当前主持人) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting-recording/start ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/StartMeetingRecordingSample.java ; + */ + public StartMeetingRecordingResp start(StartMeetingRecordingReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/vc/v1/meetings/:meeting_id/recording/start" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + StartMeetingRecordingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, StartMeetingRecordingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/recording/start" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 停止录制,在会议中停止录制。 + *

会议正在录制中,且操作者具有相应权限(如果操作者为用户,必须是会中当前主持人) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting-recording/stop ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/StopMeetingRecordingSample.java ; + */ + public StopMeetingRecordingResp stop(StopMeetingRecordingReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/vc/v1/meetings/:meeting_id/recording/stop" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + StopMeetingRecordingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, StopMeetingRecordingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/recording/stop" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 停止录制,在会议中停止录制。 + *

会议正在录制中,且操作者具有相应权限(如果操作者为用户,必须是会中当前主持人) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting-recording/stop ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/StopMeetingRecordingSample.java ; + */ + public StopMeetingRecordingResp stop(StopMeetingRecordingReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/vc/v1/meetings/:meeting_id/recording/stop" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + StopMeetingRecordingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, StopMeetingRecordingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/meetings/:meeting_id/recording/stop" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ParticipantList.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ParticipantList.java new file mode 100644 index 000000000..9908d00fc --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ParticipantList.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.vc.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.vc.v1.model.GetParticipantListReq; +import com.lark.oapi.service.vc.v1.model.GetParticipantListResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ParticipantList { + private static final Logger log = LoggerFactory.getLogger(ParticipantList.class); + private final Config config; + + public ParticipantList(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=participant_list&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetParticipantListSample.java ; + */ + public GetParticipantListResp get(GetParticipantListReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/participant_list" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetParticipantListResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetParticipantListResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/participant_list" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=participant_list&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetParticipantListSample.java ; + */ + public GetParticipantListResp get(GetParticipantListReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/participant_list" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetParticipantListResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetParticipantListResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/participant_list" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ParticipantQualityList.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ParticipantQualityList.java new file mode 100644 index 000000000..45f2e201e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ParticipantQualityList.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.vc.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.vc.v1.model.GetParticipantQualityListReq; +import com.lark.oapi.service.vc.v1.model.GetParticipantQualityListResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ParticipantQualityList { + private static final Logger log = LoggerFactory.getLogger(ParticipantQualityList.class); + private final Config config; + + public ParticipantQualityList(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=participant_quality_list&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetParticipantQualityListSample.java ; + */ + public GetParticipantQualityListResp get(GetParticipantQualityListReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/participant_quality_list" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetParticipantQualityListResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetParticipantQualityListResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/participant_quality_list" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=participant_quality_list&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetParticipantQualityListSample.java ; + */ + public GetParticipantQualityListResp get(GetParticipantQualityListReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/participant_quality_list" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetParticipantQualityListResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetParticipantQualityListResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/participant_quality_list" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/Report.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/Report.java new file mode 100644 index 000000000..d3dce80fa --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/Report.java @@ -0,0 +1,177 @@ +// Code generated by lark suite 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 com.lark.oapi.service.vc.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.vc.v1.model.GetDailyReportReq; +import com.lark.oapi.service.vc.v1.model.GetDailyReportResp; +import com.lark.oapi.service.vc.v1.model.GetTopUserReportReq; +import com.lark.oapi.service.vc.v1.model.GetTopUserReportResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Report { + private static final Logger log = LoggerFactory.getLogger(Report.class); + private final Config config; + + public Report(Config config) { + this.config = config; + } + + + /** + * 获取会议报告,获取一段时间内组织的每日会议使用报告。 + *

支持最近90天内的数据查询 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/report/get_daily ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetDailyReportSample.java ; + */ + public GetDailyReportResp getDaily(GetDailyReportReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/reports/get_daily" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetDailyReportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDailyReportResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reports/get_daily" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取会议报告,获取一段时间内组织的每日会议使用报告。 + *

支持最近90天内的数据查询 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/report/get_daily ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetDailyReportSample.java ; + */ + public GetDailyReportResp getDaily(GetDailyReportReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/reports/get_daily" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetDailyReportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetDailyReportResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reports/get_daily" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取top用户列表,获取一段时间内组织内会议使用的top用户列表。 + *

支持最近90天内的数据查询;默认返回前10位,最多可查询前100位 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/report/get_top_user ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetTopUserReportSample.java ; + */ + public GetTopUserReportResp getTopUser(GetTopUserReportReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/reports/get_top_user" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetTopUserReportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTopUserReportResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reports/get_top_user" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取top用户列表,获取一段时间内组织内会议使用的top用户列表。 + *

支持最近90天内的数据查询;默认返回前10位,最多可查询前100位 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/report/get_top_user ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetTopUserReportSample.java ; + */ + public GetTopUserReportResp getTopUser(GetTopUserReportReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/reports/get_top_user" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + GetTopUserReportResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTopUserReportResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reports/get_top_user" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/Reserve.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/Reserve.java new file mode 100644 index 000000000..43d66fef0 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/Reserve.java @@ -0,0 +1,378 @@ +// Code generated by lark suite 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 com.lark.oapi.service.vc.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.vc.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Reserve { + private static final Logger log = LoggerFactory.getLogger(Reserve.class); + private final Config config; + + public Reserve(Config config) { + this.config = config; + } + + + /** + * 预约会议,创建一个会议预约。 + *

支持预约最近30天内的会议(到期时间距离当前时间不超过30天),预约到期后会议号将被释放,如需继续使用可通过"更新预约"接口进行续期;预约会议时可配置参会人在会中的权限,以达到控制会议的目的 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/apply ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ApplyReserveSample.java ; + */ + public ApplyReserveResp apply(ApplyReserveReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/reserves/apply" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ApplyReserveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ApplyReserveResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserves/apply" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 预约会议,创建一个会议预约。 + *

支持预约最近30天内的会议(到期时间距离当前时间不超过30天),预约到期后会议号将被释放,如需继续使用可通过"更新预约"接口进行续期;预约会议时可配置参会人在会中的权限,以达到控制会议的目的 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/apply ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ApplyReserveSample.java ; + */ + public ApplyReserveResp apply(ApplyReserveReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/reserves/apply" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ApplyReserveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ApplyReserveResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserves/apply" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除预约,删除一个预约 + *

只能删除归属于自己的预约;删除后数据不可恢复 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DeleteReserveSample.java ; + */ + public DeleteReserveResp delete(DeleteReserveReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/vc/v1/reserves/:reserve_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteReserveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteReserveResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserves/:reserve_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除预约,删除一个预约 + *

只能删除归属于自己的预约;删除后数据不可恢复 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DeleteReserveSample.java ; + */ + public DeleteReserveResp delete(DeleteReserveReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/vc/v1/reserves/:reserve_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + DeleteReserveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteReserveResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserves/:reserve_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取预约,获取一个预约的详情 + *

只能获取归属于自己的预约 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveSample.java ; + */ + public GetReserveResp get(GetReserveReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/reserves/:reserve_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetReserveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetReserveResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserves/:reserve_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取预约,获取一个预约的详情 + *

只能获取归属于自己的预约 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveSample.java ; + */ + public GetReserveResp get(GetReserveReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/reserves/:reserve_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetReserveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetReserveResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserves/:reserve_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取活跃会议,获取一个预约的当前活跃会议 + *

只能获取归属于自己的预约的活跃会议(一个预约最多有一个正在进行中的会议) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/get_active_meeting ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetActiveMeetingReserveSample.java ; + */ + public GetActiveMeetingReserveResp getActiveMeeting(GetActiveMeetingReserveReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/reserves/:reserve_id/get_active_meeting" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetActiveMeetingReserveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetActiveMeetingReserveResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserves/:reserve_id/get_active_meeting" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取活跃会议,获取一个预约的当前活跃会议 + *

只能获取归属于自己的预约的活跃会议(一个预约最多有一个正在进行中的会议) ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/get_active_meeting ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetActiveMeetingReserveSample.java ; + */ + public GetActiveMeetingReserveResp getActiveMeeting(GetActiveMeetingReserveReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/reserves/:reserve_id/get_active_meeting" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetActiveMeetingReserveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetActiveMeetingReserveResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserves/:reserve_id/get_active_meeting" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新预约,更新一个预约 + *

只能更新归属于自己的预约,不需要更新的字段不传(如果传空则会被更新为空);可用于续期操作,到期时间距离当前时间不超过30天 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/UpdateReserveSample.java ; + */ + public UpdateReserveResp update(UpdateReserveReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/vc/v1/reserves/:reserve_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateReserveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateReserveResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserves/:reserve_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新预约,更新一个预约 + *

只能更新归属于自己的预约,不需要更新的字段不传(如果传空则会被更新为空);可用于续期操作,到期时间距离当前时间不超过30天 ; + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/UpdateReserveSample.java ; + */ + public UpdateReserveResp update(UpdateReserveReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/vc/v1/reserves/:reserve_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateReserveResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateReserveResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserves/:reserve_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ReserveConfig.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ReserveConfig.java new file mode 100644 index 000000000..457a28388 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ReserveConfig.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.vc.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.vc.v1.model.PatchReserveConfigReq; +import com.lark.oapi.service.vc.v1.model.PatchReserveConfigResp; +import com.lark.oapi.service.vc.v1.model.ReserveScopeReserveConfigReq; +import com.lark.oapi.service.vc.v1.model.ReserveScopeReserveConfigResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ReserveConfig { + private static final Logger log = LoggerFactory.getLogger(ReserveConfig.class); + private final Config config; + + public ReserveConfig(Config config) { + this.config = config; + } + + + /** + * 更新会议室预定范围,更新会议室预定范围 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve_config/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigSample.java ; + */ + public PatchReserveConfigResp patch(PatchReserveConfigReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/vc/v1/reserve_configs/:reserve_config_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchReserveConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchReserveConfigResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新会议室预定范围,更新会议室预定范围 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve_config/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigSample.java ; + */ + public PatchReserveConfigResp patch(PatchReserveConfigReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/vc/v1/reserve_configs/:reserve_config_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchReserveConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchReserveConfigResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取会议室预定范围,获取会议室预定范围 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve_config/reserve_scope ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ReserveScopeReserveConfigSample.java ; + */ + public ReserveScopeReserveConfigResp reserveScope(ReserveScopeReserveConfigReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/reserve_configs/reserve_scope" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ReserveScopeReserveConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ReserveScopeReserveConfigResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/reserve_scope" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取会议室预定范围,获取会议室预定范围 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve_config/reserve_scope ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ReserveScopeReserveConfigSample.java ; + */ + public ReserveScopeReserveConfigResp reserveScope(ReserveScopeReserveConfigReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/reserve_configs/reserve_scope" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ReserveScopeReserveConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ReserveScopeReserveConfigResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/reserve_scope" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ReserveConfigAdmin.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ReserveConfigAdmin.java new file mode 100644 index 000000000..286a5eb41 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ReserveConfigAdmin.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.vc.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.vc.v1.model.GetReserveConfigAdminReq; +import com.lark.oapi.service.vc.v1.model.GetReserveConfigAdminResp; +import com.lark.oapi.service.vc.v1.model.PatchReserveConfigAdminReq; +import com.lark.oapi.service.vc.v1.model.PatchReserveConfigAdminResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ReserveConfigAdmin { + private static final Logger log = LoggerFactory.getLogger(ReserveConfigAdmin.class); + private final Config config; + + public ReserveConfigAdmin(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=reserve_config.admin&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveConfigAdminSample.java ; + */ + public GetReserveConfigAdminResp get(GetReserveConfigAdminReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetReserveConfigAdminResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetReserveConfigAdminResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=reserve_config.admin&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveConfigAdminSample.java ; + */ + public GetReserveConfigAdminResp get(GetReserveConfigAdminReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetReserveConfigAdminResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetReserveConfigAdminResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=vc&resource=reserve_config.admin&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigAdminSample.java ; + */ + public PatchReserveConfigAdminResp patch(PatchReserveConfigAdminReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchReserveConfigAdminResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchReserveConfigAdminResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=vc&resource=reserve_config.admin&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigAdminSample.java ; + */ + public PatchReserveConfigAdminResp patch(PatchReserveConfigAdminReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchReserveConfigAdminResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchReserveConfigAdminResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ReserveConfigDisableInform.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ReserveConfigDisableInform.java new file mode 100644 index 000000000..e195a7c1e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ReserveConfigDisableInform.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.vc.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.vc.v1.model.GetReserveConfigDisableInformReq; +import com.lark.oapi.service.vc.v1.model.GetReserveConfigDisableInformResp; +import com.lark.oapi.service.vc.v1.model.PatchReserveConfigDisableInformReq; +import com.lark.oapi.service.vc.v1.model.PatchReserveConfigDisableInformResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ReserveConfigDisableInform { + private static final Logger log = LoggerFactory.getLogger(ReserveConfigDisableInform.class); + private final Config config; + + public ReserveConfigDisableInform(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=reserve_config.disable_inform&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveConfigDisableInformSample.java ; + */ + public GetReserveConfigDisableInformResp get(GetReserveConfigDisableInformReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetReserveConfigDisableInformResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetReserveConfigDisableInformResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=reserve_config.disable_inform&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveConfigDisableInformSample.java ; + */ + public GetReserveConfigDisableInformResp get(GetReserveConfigDisableInformReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetReserveConfigDisableInformResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetReserveConfigDisableInformResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=vc&resource=reserve_config.disable_inform&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigDisableInformSample.java ; + */ + public PatchReserveConfigDisableInformResp patch(PatchReserveConfigDisableInformReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchReserveConfigDisableInformResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchReserveConfigDisableInformResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=vc&resource=reserve_config.disable_inform&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigDisableInformSample.java ; + */ + public PatchReserveConfigDisableInformResp patch(PatchReserveConfigDisableInformReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchReserveConfigDisableInformResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchReserveConfigDisableInformResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ReserveConfigForm.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ReserveConfigForm.java new file mode 100644 index 000000000..ce5e6452b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ReserveConfigForm.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.vc.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.vc.v1.model.GetReserveConfigFormReq; +import com.lark.oapi.service.vc.v1.model.GetReserveConfigFormResp; +import com.lark.oapi.service.vc.v1.model.PatchReserveConfigFormReq; +import com.lark.oapi.service.vc.v1.model.PatchReserveConfigFormResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ReserveConfigForm { + private static final Logger log = LoggerFactory.getLogger(ReserveConfigForm.class); + private final Config config; + + public ReserveConfigForm(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=reserve_config.form&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveConfigFormSample.java ; + */ + public GetReserveConfigFormResp get(GetReserveConfigFormReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/reserve_configs/:reserve_config_id/form" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetReserveConfigFormResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetReserveConfigFormResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id/form" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=reserve_config.form&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveConfigFormSample.java ; + */ + public GetReserveConfigFormResp get(GetReserveConfigFormReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/reserve_configs/:reserve_config_id/form" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetReserveConfigFormResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetReserveConfigFormResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id/form" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=vc&resource=reserve_config.form&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigFormSample.java ; + */ + public PatchReserveConfigFormResp patch(PatchReserveConfigFormReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/vc/v1/reserve_configs/:reserve_config_id/form" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchReserveConfigFormResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchReserveConfigFormResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id/form" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=vc&resource=reserve_config.form&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigFormSample.java ; + */ + public PatchReserveConfigFormResp patch(PatchReserveConfigFormReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/vc/v1/reserve_configs/:reserve_config_id/form" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchReserveConfigFormResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchReserveConfigFormResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/reserve_configs/:reserve_config_id/form" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ResourceReservationList.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ResourceReservationList.java new file mode 100644 index 000000000..a9fd164ba --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ResourceReservationList.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.vc.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.vc.v1.model.GetResourceReservationListReq; +import com.lark.oapi.service.vc.v1.model.GetResourceReservationListResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ResourceReservationList { + private static final Logger log = LoggerFactory.getLogger(ResourceReservationList.class); + private final Config config; + + public ResourceReservationList(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=resource_reservation_list&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetResourceReservationListSample.java ; + */ + public GetResourceReservationListResp get(GetResourceReservationListReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/resource_reservation_list" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetResourceReservationListResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetResourceReservationListResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/resource_reservation_list" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=resource_reservation_list&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetResourceReservationListSample.java ; + */ + public GetResourceReservationListResp get(GetResourceReservationListReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/resource_reservation_list" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetResourceReservationListResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetResourceReservationListResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/resource_reservation_list" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/Room.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/Room.java new file mode 100644 index 000000000..b37dfe544 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/Room.java @@ -0,0 +1,500 @@ +// Code generated by lark suite 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 com.lark.oapi.service.vc.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.vc.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Room { + private static final Logger log = LoggerFactory.getLogger(Room.class); + private final Config config; + + public Room(Config config) { + this.config = config; + } + + + /** + * 创建会议室,该接口用于创建会议室 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/CreateRoomSample.java ; + */ + public CreateRoomResp create(CreateRoomReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/rooms" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateRoomResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建会议室,该接口用于创建会议室 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/CreateRoomSample.java ; + */ + public CreateRoomResp create(CreateRoomReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/rooms" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateRoomResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除会议室,该接口可以用来删除某个会议室 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DeleteRoomSample.java ; + */ + public DeleteRoomResp delete(DeleteRoomReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/vc/v1/rooms/:room_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteRoomResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms/:room_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除会议室,该接口可以用来删除某个会议室 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DeleteRoomSample.java ; + */ + public DeleteRoomResp delete(DeleteRoomReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/vc/v1/rooms/:room_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteRoomResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms/:room_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询会议室详情,该接口可以使用会议室ID查询会议室详情 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetRoomSample.java ; + */ + public GetRoomResp get(GetRoomReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/rooms/:room_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetRoomResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms/:room_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询会议室详情,该接口可以使用会议室ID查询会议室详情 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetRoomSample.java ; + */ + public GetRoomResp get(GetRoomReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/rooms/:room_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetRoomResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms/:room_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询会议室列表,该接口可以用来查询某个会议室层级下会议室列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListRoomSample.java ; + */ + public ListRoomResp list(ListRoomReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/rooms" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListRoomResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询会议室列表,该接口可以用来查询某个会议室层级下会议室列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListRoomSample.java ; + */ + public ListRoomResp list(ListRoomReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/rooms" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListRoomResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询会议室详情,该接口可以使用会议室ID批量查询会议室详情 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/mget ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/MgetRoomSample.java ; + */ + public MgetRoomResp mget(MgetRoomReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/rooms/mget" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + MgetRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MgetRoomResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms/mget" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询会议室详情,该接口可以使用会议室ID批量查询会议室详情 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/mget ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/MgetRoomSample.java ; + */ + public MgetRoomResp mget(MgetRoomReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/rooms/mget" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + MgetRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MgetRoomResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms/mget" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新会议室,该接口可以用来更新某个会议室的信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchRoomSample.java ; + */ + public PatchRoomResp patch(PatchRoomReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/vc/v1/rooms/:room_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchRoomResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms/:room_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新会议室,该接口可以用来更新某个会议室的信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchRoomSample.java ; + */ + public PatchRoomResp patch(PatchRoomReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/vc/v1/rooms/:room_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchRoomResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms/:room_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 搜索会议室,该接口可以用来搜索会议室,支持使用关键词进行搜索,也支持使用自定义会议室ID进行查询 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/search ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SearchRoomSample.java ; + */ + public SearchRoomResp search(SearchRoomReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/rooms/search" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + SearchRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchRoomResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 搜索会议室,该接口可以用来搜索会议室,支持使用关键词进行搜索,也支持使用自定义会议室ID进行查询 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/search ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SearchRoomSample.java ; + */ + public SearchRoomResp search(SearchRoomReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/rooms/search" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + SearchRoomResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchRoomResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/rooms/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/RoomConfig.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/RoomConfig.java new file mode 100644 index 000000000..8aa391f86 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/RoomConfig.java @@ -0,0 +1,302 @@ +// Code generated by lark suite 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 com.lark.oapi.service.vc.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.vc.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class RoomConfig { + private static final Logger log = LoggerFactory.getLogger(RoomConfig.class); + private final Config config; + + public RoomConfig(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=vc&resource=room_config&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/QueryRoomConfigSample.java ; + */ + public QueryRoomConfigResp query(QueryRoomConfigReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/room_configs/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryRoomConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryRoomConfigResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_configs/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=vc&resource=room_config&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/QueryRoomConfigSample.java ; + */ + public QueryRoomConfigResp query(QueryRoomConfigReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/room_configs/query" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + QueryRoomConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, QueryRoomConfigResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_configs/query" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=set&project=vc&resource=room_config&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetRoomConfigSample.java ; + */ + public SetRoomConfigResp set(SetRoomConfigReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/room_configs/set" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SetRoomConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SetRoomConfigResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_configs/set" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=set&project=vc&resource=room_config&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetRoomConfigSample.java ; + */ + public SetRoomConfigResp set(SetRoomConfigReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/room_configs/set" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SetRoomConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SetRoomConfigResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_configs/set" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=set_checkboard_access_code&project=vc&resource=room_config&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetCheckboardAccessCodeRoomConfigSample.java ; + */ + public SetCheckboardAccessCodeRoomConfigResp setCheckboardAccessCode(SetCheckboardAccessCodeRoomConfigReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/room_configs/set_checkboard_access_code" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SetCheckboardAccessCodeRoomConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SetCheckboardAccessCodeRoomConfigResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_configs/set_checkboard_access_code" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=set_checkboard_access_code&project=vc&resource=room_config&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetCheckboardAccessCodeRoomConfigSample.java ; + */ + public SetCheckboardAccessCodeRoomConfigResp setCheckboardAccessCode(SetCheckboardAccessCodeRoomConfigReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/room_configs/set_checkboard_access_code" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SetCheckboardAccessCodeRoomConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SetCheckboardAccessCodeRoomConfigResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_configs/set_checkboard_access_code" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=set_room_access_code&project=vc&resource=room_config&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetRoomAccessCodeRoomConfigSample.java ; + */ + public SetRoomAccessCodeRoomConfigResp setRoomAccessCode(SetRoomAccessCodeRoomConfigReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/room_configs/set_room_access_code" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SetRoomAccessCodeRoomConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SetRoomAccessCodeRoomConfigResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_configs/set_room_access_code" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=set_room_access_code&project=vc&resource=room_config&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetRoomAccessCodeRoomConfigSample.java ; + */ + public SetRoomAccessCodeRoomConfigResp setRoomAccessCode(SetRoomAccessCodeRoomConfigReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/room_configs/set_room_access_code" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SetRoomAccessCodeRoomConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SetRoomAccessCodeRoomConfigResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_configs/set_room_access_code" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/RoomLevel.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/RoomLevel.java new file mode 100644 index 000000000..9d46823b6 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/RoomLevel.java @@ -0,0 +1,500 @@ +// Code generated by lark suite 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 com.lark.oapi.service.vc.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.vc.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class RoomLevel { + private static final Logger log = LoggerFactory.getLogger(RoomLevel.class); + private final Config config; + + public RoomLevel(Config config) { + this.config = config; + } + + + /** + * 创建会议室层级,该接口用于创建会议室层级 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/CreateRoomLevelSample.java ; + */ + public CreateRoomLevelResp create(CreateRoomLevelReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/room_levels" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateRoomLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建会议室层级,该接口用于创建会议室层级 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/CreateRoomLevelSample.java ; + */ + public CreateRoomLevelResp create(CreateRoomLevelReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/room_levels" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateRoomLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除会议室层级,该接口可以用来删除某个会议室层级 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/del ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DelRoomLevelSample.java ; + */ + public DelRoomLevelResp del(DelRoomLevelReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/room_levels/del" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DelRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DelRoomLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels/del" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除会议室层级,该接口可以用来删除某个会议室层级 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/del ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DelRoomLevelSample.java ; + */ + public DelRoomLevelResp del(DelRoomLevelReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/room_levels/del" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DelRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DelRoomLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels/del" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询会议室层级详情,该接口可以使用会议室层级ID查询会议室层级详情 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetRoomLevelSample.java ; + */ + public GetRoomLevelResp get(GetRoomLevelReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/room_levels/:room_level_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetRoomLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels/:room_level_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询会议室层级详情,该接口可以使用会议室层级ID查询会议室层级详情 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetRoomLevelSample.java ; + */ + public GetRoomLevelResp get(GetRoomLevelReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/room_levels/:room_level_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetRoomLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels/:room_level_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询会议室层级列表,该接口用来查询某个会议室层级下的子层级列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListRoomLevelSample.java ; + */ + public ListRoomLevelResp list(ListRoomLevelReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/room_levels" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListRoomLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询会议室层级列表,该接口用来查询某个会议室层级下的子层级列表 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListRoomLevelSample.java ; + */ + public ListRoomLevelResp list(ListRoomLevelReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/room_levels" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + ListRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListRoomLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询会议室层级详情,该接口可以使用会议室层级ID批量查询会议室层级详情 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/mget ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/MgetRoomLevelSample.java ; + */ + public MgetRoomLevelResp mget(MgetRoomLevelReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/room_levels/mget" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + MgetRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MgetRoomLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels/mget" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 批量查询会议室层级详情,该接口可以使用会议室层级ID批量查询会议室层级详情 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/mget ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/MgetRoomLevelSample.java ; + */ + public MgetRoomLevelResp mget(MgetRoomLevelReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/room_levels/mget" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + MgetRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MgetRoomLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels/mget" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新会议室层级,该接口可以用来更新某个会议室层级的信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchRoomLevelSample.java ; + */ + public PatchRoomLevelResp patch(PatchRoomLevelReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/vc/v1/room_levels/:room_level_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchRoomLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels/:room_level_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新会议室层级,该接口可以用来更新某个会议室层级的信息 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/patch ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchRoomLevelSample.java ; + */ + public PatchRoomLevelResp patch(PatchRoomLevelReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" + , "/open-apis/vc/v1/room_levels/:room_level_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + PatchRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchRoomLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels/:room_level_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 搜索会议室层级,该接口可以用来搜索会议室层级,支持使用自定义会议室层级ID进行查询 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/search ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SearchRoomLevelSample.java ; + */ + public SearchRoomLevelResp search(SearchRoomLevelReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/room_levels/search" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + SearchRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchRoomLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 搜索会议室层级,该接口可以用来搜索会议室层级,支持使用自定义会议室层级ID进行查询 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/search ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SearchRoomLevelSample.java ; + */ + public SearchRoomLevelResp search(SearchRoomLevelReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/room_levels/search" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + SearchRoomLevelResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchRoomLevelResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/room_levels/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ScopeConfig.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ScopeConfig.java new file mode 100644 index 000000000..0b0c4e96d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/vc/v1/resource/ScopeConfig.java @@ -0,0 +1,173 @@ +// Code generated by lark suite 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 com.lark.oapi.service.vc.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.vc.v1.model.CreateScopeConfigReq; +import com.lark.oapi.service.vc.v1.model.CreateScopeConfigResp; +import com.lark.oapi.service.vc.v1.model.GetScopeConfigReq; +import com.lark.oapi.service.vc.v1.model.GetScopeConfigResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class ScopeConfig { + private static final Logger log = LoggerFactory.getLogger(ScopeConfig.class); + private final Config config; + + public ScopeConfig(Config config) { + this.config = config; + } + + + /** + * 设置会议室配置,该接口可以用来设置某个会议层级范围下或者某个会议室的配置 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/scope_config/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/CreateScopeConfigSample.java ; + */ + public CreateScopeConfigResp create(CreateScopeConfigReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/scope_config" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateScopeConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateScopeConfigResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/scope_config" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 设置会议室配置,该接口可以用来设置某个会议层级范围下或者某个会议室的配置 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/scope_config/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/CreateScopeConfigSample.java ; + */ + public CreateScopeConfigResp create(CreateScopeConfigReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/vc/v1/scope_config" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CreateScopeConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateScopeConfigResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/scope_config" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询会议室配置,该接口可以用来查询某个会议层级范围下或者某个会议室的配置 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/scope_config/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetScopeConfigSample.java ; + */ + public GetScopeConfigResp get(GetScopeConfigReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/scope_config" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetScopeConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetScopeConfigResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/scope_config" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 查询会议室配置,该接口可以用来查询某个会议层级范围下或者某个会议室的配置 + *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/scope_config/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetScopeConfigSample.java ; + */ + public GetScopeConfigResp get(GetScopeConfigReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/vc/v1/scope_config" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetScopeConfigResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetScopeConfigResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/vc/v1/scope_config" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/WikiService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/WikiService.java new file mode 100644 index 000000000..82ea7c05c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/WikiService.java @@ -0,0 +1,59 @@ +// Code generated by lark suite 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 com.lark.oapi.service.wiki; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.wiki.v2.V2; +import com.lark.oapi.service.wiki.v2.resource.*; + +public class WikiService { + private final V2 v2; + private final Space space; // 知识空间 + private final SpaceMember spaceMember; // 空间成员 + private final SpaceNode spaceNode; // 节点 + private final SpaceSetting spaceSetting; // 空间设置 + private final Task task; // 云文档 + + public WikiService(Config config) { + this.v2 = new V2(config); + this.space = new Space(config); + this.spaceMember = new SpaceMember(config); + this.spaceNode = new SpaceNode(config); + this.spaceSetting = new SpaceSetting(config); + this.task = new Task(config); + } + + public V2 v2() { + return v2; + } + + public Space space() { + return space; + } + + public SpaceMember spaceMember() { + return spaceMember; + } + + public SpaceNode spaceNode() { + return spaceNode; + } + + public SpaceSetting spaceSetting() { + return spaceSetting; + } + + public Task task() { + return task; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/V2.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/V2.java new file mode 100644 index 000000000..5bf53a3d4 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/V2.java @@ -0,0 +1,53 @@ +// Code generated by lark suite 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 com.lark.oapi.service.wiki.v2; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.wiki.v2.resource.*; + +public class V2 { + private final Space space; // 知识空间 + private final SpaceMember spaceMember; // 空间成员 + private final SpaceNode spaceNode; // 节点 + private final SpaceSetting spaceSetting; // 空间设置 + private final Task task; // 云文档 + + public V2(Config config) { + this.space = new Space(config); + this.spaceMember = new SpaceMember(config); + this.spaceNode = new SpaceNode(config); + this.spaceSetting = new SpaceSetting(config); + this.task = new Task(config); + } + + public Space space() { + return space; + } + + public SpaceMember spaceMember() { + return spaceMember; + } + + public SpaceNode spaceNode() { + return spaceNode; + } + + public SpaceSetting spaceSetting() { + return spaceSetting; + } + + public Task task() { + return task; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/WikiService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/WikiService.java deleted file mode 100644 index ab425bd71..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/WikiService.java +++ /dev/null @@ -1,1083 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.wiki.v2; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.wiki.v2.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class WikiService { - private static final Logger log = LoggerFactory.getLogger(WikiService.class); - private final Space space; // 知识空间 - private final SpaceMember spaceMember; // 空间成员 - private final SpaceNode spaceNode; // 节点 - private final SpaceSetting spaceSetting; // 空间设置 - private final Task task; // 云文档 - - public WikiService(Config config) { - this.space = new Space(config); - this.spaceMember = new SpaceMember(config); - this.spaceNode = new SpaceNode(config); - this.spaceSetting = new SpaceSetting(config); - this.task = new Task(config); - } - - /** - * 知识空间 - * - * @return - */ - public Space space() { - return space; - } - - /** - * 空间成员 - * - * @return - */ - public SpaceMember spaceMember() { - return spaceMember; - } - - /** - * 节点 - * - * @return - */ - public SpaceNode spaceNode() { - return spaceNode; - } - - /** - * 空间设置 - * - * @return - */ - public SpaceSetting spaceSetting() { - return spaceSetting; - } - - /** - * 云文档 - * - * @return - */ - public Task task() { - return task; - } - - public static class Space { - private final Config config; - - public Space(Config config) { - this.config = config; - } - - /** - * 创建知识空间,此接口用于创建知识空间 - *

此接口不支持tenant access token(应用身份访问) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CreateSpaceSample.java ; - */ - public CreateSpaceResp create(CreateSpaceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/wiki/v2/spaces" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - CreateSpaceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpaceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建知识空间,此接口用于创建知识空间 - *

此接口不支持tenant access token(应用身份访问) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CreateSpaceSample.java ; - */ - public CreateSpaceResp create(CreateSpaceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/wiki/v2/spaces" - , Sets.newHashSet(AccessTokenType.User) - , req); - - // 反序列化 - CreateSpaceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpaceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取知识空间信息,此接口用于根据知识空间ID来查询知识空间的信息。;;空间类型(type):;- 个人空间:归个人管理。一人仅可拥有一个个人空间,无法添加其他管理员。;- 团队空间:归团队(多人)管理,可添加多个管理员。;;空间可见性(visibility):;- 公开空间:租户所有用户可见,默认为成员权限。无法额外添加成员,但可以添加管理员。;- 私有空间:仅对知识空间管理员、成员可见,需要手动添加管理员、成员。 - *

本接口要求知识库权限:;- 需要为知识空间成员(管理员) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/GetSpaceSample.java ; - */ - public GetSpaceResp get(GetSpaceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/wiki/v2/spaces/:space_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetSpaceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpaceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取知识空间信息,此接口用于根据知识空间ID来查询知识空间的信息。;;空间类型(type):;- 个人空间:归个人管理。一人仅可拥有一个个人空间,无法添加其他管理员。;- 团队空间:归团队(多人)管理,可添加多个管理员。;;空间可见性(visibility):;- 公开空间:租户所有用户可见,默认为成员权限。无法额外添加成员,但可以添加管理员。;- 私有空间:仅对知识空间管理员、成员可见,需要手动添加管理员、成员。 - *

本接口要求知识库权限:;- 需要为知识空间成员(管理员) ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/GetSpaceSample.java ; - */ - public GetSpaceResp get(GetSpaceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/wiki/v2/spaces/:space_id" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - GetSpaceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpaceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取知识空间节点信息,获取知识空间节点信息 - *

知识库权限要求,当前使用的 access token 所代表的应用或用户拥有:;- 节点阅读权限 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/get_node ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/GetNodeSpaceSample.java ; - */ - public GetNodeSpaceResp getNode(GetNodeSpaceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/wiki/v2/spaces/get_node" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetNodeSpaceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetNodeSpaceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/get_node" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取知识空间节点信息,获取知识空间节点信息 - *

知识库权限要求,当前使用的 access token 所代表的应用或用户拥有:;- 节点阅读权限 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/get_node ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/GetNodeSpaceSample.java ; - */ - public GetNodeSpaceResp getNode(GetNodeSpaceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/wiki/v2/spaces/get_node" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetNodeSpaceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetNodeSpaceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/get_node" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取知识空间列表,此接口用于获取有权限访问的知识空间列表。;;此接口为分页接口。由于权限过滤,可能返回列表为空,但分页标记(has_more)为true,可以继续分页请求。;;对于知识空间各项属性描述请参阅[获取知识空间信息](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/get) - *

使用tenant access token调用时,请确认应用/机器人拥有部分知识空间的访问权限,否则返回列表容易为空。 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/ListSpaceSample.java ; - */ - public ListSpaceResp list(ListSpaceReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/wiki/v2/spaces" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListSpaceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListSpaceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取知识空间列表,此接口用于获取有权限访问的知识空间列表。;;此接口为分页接口。由于权限过滤,可能返回列表为空,但分页标记(has_more)为true,可以继续分页请求。;;对于知识空间各项属性描述请参阅[获取知识空间信息](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/get) - *

使用tenant access token调用时,请确认应用/机器人拥有部分知识空间的访问权限,否则返回列表容易为空。 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/ListSpaceSample.java ; - */ - public ListSpaceResp list(ListSpaceReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/wiki/v2/spaces" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListSpaceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListSpaceResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class SpaceMember { - private final Config config; - - public SpaceMember(Config config) { - this.config = config; - } - - /** - * 添加知识空间成员,添加知识空间成员或管理员。 - *

知识空间具有[类型](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)和[可见性](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)的概念。不同的类型或可见性可以对本操作做出限制:;- 可见性限制:公开知识空间(visibility为public)对租户所有用户可见,因此不支持再添加成员,但可以添加管理员。;- 类型限制:个人知识空间 (type为person)为个人管理的知识空间,不支持添加其他管理员(包括应用/机器人)。但可以添加成员。;;;知识空间权限要求,当前使用的 access token 所代表的应用或用户拥有:;- 为知识空间管理员 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-member/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CreateSpaceMemberSample.java ; - */ - public CreateSpaceMemberResp create(CreateSpaceMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/wiki/v2/spaces/:space_id/members" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateSpaceMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpaceMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 添加知识空间成员,添加知识空间成员或管理员。 - *

知识空间具有[类型](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)和[可见性](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)的概念。不同的类型或可见性可以对本操作做出限制:;- 可见性限制:公开知识空间(visibility为public)对租户所有用户可见,因此不支持再添加成员,但可以添加管理员。;- 类型限制:个人知识空间 (type为person)为个人管理的知识空间,不支持添加其他管理员(包括应用/机器人)。但可以添加成员。;;;知识空间权限要求,当前使用的 access token 所代表的应用或用户拥有:;- 为知识空间管理员 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-member/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CreateSpaceMemberSample.java ; - */ - public CreateSpaceMemberResp create(CreateSpaceMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/wiki/v2/spaces/:space_id/members" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateSpaceMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpaceMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/members" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除知识空间成员,此接口用于删除知识空间成员或管理员。 - *

知识空间具有[类型](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)和[可见性](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)的概念。不同的类型或可见性可以对本操作做出限制:;- 可见性限制:公开知识空间(visibility为public)对租户所有用户可见,因此不支持再删除成员,但可以删除管理员。;- 类型限制:个人知识空间 (type为person)为个人管理的知识空间,不支持删除管理员。但可以删除成员。;;;知识空间权限要求,当前使用的 access token 所代表的应用或用户拥有:;- 为知识空间管理员 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-member/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/DeleteSpaceMemberSample.java ; - */ - public DeleteSpaceMemberResp delete(DeleteSpaceMemberReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/wiki/v2/spaces/:space_id/members/:member_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteSpaceMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSpaceMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/members/:member_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 删除知识空间成员,此接口用于删除知识空间成员或管理员。 - *

知识空间具有[类型](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)和[可见性](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)的概念。不同的类型或可见性可以对本操作做出限制:;- 可见性限制:公开知识空间(visibility为public)对租户所有用户可见,因此不支持再删除成员,但可以删除管理员。;- 类型限制:个人知识空间 (type为person)为个人管理的知识空间,不支持删除管理员。但可以删除成员。;;;知识空间权限要求,当前使用的 access token 所代表的应用或用户拥有:;- 为知识空间管理员 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-member/delete ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/DeleteSpaceMemberSample.java ; - */ - public DeleteSpaceMemberResp delete(DeleteSpaceMemberReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" - , "/open-apis/wiki/v2/spaces/:space_id/members/:member_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - DeleteSpaceMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSpaceMemberResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/members/:member_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class SpaceNode { - private final Config config; - - public SpaceNode(Config config) { - this.config = config; - } - - /** - * 创建知识空间节点副本,此接口用于在知识空间创建节点副本到指定位置。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/copy ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CopySpaceNodeSample.java ; - */ - public CopySpaceNodeResp copy(CopySpaceNodeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/copy" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CopySpaceNodeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CopySpaceNodeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/copy" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建知识空间节点副本,此接口用于在知识空间创建节点副本到指定位置。 - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/copy ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CopySpaceNodeSample.java ; - */ - public CopySpaceNodeResp copy(CopySpaceNodeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/copy" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - CopySpaceNodeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CopySpaceNodeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/copy" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建知识空间节点,此接口用于在知识节点里创建[节点](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)到指定位置。 - *

知识空间权限要求,当前使用的 access token 所代表的应用或用户拥有:;- **父节点**容器编辑权限 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CreateSpaceNodeSample.java ; - */ - public CreateSpaceNodeResp create(CreateSpaceNodeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/wiki/v2/spaces/:space_id/nodes" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateSpaceNodeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpaceNodeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/nodes" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 创建知识空间节点,此接口用于在知识节点里创建[节点](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)到指定位置。 - *

知识空间权限要求,当前使用的 access token 所代表的应用或用户拥有:;- **父节点**容器编辑权限 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/create ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CreateSpaceNodeSample.java ; - */ - public CreateSpaceNodeResp create(CreateSpaceNodeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/wiki/v2/spaces/:space_id/nodes" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - CreateSpaceNodeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpaceNodeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/nodes" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取知识空间子节点列表,此接口用于分页获取Wiki节点的子节点列表。;;此接口为分页接口。由于权限过滤,可能返回列表为空,但分页标记(has_more)为true,可以继续分页请求。 - *

知识库权限要求,当前使用的 access token 所代表的应用或用户拥有:;- 父节点阅读权限 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/ListSpaceNodeSample.java ; - */ - public ListSpaceNodeResp list(ListSpaceNodeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/wiki/v2/spaces/:space_id/nodes" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListSpaceNodeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListSpaceNodeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/nodes" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取知识空间子节点列表,此接口用于分页获取Wiki节点的子节点列表。;;此接口为分页接口。由于权限过滤,可能返回列表为空,但分页标记(has_more)为true,可以继续分页请求。 - *

知识库权限要求,当前使用的 access token 所代表的应用或用户拥有:;- 父节点阅读权限 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/list ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/ListSpaceNodeSample.java ; - */ - public ListSpaceNodeResp list(ListSpaceNodeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/wiki/v2/spaces/:space_id/nodes" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - ListSpaceNodeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListSpaceNodeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/nodes" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 移动知识空间节点,此方法用于在Wiki内移动节点,支持跨知识空间移动。如果有子节点,会携带子节点一起移动。 - *

知识库权限要求:;- 节点编辑权限;- 原父节点容器编辑权限;- 目的父节点容器编辑权限 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/move ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/MoveSpaceNodeSample.java ; - */ - public MoveSpaceNodeResp move(MoveSpaceNodeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/move" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - MoveSpaceNodeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MoveSpaceNodeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/move" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 移动知识空间节点,此方法用于在Wiki内移动节点,支持跨知识空间移动。如果有子节点,会携带子节点一起移动。 - *

知识库权限要求:;- 节点编辑权限;- 原父节点容器编辑权限;- 目的父节点容器编辑权限 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/move ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/MoveSpaceNodeSample.java ; - */ - public MoveSpaceNodeResp move(MoveSpaceNodeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/move" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - MoveSpaceNodeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MoveSpaceNodeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/move" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 移动云空间文档至知识空间,该接口允许移动云空间文档至知识空间,并挂载在指定位置 - *

### 移动操作 ###;移动后,文档将从“我的空间”或“共享空间”转移至“知识库”后,无法从下列入口查看到文档:;- 云空间主页:快速访问;- 我的空间;- 共享空间;;### 权限变更 ###;移动后,文档会向所有可查看“页面树”的用户显示,默认继承父页面的权限设置。; 此接口为异步接口。若移动已完成(或文档已在Wiki中),则直接返回结果(Wiki token)。若尚未完成,则返回task id。请使用[获取任务结果](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/task/get)接口进行查询。;;知识库权限要求,当前使用的 access token 所代表的应用或用户拥有:;- 文档可管理权限;- 原文件夹编辑权限;- 目标父节点容器编辑权限 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/move_docs_to_wiki ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/MoveDocsToWikiSpaceNodeSample.java ; - */ - public MoveDocsToWikiSpaceNodeResp moveDocsToWiki(MoveDocsToWikiSpaceNodeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/wiki/v2/spaces/:space_id/nodes/move_docs_to_wiki" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - MoveDocsToWikiSpaceNodeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MoveDocsToWikiSpaceNodeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/nodes/move_docs_to_wiki" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 移动云空间文档至知识空间,该接口允许移动云空间文档至知识空间,并挂载在指定位置 - *

### 移动操作 ###;移动后,文档将从“我的空间”或“共享空间”转移至“知识库”后,无法从下列入口查看到文档:;- 云空间主页:快速访问;- 我的空间;- 共享空间;;### 权限变更 ###;移动后,文档会向所有可查看“页面树”的用户显示,默认继承父页面的权限设置。; 此接口为异步接口。若移动已完成(或文档已在Wiki中),则直接返回结果(Wiki token)。若尚未完成,则返回task id。请使用[获取任务结果](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/task/get)接口进行查询。;;知识库权限要求,当前使用的 access token 所代表的应用或用户拥有:;- 文档可管理权限;- 原文件夹编辑权限;- 目标父节点容器编辑权限 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/move_docs_to_wiki ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/MoveDocsToWikiSpaceNodeSample.java ; - */ - public MoveDocsToWikiSpaceNodeResp moveDocsToWiki(MoveDocsToWikiSpaceNodeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/wiki/v2/spaces/:space_id/nodes/move_docs_to_wiki" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - MoveDocsToWikiSpaceNodeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MoveDocsToWikiSpaceNodeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/nodes/move_docs_to_wiki" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新知识空间节点标题,此接口用于更新节点标题 - *

此接口目前仅支持文档(doc)、新版文档(docx)和快捷方式。 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/update_title ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/UpdateTitleSpaceNodeSample.java ; - */ - public UpdateTitleSpaceNodeResp updateTitle(UpdateTitleSpaceNodeReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/update_title" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UpdateTitleSpaceNodeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateTitleSpaceNodeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/update_title" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新知识空间节点标题,此接口用于更新节点标题 - *

此接口目前仅支持文档(doc)、新版文档(docx)和快捷方式。 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/update_title ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/UpdateTitleSpaceNodeSample.java ; - */ - public UpdateTitleSpaceNodeResp updateTitle(UpdateTitleSpaceNodeReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/update_title" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - UpdateTitleSpaceNodeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateTitleSpaceNodeResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/update_title" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class SpaceSetting { - private final Config config; - - public SpaceSetting(Config config) { - this.config = config; - } - - /** - * 更新知识空间设置,根据space_id更新知识空间公共设置 - *

知识库权限要求:;- 为知识空间管理员 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-setting/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/UpdateSpaceSettingSample.java ; - */ - public UpdateSpaceSettingResp update(UpdateSpaceSettingReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/wiki/v2/spaces/:space_id/setting" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateSpaceSettingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateSpaceSettingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/setting" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 更新知识空间设置,根据space_id更新知识空间公共设置 - *

知识库权限要求:;- 为知识空间管理员 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-setting/update ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/UpdateSpaceSettingSample.java ; - */ - public UpdateSpaceSettingResp update(UpdateSpaceSettingReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" - , "/open-apis/wiki/v2/spaces/:space_id/setting" - , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) - , req); - - // 反序列化 - UpdateSpaceSettingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateSpaceSettingResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/setting" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class Task { - private final Config config; - - public Task(Config config) { - this.config = config; - } - - /** - * 获取任务结果,该方法用于获取wiki异步任务的结果 - *

知识库权限要求,当前 access token 所代表的用户或应用(机器人):;- 为任务创建者 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/task/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/GetTaskSample.java ; - */ - public GetTaskResp get(GetTaskReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/wiki/v2/tasks/:task_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/tasks/:task_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * 获取任务结果,该方法用于获取wiki异步任务的结果 - *

知识库权限要求,当前 access token 所代表的用户或应用(机器人):;- 为任务创建者 ; - *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/task/get ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/GetTaskSample.java ; - */ - public GetTaskResp get(GetTaskReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "GET" - , "/open-apis/wiki/v2/tasks/:task_id" - , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) - , req); - - // 反序列化 - GetTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTaskResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/tasks/:task_id" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/enums/CreateSpaceNodeObjTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/enums/CreateSpaceNodeObjTypeEnum.java index e862232b8..7d6d72ca5 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/enums/CreateSpaceNodeObjTypeEnum.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/enums/CreateSpaceNodeObjTypeEnum.java @@ -23,6 +23,7 @@ public enum CreateSpaceNodeObjTypeEnum { OBJTYPEBITABLE("bitable"), // 多维表格 OBJTYPEFILE("file"), // 文件 OBJTYPEDOCX("docx"), // 新版文档 + OBJTYPESLIDES("slides"), // 幻灯片 ; private String value; diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/enums/MoveDocsToWikiSpaceNodeMoveDocsToWikiObjTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/enums/MoveDocsToWikiSpaceNodeMoveDocsToWikiObjTypeEnum.java index b20f0d81f..020a4f038 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/enums/MoveDocsToWikiSpaceNodeMoveDocsToWikiObjTypeEnum.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/enums/MoveDocsToWikiSpaceNodeMoveDocsToWikiObjTypeEnum.java @@ -23,6 +23,7 @@ public enum MoveDocsToWikiSpaceNodeMoveDocsToWikiObjTypeEnum { OBJTYPEMINDNOTE("mindnote"), // mindnote(思维导图) OBJTYPEDOCX("docx"), // docx OBJTYPEFILE("file"), // file (文件) + OBJTYPESLIDES("slides"), // slides(幻灯片) ; private String value; diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/enums/NodeObjTypeEnum.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/enums/NodeObjTypeEnum.java index 38bd512ee..b4e39dd8a 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/enums/NodeObjTypeEnum.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/enums/NodeObjTypeEnum.java @@ -23,6 +23,7 @@ public enum NodeObjTypeEnum { OBJTYPEBITABLE("bitable"), // 多维表格 OBJTYPEFILE("file"), // 文件 OBJTYPEDOCX("docx"), // 新版文档 + OBJTYPESLIDES("slides"), // 幻灯片 ; private String value; diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/model/MoveDocsToWikiSpaceNodeRespBody.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/model/MoveDocsToWikiSpaceNodeRespBody.java index 519fb4f22..284240477 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/model/MoveDocsToWikiSpaceNodeRespBody.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/model/MoveDocsToWikiSpaceNodeRespBody.java @@ -18,7 +18,7 @@ public class MoveDocsToWikiSpaceNodeRespBody { /** * 移动后的知识库token - *

示例值: + *

示例值:wikcnKQ1k3p******8Vabcef */ @SerializedName("wiki_token") private String wikiToken; @@ -30,7 +30,7 @@ public class MoveDocsToWikiSpaceNodeRespBody { private String taskId; /** * 是否提交了文档迁入申请 - *

示例值: + *

示例值:true */ @SerializedName("applied") private Boolean applied; diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/resource/Space.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/resource/Space.java new file mode 100644 index 000000000..3c1f9e88e --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/resource/Space.java @@ -0,0 +1,310 @@ +// Code generated by lark suite 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 com.lark.oapi.service.wiki.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.wiki.v2.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Space { + private static final Logger log = LoggerFactory.getLogger(Space.class); + private final Config config; + + public Space(Config config) { + this.config = config; + } + + + /** + * 创建知识空间,此接口用于创建知识空间 + *

此接口不支持tenant access token(应用身份访问) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CreateSpaceSample.java ; + */ + public CreateSpaceResp create(CreateSpaceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/wiki/v2/spaces" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + CreateSpaceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpaceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建知识空间,此接口用于创建知识空间 + *

此接口不支持tenant access token(应用身份访问) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CreateSpaceSample.java ; + */ + public CreateSpaceResp create(CreateSpaceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/wiki/v2/spaces" + , Sets.newHashSet(AccessTokenType.User) + , req); + + // 反序列化 + CreateSpaceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpaceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取知识空间信息,此接口用于根据知识空间ID来查询知识空间的信息。;;空间类型(type):;- 个人空间:归个人管理。一人仅可拥有一个个人空间,无法添加其他管理员。;- 团队空间:归团队(多人)管理,可添加多个管理员。;;空间可见性(visibility):;- 公开空间:租户所有用户可见,默认为成员权限。无法额外添加成员,但可以添加管理员。;- 私有空间:仅对知识空间管理员、成员可见,需要手动添加管理员、成员。 + *

本接口要求知识库权限:;- 需要为知识空间成员(管理员) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/GetSpaceSample.java ; + */ + public GetSpaceResp get(GetSpaceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/wiki/v2/spaces/:space_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetSpaceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpaceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取知识空间信息,此接口用于根据知识空间ID来查询知识空间的信息。;;空间类型(type):;- 个人空间:归个人管理。一人仅可拥有一个个人空间,无法添加其他管理员。;- 团队空间:归团队(多人)管理,可添加多个管理员。;;空间可见性(visibility):;- 公开空间:租户所有用户可见,默认为成员权限。无法额外添加成员,但可以添加管理员。;- 私有空间:仅对知识空间管理员、成员可见,需要手动添加管理员、成员。 + *

本接口要求知识库权限:;- 需要为知识空间成员(管理员) ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/GetSpaceSample.java ; + */ + public GetSpaceResp get(GetSpaceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/wiki/v2/spaces/:space_id" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + GetSpaceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetSpaceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取知识空间节点信息,获取知识空间节点信息 + *

知识库权限要求,当前使用的 access token 所代表的应用或用户拥有:;- 节点阅读权限 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/get_node ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/GetNodeSpaceSample.java ; + */ + public GetNodeSpaceResp getNode(GetNodeSpaceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/wiki/v2/spaces/get_node" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetNodeSpaceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetNodeSpaceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/get_node" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取知识空间节点信息,获取知识空间节点信息 + *

知识库权限要求,当前使用的 access token 所代表的应用或用户拥有:;- 节点阅读权限 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/get_node ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/GetNodeSpaceSample.java ; + */ + public GetNodeSpaceResp getNode(GetNodeSpaceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/wiki/v2/spaces/get_node" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetNodeSpaceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetNodeSpaceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/get_node" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取知识空间列表,此接口用于获取有权限访问的知识空间列表。;;此接口为分页接口。由于权限过滤,可能返回列表为空,但分页标记(has_more)为true,可以继续分页请求。;;对于知识空间各项属性描述请参阅[获取知识空间信息](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/get) + *

使用tenant access token调用时,请确认应用/机器人拥有部分知识空间的访问权限,否则返回列表容易为空。 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/ListSpaceSample.java ; + */ + public ListSpaceResp list(ListSpaceReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/wiki/v2/spaces" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListSpaceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListSpaceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取知识空间列表,此接口用于获取有权限访问的知识空间列表。;;此接口为分页接口。由于权限过滤,可能返回列表为空,但分页标记(has_more)为true,可以继续分页请求。;;对于知识空间各项属性描述请参阅[获取知识空间信息](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/get) + *

使用tenant access token调用时,请确认应用/机器人拥有部分知识空间的访问权限,否则返回列表容易为空。 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/ListSpaceSample.java ; + */ + public ListSpaceResp list(ListSpaceReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/wiki/v2/spaces" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListSpaceResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListSpaceResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/resource/SpaceMember.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/resource/SpaceMember.java new file mode 100644 index 000000000..ed2f134be --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/resource/SpaceMember.java @@ -0,0 +1,177 @@ +// Code generated by lark suite 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 com.lark.oapi.service.wiki.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.wiki.v2.model.CreateSpaceMemberReq; +import com.lark.oapi.service.wiki.v2.model.CreateSpaceMemberResp; +import com.lark.oapi.service.wiki.v2.model.DeleteSpaceMemberReq; +import com.lark.oapi.service.wiki.v2.model.DeleteSpaceMemberResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class SpaceMember { + private static final Logger log = LoggerFactory.getLogger(SpaceMember.class); + private final Config config; + + public SpaceMember(Config config) { + this.config = config; + } + + + /** + * 添加知识空间成员,添加知识空间成员或管理员。 + *

知识空间具有[类型](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)和[可见性](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)的概念。不同的类型或可见性可以对本操作做出限制:;- 可见性限制:公开知识空间(visibility为public)对租户所有用户可见,因此不支持再添加成员,但可以添加管理员。;- 类型限制:个人知识空间 (type为person)为个人管理的知识空间,不支持添加其他管理员(包括应用/机器人)。但可以添加成员。;;;知识空间权限要求,当前使用的 access token 所代表的应用或用户拥有:;- 为知识空间管理员 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-member/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CreateSpaceMemberSample.java ; + */ + public CreateSpaceMemberResp create(CreateSpaceMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/wiki/v2/spaces/:space_id/members" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateSpaceMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpaceMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 添加知识空间成员,添加知识空间成员或管理员。 + *

知识空间具有[类型](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)和[可见性](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)的概念。不同的类型或可见性可以对本操作做出限制:;- 可见性限制:公开知识空间(visibility为public)对租户所有用户可见,因此不支持再添加成员,但可以添加管理员。;- 类型限制:个人知识空间 (type为person)为个人管理的知识空间,不支持添加其他管理员(包括应用/机器人)。但可以添加成员。;;;知识空间权限要求,当前使用的 access token 所代表的应用或用户拥有:;- 为知识空间管理员 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-member/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CreateSpaceMemberSample.java ; + */ + public CreateSpaceMemberResp create(CreateSpaceMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/wiki/v2/spaces/:space_id/members" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateSpaceMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpaceMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/members" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除知识空间成员,此接口用于删除知识空间成员或管理员。 + *

知识空间具有[类型](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)和[可见性](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)的概念。不同的类型或可见性可以对本操作做出限制:;- 可见性限制:公开知识空间(visibility为public)对租户所有用户可见,因此不支持再删除成员,但可以删除管理员。;- 类型限制:个人知识空间 (type为person)为个人管理的知识空间,不支持删除管理员。但可以删除成员。;;;知识空间权限要求,当前使用的 access token 所代表的应用或用户拥有:;- 为知识空间管理员 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-member/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/DeleteSpaceMemberSample.java ; + */ + public DeleteSpaceMemberResp delete(DeleteSpaceMemberReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/wiki/v2/spaces/:space_id/members/:member_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteSpaceMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSpaceMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/members/:member_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 删除知识空间成员,此接口用于删除知识空间成员或管理员。 + *

知识空间具有[类型](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)和[可见性](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)的概念。不同的类型或可见性可以对本操作做出限制:;- 可见性限制:公开知识空间(visibility为public)对租户所有用户可见,因此不支持再删除成员,但可以删除管理员。;- 类型限制:个人知识空间 (type为person)为个人管理的知识空间,不支持删除管理员。但可以删除成员。;;;知识空间权限要求,当前使用的 access token 所代表的应用或用户拥有:;- 为知识空间管理员 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-member/delete ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/DeleteSpaceMemberSample.java ; + */ + public DeleteSpaceMemberResp delete(DeleteSpaceMemberReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "DELETE" + , "/open-apis/wiki/v2/spaces/:space_id/members/:member_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + DeleteSpaceMemberResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DeleteSpaceMemberResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/members/:member_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/resource/SpaceNode.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/resource/SpaceNode.java new file mode 100644 index 000000000..272145f10 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/resource/SpaceNode.java @@ -0,0 +1,446 @@ +// Code generated by lark suite 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 com.lark.oapi.service.wiki.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.wiki.v2.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class SpaceNode { + private static final Logger log = LoggerFactory.getLogger(SpaceNode.class); + private final Config config; + + public SpaceNode(Config config) { + this.config = config; + } + + + /** + * 创建知识空间节点副本,此接口用于在知识空间创建节点副本到指定位置。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/copy ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CopySpaceNodeSample.java ; + */ + public CopySpaceNodeResp copy(CopySpaceNodeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/copy" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CopySpaceNodeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CopySpaceNodeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/copy" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建知识空间节点副本,此接口用于在知识空间创建节点副本到指定位置。 + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/copy ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CopySpaceNodeSample.java ; + */ + public CopySpaceNodeResp copy(CopySpaceNodeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/copy" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + CopySpaceNodeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CopySpaceNodeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/copy" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建知识空间节点,此接口用于在知识节点里创建[节点](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)到指定位置。 + *

知识空间权限要求,当前使用的 access token 所代表的应用或用户拥有:;- **父节点**容器编辑权限 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CreateSpaceNodeSample.java ; + */ + public CreateSpaceNodeResp create(CreateSpaceNodeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/wiki/v2/spaces/:space_id/nodes" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateSpaceNodeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpaceNodeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/nodes" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 创建知识空间节点,此接口用于在知识节点里创建[节点](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)到指定位置。 + *

知识空间权限要求,当前使用的 access token 所代表的应用或用户拥有:;- **父节点**容器编辑权限 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/create ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CreateSpaceNodeSample.java ; + */ + public CreateSpaceNodeResp create(CreateSpaceNodeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/wiki/v2/spaces/:space_id/nodes" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + CreateSpaceNodeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateSpaceNodeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/nodes" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取知识空间子节点列表,此接口用于分页获取Wiki节点的子节点列表。;;此接口为分页接口。由于权限过滤,可能返回列表为空,但分页标记(has_more)为true,可以继续分页请求。 + *

知识库权限要求,当前使用的 access token 所代表的应用或用户拥有:;- 父节点阅读权限 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/ListSpaceNodeSample.java ; + */ + public ListSpaceNodeResp list(ListSpaceNodeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/wiki/v2/spaces/:space_id/nodes" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListSpaceNodeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListSpaceNodeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/nodes" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取知识空间子节点列表,此接口用于分页获取Wiki节点的子节点列表。;;此接口为分页接口。由于权限过滤,可能返回列表为空,但分页标记(has_more)为true,可以继续分页请求。 + *

知识库权限要求,当前使用的 access token 所代表的应用或用户拥有:;- 父节点阅读权限 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/list ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/ListSpaceNodeSample.java ; + */ + public ListSpaceNodeResp list(ListSpaceNodeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/wiki/v2/spaces/:space_id/nodes" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + ListSpaceNodeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListSpaceNodeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/nodes" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 移动知识空间节点,此方法用于在Wiki内移动节点,支持跨知识空间移动。如果有子节点,会携带子节点一起移动。 + *

知识库权限要求:;- 节点编辑权限;- 原父节点容器编辑权限;- 目的父节点容器编辑权限 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/move ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/MoveSpaceNodeSample.java ; + */ + public MoveSpaceNodeResp move(MoveSpaceNodeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/move" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + MoveSpaceNodeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MoveSpaceNodeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/move" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 移动知识空间节点,此方法用于在Wiki内移动节点,支持跨知识空间移动。如果有子节点,会携带子节点一起移动。 + *

知识库权限要求:;- 节点编辑权限;- 原父节点容器编辑权限;- 目的父节点容器编辑权限 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/move ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/MoveSpaceNodeSample.java ; + */ + public MoveSpaceNodeResp move(MoveSpaceNodeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/move" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + MoveSpaceNodeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MoveSpaceNodeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/move" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 移动云空间文档至知识空间,该接口允许移动云空间文档至知识空间,并挂载在指定位置 + *

### 移动操作 ###;移动后,文档将从“我的空间”或“共享空间”转移至“知识库”后,无法从下列入口查看到文档:;- 云空间主页:快速访问;- 我的空间;- 共享空间;;### 权限变更 ###;移动后,文档会向所有可查看“页面树”的用户显示,默认继承父页面的权限设置。; 此接口为异步接口。若移动已完成(或文档已在Wiki中),则直接返回结果(Wiki token)。若尚未完成,则返回task id。请使用[获取任务结果](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/task/get)接口进行查询。;;知识库权限要求,当前使用的 access token 所代表的应用或用户拥有:;- 文档可管理权限;- 原文件夹编辑权限;- 目标父节点容器编辑权限 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/move_docs_to_wiki ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/MoveDocsToWikiSpaceNodeSample.java ; + */ + public MoveDocsToWikiSpaceNodeResp moveDocsToWiki(MoveDocsToWikiSpaceNodeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/wiki/v2/spaces/:space_id/nodes/move_docs_to_wiki" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + MoveDocsToWikiSpaceNodeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MoveDocsToWikiSpaceNodeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/nodes/move_docs_to_wiki" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 移动云空间文档至知识空间,该接口允许移动云空间文档至知识空间,并挂载在指定位置 + *

### 移动操作 ###;移动后,文档将从“我的空间”或“共享空间”转移至“知识库”后,无法从下列入口查看到文档:;- 云空间主页:快速访问;- 我的空间;- 共享空间;;### 权限变更 ###;移动后,文档会向所有可查看“页面树”的用户显示,默认继承父页面的权限设置。; 此接口为异步接口。若移动已完成(或文档已在Wiki中),则直接返回结果(Wiki token)。若尚未完成,则返回task id。请使用[获取任务结果](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/task/get)接口进行查询。;;知识库权限要求,当前使用的 access token 所代表的应用或用户拥有:;- 文档可管理权限;- 原文件夹编辑权限;- 目标父节点容器编辑权限 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/move_docs_to_wiki ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/MoveDocsToWikiSpaceNodeSample.java ; + */ + public MoveDocsToWikiSpaceNodeResp moveDocsToWiki(MoveDocsToWikiSpaceNodeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/wiki/v2/spaces/:space_id/nodes/move_docs_to_wiki" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + MoveDocsToWikiSpaceNodeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, MoveDocsToWikiSpaceNodeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/nodes/move_docs_to_wiki" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新知识空间节点标题,此接口用于更新节点标题 + *

此接口目前仅支持文档(doc)、新版文档(docx)和快捷方式。 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/update_title ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/UpdateTitleSpaceNodeSample.java ; + */ + public UpdateTitleSpaceNodeResp updateTitle(UpdateTitleSpaceNodeReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/update_title" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UpdateTitleSpaceNodeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateTitleSpaceNodeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/update_title" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新知识空间节点标题,此接口用于更新节点标题 + *

此接口目前仅支持文档(doc)、新版文档(docx)和快捷方式。 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/update_title ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/UpdateTitleSpaceNodeSample.java ; + */ + public UpdateTitleSpaceNodeResp updateTitle(UpdateTitleSpaceNodeReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/update_title" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + UpdateTitleSpaceNodeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateTitleSpaceNodeResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/update_title" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/resource/SpaceSetting.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/resource/SpaceSetting.java new file mode 100644 index 000000000..7f5cc42c5 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/resource/SpaceSetting.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.wiki.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.wiki.v2.model.UpdateSpaceSettingReq; +import com.lark.oapi.service.wiki.v2.model.UpdateSpaceSettingResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class SpaceSetting { + private static final Logger log = LoggerFactory.getLogger(SpaceSetting.class); + private final Config config; + + public SpaceSetting(Config config) { + this.config = config; + } + + + /** + * 更新知识空间设置,根据space_id更新知识空间公共设置 + *

知识库权限要求:;- 为知识空间管理员 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-setting/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/UpdateSpaceSettingSample.java ; + */ + public UpdateSpaceSettingResp update(UpdateSpaceSettingReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/wiki/v2/spaces/:space_id/setting" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateSpaceSettingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateSpaceSettingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/setting" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 更新知识空间设置,根据space_id更新知识空间公共设置 + *

知识库权限要求:;- 为知识空间管理员 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-setting/update ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/UpdateSpaceSettingSample.java ; + */ + public UpdateSpaceSettingResp update(UpdateSpaceSettingReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "PUT" + , "/open-apis/wiki/v2/spaces/:space_id/setting" + , Sets.newHashSet(AccessTokenType.User, AccessTokenType.Tenant) + , req); + + // 反序列化 + UpdateSpaceSettingResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, UpdateSpaceSettingResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/spaces/:space_id/setting" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/resource/Task.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/resource/Task.java new file mode 100644 index 000000000..2dcc2e35b --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/wiki/v2/resource/Task.java @@ -0,0 +1,107 @@ +// Code generated by lark suite 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 com.lark.oapi.service.wiki.v2.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.wiki.v2.model.GetTaskReq; +import com.lark.oapi.service.wiki.v2.model.GetTaskResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class Task { + private static final Logger log = LoggerFactory.getLogger(Task.class); + private final Config config; + + public Task(Config config) { + this.config = config; + } + + + /** + * 获取任务结果,该方法用于获取wiki异步任务的结果 + *

知识库权限要求,当前 access token 所代表的用户或应用(机器人):;- 为任务创建者 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/task/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/GetTaskSample.java ; + */ + public GetTaskResp get(GetTaskReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/wiki/v2/tasks/:task_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/tasks/:task_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * 获取任务结果,该方法用于获取wiki异步任务的结果 + *

知识库权限要求,当前 access token 所代表的用户或应用(机器人):;- 为任务创建者 ; + *

官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/task/get ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/GetTaskSample.java ; + */ + public GetTaskResp get(GetTaskReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "GET" + , "/open-apis/wiki/v2/tasks/:task_id" + , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) + , req); + + // 反序列化 + GetTaskResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetTaskResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/wiki/v2/tasks/:task_id" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/workplace/WorkplaceService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/workplace/WorkplaceService.java new file mode 100644 index 000000000..53ed69edf --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/workplace/WorkplaceService.java @@ -0,0 +1,49 @@ +// Code generated by lark suite 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 com.lark.oapi.service.workplace; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.workplace.v1.V1; +import com.lark.oapi.service.workplace.v1.resource.CustomWorkplaceAccessData; +import com.lark.oapi.service.workplace.v1.resource.WorkplaceAccessData; +import com.lark.oapi.service.workplace.v1.resource.WorkplaceBlockAccessData; + +public class WorkplaceService { + private final V1 v1; + private final CustomWorkplaceAccessData customWorkplaceAccessData; // custom_workplace_access_data + private final WorkplaceAccessData workplaceAccessData; // workplace_access_data + private final WorkplaceBlockAccessData workplaceBlockAccessData; // workplace_block_access_data + + public WorkplaceService(Config config) { + this.v1 = new V1(config); + this.customWorkplaceAccessData = new CustomWorkplaceAccessData(config); + this.workplaceAccessData = new WorkplaceAccessData(config); + this.workplaceBlockAccessData = new WorkplaceBlockAccessData(config); + } + + public V1 v1() { + return v1; + } + + public CustomWorkplaceAccessData customWorkplaceAccessData() { + return customWorkplaceAccessData; + } + + public WorkplaceAccessData workplaceAccessData() { + return workplaceAccessData; + } + + public WorkplaceBlockAccessData workplaceBlockAccessData() { + return workplaceBlockAccessData; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/workplace/v1/V1.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/workplace/v1/V1.java new file mode 100644 index 000000000..bb8b73d5c --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/workplace/v1/V1.java @@ -0,0 +1,43 @@ +// Code generated by lark suite 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 com.lark.oapi.service.workplace.v1; + +import com.lark.oapi.core.Config; +import com.lark.oapi.service.workplace.v1.resource.CustomWorkplaceAccessData; +import com.lark.oapi.service.workplace.v1.resource.WorkplaceAccessData; +import com.lark.oapi.service.workplace.v1.resource.WorkplaceBlockAccessData; + +public class V1 { + private final CustomWorkplaceAccessData customWorkplaceAccessData; // custom_workplace_access_data + private final WorkplaceAccessData workplaceAccessData; // workplace_access_data + private final WorkplaceBlockAccessData workplaceBlockAccessData; // workplace_block_access_data + + public V1(Config config) { + this.customWorkplaceAccessData = new CustomWorkplaceAccessData(config); + this.workplaceAccessData = new WorkplaceAccessData(config); + this.workplaceBlockAccessData = new WorkplaceBlockAccessData(config); + } + + public CustomWorkplaceAccessData customWorkplaceAccessData() { + return customWorkplaceAccessData; + } + + public WorkplaceAccessData workplaceAccessData() { + return workplaceAccessData; + } + + public WorkplaceBlockAccessData workplaceBlockAccessData() { + return workplaceBlockAccessData; + } +} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/workplace/v1/WorkplaceService.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/workplace/v1/WorkplaceService.java deleted file mode 100644 index b3e3126fe..000000000 --- a/larksuite-oapi/src/main/java/com/lark/oapi/service/workplace/v1/WorkplaceService.java +++ /dev/null @@ -1,291 +0,0 @@ -// Code generated by lark suite 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 com.lark.oapi.service.workplace.v1; - -import com.lark.oapi.core.Config; -import com.lark.oapi.core.Transport; -import com.lark.oapi.core.request.RequestOptions; -import com.lark.oapi.core.response.RawResponse; -import com.lark.oapi.core.token.AccessTokenType; -import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.core.utils.Sets; -import com.lark.oapi.core.utils.UnmarshalRespUtil; -import com.lark.oapi.service.workplace.v1.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -public class WorkplaceService { - private static final Logger log = LoggerFactory.getLogger(WorkplaceService.class); - private final CustomWorkplaceAccessData customWorkplaceAccessData; // custom_workplace_access_data - private final WorkplaceAccessData workplaceAccessData; // workplace_access_data - private final WorkplaceBlockAccessData workplaceBlockAccessData; // workplace_block_access_data - - public WorkplaceService(Config config) { - this.customWorkplaceAccessData = new CustomWorkplaceAccessData(config); - this.workplaceAccessData = new WorkplaceAccessData(config); - this.workplaceBlockAccessData = new WorkplaceBlockAccessData(config); - } - - /** - * custom_workplace_access_data - * - * @return - */ - public CustomWorkplaceAccessData customWorkplaceAccessData() { - return customWorkplaceAccessData; - } - - /** - * workplace_access_data - * - * @return - */ - public WorkplaceAccessData workplaceAccessData() { - return workplaceAccessData; - } - - /** - * workplace_block_access_data - * - * @return - */ - public WorkplaceBlockAccessData workplaceBlockAccessData() { - return workplaceBlockAccessData; - } - - public static class CustomWorkplaceAccessData { - private final Config config; - - public CustomWorkplaceAccessData(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=workplace&resource=custom_workplace_access_data&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/workplacev1/SearchCustomWorkplaceAccessDataSample.java ; - */ - public SearchCustomWorkplaceAccessDataResp search(SearchCustomWorkplaceAccessDataReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/workplace/v1/custom_workplace_access_data/search" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SearchCustomWorkplaceAccessDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchCustomWorkplaceAccessDataResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/workplace/v1/custom_workplace_access_data/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=workplace&resource=custom_workplace_access_data&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/workplacev1/SearchCustomWorkplaceAccessDataSample.java ; - */ - public SearchCustomWorkplaceAccessDataResp search(SearchCustomWorkplaceAccessDataReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/workplace/v1/custom_workplace_access_data/search" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SearchCustomWorkplaceAccessDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchCustomWorkplaceAccessDataResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/workplace/v1/custom_workplace_access_data/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class WorkplaceAccessData { - private final Config config; - - public WorkplaceAccessData(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=workplace&resource=workplace_access_data&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/workplacev1/SearchWorkplaceAccessDataSample.java ; - */ - public SearchWorkplaceAccessDataResp search(SearchWorkplaceAccessDataReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/workplace/v1/workplace_access_data/search" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SearchWorkplaceAccessDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchWorkplaceAccessDataResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/workplace/v1/workplace_access_data/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=workplace&resource=workplace_access_data&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/workplacev1/SearchWorkplaceAccessDataSample.java ; - */ - public SearchWorkplaceAccessDataResp search(SearchWorkplaceAccessDataReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/workplace/v1/workplace_access_data/search" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SearchWorkplaceAccessDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchWorkplaceAccessDataResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/workplace/v1/workplace_access_data/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - - public static class WorkplaceBlockAccessData { - private final Config config; - - public WorkplaceBlockAccessData(Config config) { - this.config = config; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=workplace&resource=workplace_block_access_data&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/workplacev1/SearchWorkplaceBlockAccessDataSample.java ; - */ - public SearchWorkplaceBlockAccessDataResp search(SearchWorkplaceBlockAccessDataReq req, RequestOptions reqOptions) throws Exception { - // 请求参数选项 - if (reqOptions == null) { - reqOptions = new RequestOptions(); - } - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/workplace/v1/workplace_block_access_data/search" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SearchWorkplaceBlockAccessDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchWorkplaceBlockAccessDataResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/workplace/v1/workplace_block_access_data/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - - /** - * , - *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=workplace&resource=workplace_block_access_data&version=v1 ; - *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/workplacev1/SearchWorkplaceBlockAccessDataSample.java ; - */ - public SearchWorkplaceBlockAccessDataResp search(SearchWorkplaceBlockAccessDataReq req) throws Exception { - // 请求参数选项 - RequestOptions reqOptions = new RequestOptions(); - - // 发起请求 - RawResponse httpResponse = Transport.send(config, reqOptions, "POST" - , "/open-apis/workplace/v1/workplace_block_access_data/search" - , Sets.newHashSet(AccessTokenType.Tenant) - , req); - - // 反序列化 - SearchWorkplaceBlockAccessDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchWorkplaceBlockAccessDataResp.class); - if (resp == null) { - log.error(String.format( - "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/workplace/v1/workplace_block_access_data/search" - , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), - httpResponse.getStatusCode(), new String(httpResponse.getBody(), - StandardCharsets.UTF_8))); - throw new IllegalArgumentException("The result returned by the server is illegal"); - } - - resp.setRawResponse(httpResponse); - resp.setRequest(req); - - return resp; - } - } - -} \ No newline at end of file diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/workplace/v1/resource/CustomWorkplaceAccessData.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/workplace/v1/resource/CustomWorkplaceAccessData.java new file mode 100644 index 000000000..506779f9a --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/workplace/v1/resource/CustomWorkplaceAccessData.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.workplace.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.workplace.v1.model.SearchCustomWorkplaceAccessDataReq; +import com.lark.oapi.service.workplace.v1.model.SearchCustomWorkplaceAccessDataResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class CustomWorkplaceAccessData { + private static final Logger log = LoggerFactory.getLogger(CustomWorkplaceAccessData.class); + private final Config config; + + public CustomWorkplaceAccessData(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=workplace&resource=custom_workplace_access_data&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/workplacev1/SearchCustomWorkplaceAccessDataSample.java ; + */ + public SearchCustomWorkplaceAccessDataResp search(SearchCustomWorkplaceAccessDataReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/workplace/v1/custom_workplace_access_data/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchCustomWorkplaceAccessDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchCustomWorkplaceAccessDataResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/workplace/v1/custom_workplace_access_data/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=workplace&resource=custom_workplace_access_data&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/workplacev1/SearchCustomWorkplaceAccessDataSample.java ; + */ + public SearchCustomWorkplaceAccessDataResp search(SearchCustomWorkplaceAccessDataReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/workplace/v1/custom_workplace_access_data/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchCustomWorkplaceAccessDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchCustomWorkplaceAccessDataResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/workplace/v1/custom_workplace_access_data/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/workplace/v1/resource/WorkplaceAccessData.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/workplace/v1/resource/WorkplaceAccessData.java new file mode 100644 index 000000000..9757e211d --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/workplace/v1/resource/WorkplaceAccessData.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.workplace.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.workplace.v1.model.SearchWorkplaceAccessDataReq; +import com.lark.oapi.service.workplace.v1.model.SearchWorkplaceAccessDataResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class WorkplaceAccessData { + private static final Logger log = LoggerFactory.getLogger(WorkplaceAccessData.class); + private final Config config; + + public WorkplaceAccessData(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=workplace&resource=workplace_access_data&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/workplacev1/SearchWorkplaceAccessDataSample.java ; + */ + public SearchWorkplaceAccessDataResp search(SearchWorkplaceAccessDataReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/workplace/v1/workplace_access_data/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchWorkplaceAccessDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchWorkplaceAccessDataResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/workplace/v1/workplace_access_data/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=workplace&resource=workplace_access_data&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/workplacev1/SearchWorkplaceAccessDataSample.java ; + */ + public SearchWorkplaceAccessDataResp search(SearchWorkplaceAccessDataReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/workplace/v1/workplace_access_data/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchWorkplaceAccessDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchWorkplaceAccessDataResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/workplace/v1/workplace_access_data/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/service/workplace/v1/resource/WorkplaceBlockAccessData.java b/larksuite-oapi/src/main/java/com/lark/oapi/service/workplace/v1/resource/WorkplaceBlockAccessData.java new file mode 100644 index 000000000..bf9b42d74 --- /dev/null +++ b/larksuite-oapi/src/main/java/com/lark/oapi/service/workplace/v1/resource/WorkplaceBlockAccessData.java @@ -0,0 +1,105 @@ +// Code generated by lark suite 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 com.lark.oapi.service.workplace.v1.resource; + +import com.lark.oapi.core.Config; +import com.lark.oapi.core.Transport; +import com.lark.oapi.core.request.RequestOptions; +import com.lark.oapi.core.response.RawResponse; +import com.lark.oapi.core.token.AccessTokenType; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.core.utils.Sets; +import com.lark.oapi.core.utils.UnmarshalRespUtil; +import com.lark.oapi.service.workplace.v1.model.SearchWorkplaceBlockAccessDataReq; +import com.lark.oapi.service.workplace.v1.model.SearchWorkplaceBlockAccessDataResp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class WorkplaceBlockAccessData { + private static final Logger log = LoggerFactory.getLogger(WorkplaceBlockAccessData.class); + private final Config config; + + public WorkplaceBlockAccessData(Config config) { + this.config = config; + } + + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=workplace&resource=workplace_block_access_data&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/workplacev1/SearchWorkplaceBlockAccessDataSample.java ; + */ + public SearchWorkplaceBlockAccessDataResp search(SearchWorkplaceBlockAccessDataReq req, RequestOptions reqOptions) throws Exception { + // 请求参数选项 + if (reqOptions == null) { + reqOptions = new RequestOptions(); + } + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/workplace/v1/workplace_block_access_data/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchWorkplaceBlockAccessDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchWorkplaceBlockAccessDataResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/workplace/v1/workplace_block_access_data/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } + + /** + * , + *

官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=workplace&resource=workplace_block_access_data&version=v1 ; + *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/workplacev1/SearchWorkplaceBlockAccessDataSample.java ; + */ + public SearchWorkplaceBlockAccessDataResp search(SearchWorkplaceBlockAccessDataReq req) throws Exception { + // 请求参数选项 + RequestOptions reqOptions = new RequestOptions(); + + // 发起请求 + RawResponse httpResponse = Transport.send(config, reqOptions, "POST" + , "/open-apis/workplace/v1/workplace_block_access_data/search" + , Sets.newHashSet(AccessTokenType.Tenant) + , req); + + // 反序列化 + SearchWorkplaceBlockAccessDataResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SearchWorkplaceBlockAccessDataResp.class); + if (resp == null) { + log.error(String.format( + "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/workplace/v1/workplace_block_access_data/search" + , Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()), + httpResponse.getStatusCode(), new String(httpResponse.getBody(), + StandardCharsets.UTF_8))); + throw new IllegalArgumentException("The result returned by the server is illegal"); + } + + resp.setRawResponse(httpResponse); + resp.setRequest(req); + + return resp; + } +} diff --git a/larksuite-oapi/src/test/java/com/lark/oapi/event/TestEventDispatcher.java b/larksuite-oapi/src/test/java/com/lark/oapi/event/TestEventDispatcher.java index 1fa467924..7c451838c 100644 --- a/larksuite-oapi/src/test/java/com/lark/oapi/event/TestEventDispatcher.java +++ b/larksuite-oapi/src/test/java/com/lark/oapi/event/TestEventDispatcher.java @@ -16,9 +16,9 @@ import com.lark.oapi.core.request.EventReq; import com.lark.oapi.core.response.EventResp; import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.service.contact.v3.ContactService; +import com.lark.oapi.service.contact.ContactService; import com.lark.oapi.service.contact.v3.model.P2UserCreatedV3; -import com.lark.oapi.service.im.v1.ImService; +import com.lark.oapi.service.im.ImService; import com.lark.oapi.service.im.v1.model.P1MessageReadV1; import com.lark.oapi.service.im.v1.model.P2MessageReceiveV1; import org.junit.Test; diff --git a/sample/pom.xml b/sample/pom.xml index ea99d14b9..68ec1d700 100644 --- a/sample/pom.xml +++ b/sample/pom.xml @@ -55,7 +55,7 @@ oapi-sdk com.larksuite.oapi - 2.0.30 + 2.1.0 httpclient diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/GetAccessRecordAccessPhotoSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/GetAccessRecordAccessPhotoSample.java index c5564583e..410deff3f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/GetAccessRecordAccessPhotoSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/GetAccessRecordAccessPhotoSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetAccessRecordAccessPhotoResp resp = client.acs().accessRecordAccessPhoto().get(req); + GetAccessRecordAccessPhotoResp resp = client.acs().v1().accessRecordAccessPhoto().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/GetUserFaceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/GetUserFaceSample.java index 5c0966aea..d0182702b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/GetUserFaceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/GetUserFaceSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetUserFaceResp resp = client.acs().userFace().get(req); + GetUserFaceResp resp = client.acs().v1().userFace().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/GetUserSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/GetUserSample.java index 6de5eea3d..3a711f569 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/GetUserSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/GetUserSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetUserResp resp = client.acs().user().get(req); + GetUserResp resp = client.acs().v1().user().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/ListAccessRecordSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/ListAccessRecordSample.java index 8d6f8eff3..3b9e36dc5 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/ListAccessRecordSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/ListAccessRecordSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListAccessRecordResp resp = client.acs().accessRecord().list(req); + ListAccessRecordResp resp = client.acs().v1().accessRecord().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/ListUserSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/ListUserSample.java index afb39979d..5b96883d9 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/ListUserSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/ListUserSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListUserResp resp = client.acs().user().list(req); + ListUserResp resp = client.acs().v1().user().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/PatchUserSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/PatchUserSample.java index 7fd90b4d8..165bf4f90 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/PatchUserSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/PatchUserSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchUserResp resp = client.acs().user().patch(req); + PatchUserResp resp = client.acs().v1().user().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/UpdateUserFaceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/UpdateUserFaceSample.java index 76fef0e33..26fc6e770 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/UpdateUserFaceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/acsv1/UpdateUserFaceSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateUserFaceResp resp = client.acs().userFace().update(req); + UpdateUserFaceResp resp = client.acs().v1().userFace().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/CreateBadgeGrantSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/CreateBadgeGrantSample.java index 1296649a2..a554fef9b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/CreateBadgeGrantSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/CreateBadgeGrantSample.java @@ -32,7 +32,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateBadgeGrantResp resp = client.admin().badgeGrant().create(req); + CreateBadgeGrantResp resp = client.admin().v1().badgeGrant().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/CreateBadgeImageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/CreateBadgeImageSample.java index 8c5d47147..686359fda 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/CreateBadgeImageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/CreateBadgeImageSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateBadgeImageResp resp = client.admin().badgeImage().create(req); + CreateBadgeImageResp resp = client.admin().v1().badgeImage().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/CreateBadgeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/CreateBadgeSample.java index 624cd4df3..a2fd11794 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/CreateBadgeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/CreateBadgeSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateBadgeResp resp = client.admin().badge().create(req); + CreateBadgeResp resp = client.admin().v1().badge().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/DeleteBadgeGrantSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/DeleteBadgeGrantSample.java index 28e675758..f0bcf9fdf 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/DeleteBadgeGrantSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/DeleteBadgeGrantSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteBadgeGrantResp resp = client.admin().badgeGrant().delete(req); + DeleteBadgeGrantResp resp = client.admin().v1().badgeGrant().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/GetBadgeGrantSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/GetBadgeGrantSample.java index 8e8f6adb2..9f1b6b4ad 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/GetBadgeGrantSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/GetBadgeGrantSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetBadgeGrantResp resp = client.admin().badgeGrant().get(req); + GetBadgeGrantResp resp = client.admin().v1().badgeGrant().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/GetBadgeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/GetBadgeSample.java index c18734ce0..604a6a855 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/GetBadgeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/GetBadgeSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetBadgeResp resp = client.admin().badge().get(req); + GetBadgeResp resp = client.admin().v1().badge().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListAdminDeptStatSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListAdminDeptStatSample.java index d97d20286..aaeef0a3f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListAdminDeptStatSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListAdminDeptStatSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListAdminDeptStatResp resp = client.admin().adminDeptStat().list(req); + ListAdminDeptStatResp resp = client.admin().v1().adminDeptStat().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListAdminUserStatSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListAdminUserStatSample.java index 91749efe2..8616d751b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListAdminUserStatSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListAdminUserStatSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListAdminUserStatResp resp = client.admin().adminUserStat().list(req); + ListAdminUserStatResp resp = client.admin().v1().adminUserStat().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListAuditInfoSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListAuditInfoSample.java new file mode 100644 index 000000000..d9c6287fc --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListAuditInfoSample.java @@ -0,0 +1,41 @@ +package com.lark.oapi.sample.apiall.adminv1; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.admin.v1.model.ListAuditInfoReq; +import com.lark.oapi.service.admin.v1.model.ListAuditInfoResp; + +// GET /open-apis/admin/v1/audit_infos +public class ListAuditInfoSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + ListAuditInfoReq req = ListAuditInfoReq.newBuilder() + .userIdType("user_id") + .latest(1668700799) + .oldest(1668528000) + .eventName("space_create_doc") + .operatorType("user") + .operatorValue("55ed16fe") + .eventModule(1) + .pageToken("LC39/f1%2B/Sz9Uv39Gf39/ew/cd5WY0gfGYFdixOW9cVk4bC79ituO/gx0qpPn1bYf92nz/kI0nNJOG3wCwDJKoNU%2BtyaXbpI8pV/9UNDMZT0BNeyanFH17Wv711Qh9anR3l2GjQfc2fUqXtxg1YPp63XyhYY4iRMv54ySRG7r%2BI89iS3zAoPzFuuU1MUJKsf") + .pageSize(20) + .build(); + + // 发起请求 + ListAuditInfoResp resp = client.admin().v1().auditInfo().list(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListBadgeGrantSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListBadgeGrantSample.java index 0434f2aa8..e9a2da216 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListBadgeGrantSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListBadgeGrantSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListBadgeGrantResp resp = client.admin().badgeGrant().list(req); + ListBadgeGrantResp resp = client.admin().v1().badgeGrant().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListBadgeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListBadgeSample.java index 8f25a298d..ede0f51da 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListBadgeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ListBadgeSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListBadgeResp resp = client.admin().badge().list(req); + ListBadgeResp resp = client.admin().v1().badge().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ResetPasswordSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ResetPasswordSample.java index 430fc6cfb..f090ef507 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ResetPasswordSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/ResetPasswordSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ResetPasswordResp resp = client.admin().password().reset(req); + ResetPasswordResp resp = client.admin().v1().password().reset(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/UpdateBadgeGrantSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/UpdateBadgeGrantSample.java index e5afe05bf..18d5eae0f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/UpdateBadgeGrantSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/UpdateBadgeGrantSample.java @@ -33,7 +33,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateBadgeGrantResp resp = client.admin().badgeGrant().update(req); + UpdateBadgeGrantResp resp = client.admin().v1().badgeGrant().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/UpdateBadgeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/UpdateBadgeSample.java index cb0b65bc7..01225e8e6 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/UpdateBadgeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/adminv1/UpdateBadgeSample.java @@ -28,7 +28,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateBadgeResp resp = client.admin().badge().update(req); + UpdateBadgeResp resp = client.admin().v1().badge().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/CheckWhiteBlackListApplicationVisibilitySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/CheckWhiteBlackListApplicationVisibilitySample.java index b73d44643..3f7af5959 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/CheckWhiteBlackListApplicationVisibilitySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/CheckWhiteBlackListApplicationVisibilitySample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CheckWhiteBlackListApplicationVisibilityResp resp = client.application().applicationVisibility().checkWhiteBlackList(req); + CheckWhiteBlackListApplicationVisibilityResp resp = client.application().v6().applicationVisibility().checkWhiteBlackList(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ContactsRangeConfigurationApplicationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ContactsRangeConfigurationApplicationSample.java index 2d2ee6af2..025e28b6b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ContactsRangeConfigurationApplicationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ContactsRangeConfigurationApplicationSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ContactsRangeConfigurationApplicationResp resp = client.application().application().contactsRangeConfiguration(req); + ContactsRangeConfigurationApplicationResp resp = client.application().v6().application().contactsRangeConfiguration(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ContactsRangeSuggestApplicationAppVersionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ContactsRangeSuggestApplicationAppVersionSample.java index 9eb778521..6441e3a55 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ContactsRangeSuggestApplicationAppVersionSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ContactsRangeSuggestApplicationAppVersionSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ContactsRangeSuggestApplicationAppVersionResp resp = client.application().applicationAppVersion().contactsRangeSuggest(req); + ContactsRangeSuggestApplicationAppVersionResp resp = client.application().v6().applicationAppVersion().contactsRangeSuggest(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/DepartmentOverviewApplicationAppUsageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/DepartmentOverviewApplicationAppUsageSample.java index f14bd5318..59d696611 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/DepartmentOverviewApplicationAppUsageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/DepartmentOverviewApplicationAppUsageSample.java @@ -28,7 +28,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DepartmentOverviewApplicationAppUsageResp resp = client.application().applicationAppUsage().departmentOverview(req); + DepartmentOverviewApplicationAppUsageResp resp = client.application().v6().applicationAppUsage().departmentOverview(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/GetApplicationAppVersionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/GetApplicationAppVersionSample.java index 2b975c227..2304b1e9e 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/GetApplicationAppVersionSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/GetApplicationAppVersionSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetApplicationAppVersionResp resp = client.application().applicationAppVersion().get(req); + GetApplicationAppVersionResp resp = client.application().v6().applicationAppVersion().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/GetApplicationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/GetApplicationSample.java index e69fd479c..f75a7fe20 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/GetApplicationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/GetApplicationSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetApplicationResp resp = client.application().application().get(req); + GetApplicationResp resp = client.application().v6().application().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ListAppRecommendRuleSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ListAppRecommendRuleSample.java index 10179b271..559584e44 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ListAppRecommendRuleSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ListAppRecommendRuleSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListAppRecommendRuleResp resp = client.application().appRecommendRule().list(req); + ListAppRecommendRuleResp resp = client.application().v6().appRecommendRule().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ListApplicationAppVersionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ListApplicationAppVersionSample.java index 00f503d5e..1645650b7 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ListApplicationAppVersionSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ListApplicationAppVersionSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListApplicationAppVersionResp resp = client.application().applicationAppVersion().list(req); + ListApplicationAppVersionResp resp = client.application().v6().applicationAppVersion().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ListApplicationFeedbackSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ListApplicationFeedbackSample.java index c1b910576..5274924a9 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ListApplicationFeedbackSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/ListApplicationFeedbackSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListApplicationFeedbackResp resp = client.application().applicationFeedback().list(req); + ListApplicationFeedbackResp resp = client.application().v6().applicationFeedback().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/OverviewApplicationAppUsageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/OverviewApplicationAppUsageSample.java index db31aa35b..29fdaf321 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/OverviewApplicationAppUsageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/OverviewApplicationAppUsageSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - OverviewApplicationAppUsageResp resp = client.application().applicationAppUsage().overview(req); + OverviewApplicationAppUsageResp resp = client.application().v6().applicationAppUsage().overview(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationAppVersionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationAppVersionSample.java index 04a1fa292..ad22cbf50 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationAppVersionSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationAppVersionSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchApplicationAppVersionResp resp = client.application().applicationAppVersion().patch(req); + PatchApplicationAppVersionResp resp = client.application().v6().applicationAppVersion().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationContactsRangeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationContactsRangeSample.java index 5fef5f100..fb382e4ca 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationContactsRangeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationContactsRangeSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchApplicationContactsRangeResp resp = client.application().applicationContactsRange().patch(req); + PatchApplicationContactsRangeResp resp = client.application().v6().applicationContactsRange().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationFeedbackSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationFeedbackSample.java index d2c7c03cb..75d7b8a54 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationFeedbackSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationFeedbackSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchApplicationFeedbackResp resp = client.application().applicationFeedback().patch(req); + PatchApplicationFeedbackResp resp = client.application().v6().applicationFeedback().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationSample.java index 79e759d3a..dedebac13 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchApplicationResp resp = client.application().application().patch(req); + PatchApplicationResp resp = client.application().v6().application().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationVisibilitySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationVisibilitySample.java index 79357e1f2..1fa850bc3 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationVisibilitySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/PatchApplicationVisibilitySample.java @@ -29,7 +29,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchApplicationVisibilityResp resp = client.application().applicationVisibility().patch(req); + PatchApplicationVisibilityResp resp = client.application().v6().applicationVisibility().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/SetAppBadgeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/SetAppBadgeSample.java index d41f09917..65e957408 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/SetAppBadgeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/SetAppBadgeSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SetAppBadgeResp resp = client.application().appBadge().set(req); + SetAppBadgeResp resp = client.application().v6().appBadge().set(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/UnderauditlistApplicationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/UnderauditlistApplicationSample.java index 30e12cf53..d701bf1ca 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/UnderauditlistApplicationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/UnderauditlistApplicationSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UnderauditlistApplicationResp resp = client.application().application().underauditlist(req); + UnderauditlistApplicationResp resp = client.application().v6().application().underauditlist(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/AddSignInstanceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/AddSignInstanceSample.java index 24ec1474d..f85c01a3d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/AddSignInstanceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/AddSignInstanceSample.java @@ -28,7 +28,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - AddSignInstanceResp resp = client.approval().instance().addSign(req); + AddSignInstanceResp resp = client.approval().v4().instance().addSign(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ApproveTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ApproveTaskSample.java index 88c30f2b5..3cb8c09ef 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ApproveTaskSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ApproveTaskSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ApproveTaskResp resp = client.approval().task().approve(req); + ApproveTaskResp resp = client.approval().v4().task().approve(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CancelInstanceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CancelInstanceSample.java index 43d92ab27..c2046e792 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CancelInstanceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CancelInstanceSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CancelInstanceResp resp = client.approval().instance().cancel(req); + CancelInstanceResp resp = client.approval().v4().instance().cancel(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CcInstanceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CcInstanceSample.java index 32cf82500..d38412c55 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CcInstanceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CcInstanceSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CcInstanceResp resp = client.approval().instance().cc(req); + CcInstanceResp resp = client.approval().v4().instance().cc(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CheckExternalInstanceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CheckExternalInstanceSample.java index a27138081..2a3d673d0 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CheckExternalInstanceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CheckExternalInstanceSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CheckExternalInstanceResp resp = client.approval().externalInstance().check(req); + CheckExternalInstanceResp resp = client.approval().v4().externalInstance().check(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateApprovalSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateApprovalSample.java index dd5a91b57..d5ba967a9 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateApprovalSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateApprovalSample.java @@ -31,7 +31,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateApprovalResp resp = client.approval().approval().create(req); + CreateApprovalResp resp = client.approval().v4().approval().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateExternalApprovalSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateExternalApprovalSample.java index 069d664de..4a1d75b04 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateExternalApprovalSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateExternalApprovalSample.java @@ -29,7 +29,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateExternalApprovalResp resp = client.approval().externalApproval().create(req); + CreateExternalApprovalResp resp = client.approval().v4().externalApproval().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateExternalInstanceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateExternalInstanceSample.java index c1e9363e4..aac875302 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateExternalInstanceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateExternalInstanceSample.java @@ -42,7 +42,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateExternalInstanceResp resp = client.approval().externalInstance().create(req); + CreateExternalInstanceResp resp = client.approval().v4().externalInstance().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateInstanceCommentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateInstanceCommentSample.java index 2219365cb..d26f75f72 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateInstanceCommentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateInstanceCommentSample.java @@ -30,7 +30,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateInstanceCommentResp resp = client.approval().instanceComment().create(req); + CreateInstanceCommentResp resp = client.approval().v4().instanceComment().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateInstanceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateInstanceSample.java index f50d42199..aa02bc219 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateInstanceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/CreateInstanceSample.java @@ -35,7 +35,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateInstanceResp resp = client.approval().instance().create(req); + CreateInstanceResp resp = client.approval().v4().instance().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/DeleteInstanceCommentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/DeleteInstanceCommentSample.java index 600f62431..2bf1d5be7 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/DeleteInstanceCommentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/DeleteInstanceCommentSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteInstanceCommentResp resp = client.approval().instanceComment().delete(req); + DeleteInstanceCommentResp resp = client.approval().v4().instanceComment().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/GetApprovalSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/GetApprovalSample.java index c0b3f7630..b76c22ce1 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/GetApprovalSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/GetApprovalSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetApprovalResp resp = client.approval().approval().get(req); + GetApprovalResp resp = client.approval().v4().approval().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/GetExternalApprovalSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/GetExternalApprovalSample.java index 3c0d6234e..ca55dd395 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/GetExternalApprovalSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/GetExternalApprovalSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetExternalApprovalResp resp = client.approval().externalApproval().get(req); + GetExternalApprovalResp resp = client.approval().v4().externalApproval().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/GetInstanceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/GetInstanceSample.java index 7fbb3545d..517bf74b0 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/GetInstanceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/GetInstanceSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetInstanceResp resp = client.approval().instance().get(req); + GetInstanceResp resp = client.approval().v4().instance().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ListExternalTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ListExternalTaskSample.java index 8abf901fe..0fbc1fc41 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ListExternalTaskSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ListExternalTaskSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListExternalTaskResp resp = client.approval().externalTask().list(req); + ListExternalTaskResp resp = client.approval().v4().externalTask().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ListInstanceCommentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ListInstanceCommentSample.java index 94c0b8ee0..418de2e36 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ListInstanceCommentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ListInstanceCommentSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListInstanceCommentResp resp = client.approval().instanceComment().list(req); + ListInstanceCommentResp resp = client.approval().v4().instanceComment().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ListInstanceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ListInstanceSample.java index 3a246411e..b2e586f26 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ListInstanceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ListInstanceSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListInstanceResp resp = client.approval().instance().list(req); + ListInstanceResp resp = client.approval().v4().instance().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/PreviewInstanceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/PreviewInstanceSample.java index bbbd5d5b5..87b570bf0 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/PreviewInstanceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/PreviewInstanceSample.java @@ -28,7 +28,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PreviewInstanceResp resp = client.approval().instance().preview(req); + PreviewInstanceResp resp = client.approval().v4().instance().preview(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/QueryInstanceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/QueryInstanceSample.java index 890cf0de7..04affdce6 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/QueryInstanceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/QueryInstanceSample.java @@ -33,7 +33,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - QueryInstanceResp resp = client.approval().instance().query(req); + QueryInstanceResp resp = client.approval().v4().instance().query(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/QueryTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/QueryTaskSample.java index ca305ad9a..7570337cb 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/QueryTaskSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/QueryTaskSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - QueryTaskResp resp = client.approval().task().query(req); + QueryTaskResp resp = client.approval().v4().task().query(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/RejectTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/RejectTaskSample.java index 7d926cd01..bda62f8d0 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/RejectTaskSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/RejectTaskSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - RejectTaskResp resp = client.approval().task().reject(req); + RejectTaskResp resp = client.approval().v4().task().reject(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/RemoveInstanceCommentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/RemoveInstanceCommentSample.java index 32691ad50..02739d0f3 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/RemoveInstanceCommentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/RemoveInstanceCommentSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - RemoveInstanceCommentResp resp = client.approval().instanceComment().remove(req); + RemoveInstanceCommentResp resp = client.approval().v4().instanceComment().remove(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ResubmitTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ResubmitTaskSample.java index d8ca419b5..8069458cc 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ResubmitTaskSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/ResubmitTaskSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ResubmitTaskResp resp = client.approval().task().resubmit(req); + ResubmitTaskResp resp = client.approval().v4().task().resubmit(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SearchCcInstanceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SearchCcInstanceSample.java index 4d1651e7d..cbf5b9ab6 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SearchCcInstanceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SearchCcInstanceSample.java @@ -33,7 +33,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SearchCcInstanceResp resp = client.approval().instance().searchCc(req); + SearchCcInstanceResp resp = client.approval().v4().instance().searchCc(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SearchTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SearchTaskSample.java index b536a529b..4d5591903 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SearchTaskSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SearchTaskSample.java @@ -35,7 +35,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SearchTaskResp resp = client.approval().task().search(req); + SearchTaskResp resp = client.approval().v4().task().search(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SpecifiedRollbackInstanceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SpecifiedRollbackInstanceSample.java index 0e59f8af4..9900788c7 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SpecifiedRollbackInstanceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SpecifiedRollbackInstanceSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SpecifiedRollbackInstanceResp resp = client.approval().instance().specifiedRollback(req); + SpecifiedRollbackInstanceResp resp = client.approval().v4().instance().specifiedRollback(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SubscribeApprovalSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SubscribeApprovalSample.java index 9c7673ab5..e27e1f6f8 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SubscribeApprovalSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/SubscribeApprovalSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SubscribeApprovalResp resp = client.approval().approval().subscribe(req); + SubscribeApprovalResp resp = client.approval().v4().approval().subscribe(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/TransferTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/TransferTaskSample.java index eec1961dd..9e44bab7b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/TransferTaskSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/TransferTaskSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - TransferTaskResp resp = client.approval().task().transfer(req); + TransferTaskResp resp = client.approval().v4().task().transfer(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/UnsubscribeApprovalSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/UnsubscribeApprovalSample.java index aec4edd0b..e1ae32a40 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/UnsubscribeApprovalSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/approvalv4/UnsubscribeApprovalSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UnsubscribeApprovalResp resp = client.approval().approval().unsubscribe(req); + UnsubscribeApprovalResp resp = client.approval().v4().approval().unsubscribe(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/BatchCreateUserDailyShiftSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/BatchCreateUserDailyShiftSample.java index 226e9f57e..6268b638f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/BatchCreateUserDailyShiftSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/BatchCreateUserDailyShiftSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchCreateUserDailyShiftResp resp = client.attendance().userDailyShift().batchCreate(req); + BatchCreateUserDailyShiftResp resp = client.attendance().v1().userDailyShift().batchCreate(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/BatchCreateUserFlowSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/BatchCreateUserFlowSample.java index 920825290..ae7b7ebc6 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/BatchCreateUserFlowSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/BatchCreateUserFlowSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchCreateUserFlowResp resp = client.attendance().userFlow().batchCreate(req); + BatchCreateUserFlowResp resp = client.attendance().v1().userFlow().batchCreate(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateGroupSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateGroupSample.java index 9b2419a78..f943b5d98 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateGroupSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateGroupSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateGroupResp resp = client.attendance().group().create(req); + CreateGroupResp resp = client.attendance().v1().group().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateShiftSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateShiftSample.java index 189a4c483..51d300ff9 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateShiftSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateShiftSample.java @@ -29,7 +29,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateShiftResp resp = client.attendance().shift().create(req); + CreateShiftResp resp = client.attendance().v1().shift().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateUserApprovalSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateUserApprovalSample.java index 5301c1bd3..4d5af8cbe 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateUserApprovalSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateUserApprovalSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateUserApprovalResp resp = client.attendance().userApproval().create(req); + CreateUserApprovalResp resp = client.attendance().v1().userApproval().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateUserTaskRemedySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateUserTaskRemedySample.java index c88d4faa7..f1df18a2c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateUserTaskRemedySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/CreateUserTaskRemedySample.java @@ -28,7 +28,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateUserTaskRemedyResp resp = client.attendance().userTaskRemedy().create(req); + CreateUserTaskRemedyResp resp = client.attendance().v1().userTaskRemedy().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/DeleteGroupSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/DeleteGroupSample.java index c2cd9f51c..7bacda962 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/DeleteGroupSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/DeleteGroupSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteGroupResp resp = client.attendance().group().delete(req); + DeleteGroupResp resp = client.attendance().v1().group().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/DeleteShiftSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/DeleteShiftSample.java index 619e50651..905356868 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/DeleteShiftSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/DeleteShiftSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteShiftResp resp = client.attendance().shift().delete(req); + DeleteShiftResp resp = client.attendance().v1().shift().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/DownloadFileSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/DownloadFileSample.java index 97c921bc3..0cccf9eb3 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/DownloadFileSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/DownloadFileSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DownloadFileResp resp = client.attendance().file().download(req); + DownloadFileResp resp = client.attendance().v1().file().download(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetGroupSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetGroupSample.java index c33536bce..f9307de0d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetGroupSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetGroupSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetGroupResp resp = client.attendance().group().get(req); + GetGroupResp resp = client.attendance().v1().group().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetLeaveEmployExpireRecordSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetLeaveEmployExpireRecordSample.java index ccdc3ef81..ecb939995 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetLeaveEmployExpireRecordSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetLeaveEmployExpireRecordSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetLeaveEmployExpireRecordResp resp = client.attendance().leaveEmployExpireRecord().get(req); + GetLeaveEmployExpireRecordResp resp = client.attendance().v1().leaveEmployExpireRecord().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetShiftSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetShiftSample.java index 9c9c893e8..3c5587900 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetShiftSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetShiftSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetShiftResp resp = client.attendance().shift().get(req); + GetShiftResp resp = client.attendance().v1().shift().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetUserFlowSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetUserFlowSample.java index 249333e9d..2ead1c98a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetUserFlowSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/GetUserFlowSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetUserFlowResp resp = client.attendance().userFlow().get(req); + GetUserFlowResp resp = client.attendance().v1().userFlow().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ListGroupSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ListGroupSample.java index 18659e35c..fa699ae64 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ListGroupSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ListGroupSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListGroupResp resp = client.attendance().group().list(req); + ListGroupResp resp = client.attendance().v1().group().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ListShiftSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ListShiftSample.java index d9a9c97c4..e03e88a74 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ListShiftSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ListShiftSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListShiftResp resp = client.attendance().shift().list(req); + ListShiftResp resp = client.attendance().v1().shift().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ModifyUserSettingSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ModifyUserSettingSample.java index 01920a365..690415780 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ModifyUserSettingSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ModifyUserSettingSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ModifyUserSettingResp resp = client.attendance().userSetting().modify(req); + ModifyUserSettingResp resp = client.attendance().v1().userSetting().modify(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/PatchLeaveAccrualRecordSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/PatchLeaveAccrualRecordSample.java index d64eabf11..438877992 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/PatchLeaveAccrualRecordSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/PatchLeaveAccrualRecordSample.java @@ -30,7 +30,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchLeaveAccrualRecordResp resp = client.attendance().leaveAccrualRecord().patch(req); + PatchLeaveAccrualRecordResp resp = client.attendance().v1().leaveAccrualRecord().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ProcessApprovalInfoSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ProcessApprovalInfoSample.java index e2c491b01..f40cd9143 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ProcessApprovalInfoSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/ProcessApprovalInfoSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ProcessApprovalInfoResp resp = client.attendance().approvalInfo().process(req); + ProcessApprovalInfoResp resp = client.attendance().v1().approvalInfo().process(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryShiftSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryShiftSample.java index 1617f22c4..8ee1f02cc 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryShiftSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryShiftSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - QueryShiftResp resp = client.attendance().shift().query(req); + QueryShiftResp resp = client.attendance().v1().shift().query(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserAllowedRemedysUserTaskRemedySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserAllowedRemedysUserTaskRemedySample.java index f43f394f8..21961cdfd 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserAllowedRemedysUserTaskRemedySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserAllowedRemedysUserTaskRemedySample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - QueryUserAllowedRemedysUserTaskRemedyResp resp = client.attendance().userTaskRemedy().queryUserAllowedRemedys(req); + QueryUserAllowedRemedysUserTaskRemedyResp resp = client.attendance().v1().userTaskRemedy().queryUserAllowedRemedys(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserApprovalSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserApprovalSample.java index 3ca9c226f..3911c1114 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserApprovalSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserApprovalSample.java @@ -28,7 +28,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - QueryUserApprovalResp resp = client.attendance().userApproval().query(req); + QueryUserApprovalResp resp = client.attendance().v1().userApproval().query(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserDailyShiftSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserDailyShiftSample.java index 54f5b0522..c1b4f54d9 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserDailyShiftSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserDailyShiftSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - QueryUserDailyShiftResp resp = client.attendance().userDailyShift().query(req); + QueryUserDailyShiftResp resp = client.attendance().v1().userDailyShift().query(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserFlowSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserFlowSample.java index 470914e06..d005a5153 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserFlowSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserFlowSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - QueryUserFlowResp resp = client.attendance().userFlow().query(req); + QueryUserFlowResp resp = client.attendance().v1().userFlow().query(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserSettingSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserSettingSample.java index b340089e6..8b4c00da1 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserSettingSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserSettingSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - QueryUserSettingResp resp = client.attendance().userSetting().query(req); + QueryUserSettingResp resp = client.attendance().v1().userSetting().query(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserStatsDataSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserStatsDataSample.java index 4f597a5d6..c92f808d3 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserStatsDataSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserStatsDataSample.java @@ -29,7 +29,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - QueryUserStatsDataResp resp = client.attendance().userStatsData().query(req); + QueryUserStatsDataResp resp = client.attendance().v1().userStatsData().query(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserStatsFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserStatsFieldSample.java index 6962d3590..bbdd0c8bd 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserStatsFieldSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserStatsFieldSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - QueryUserStatsFieldResp resp = client.attendance().userStatsField().query(req); + QueryUserStatsFieldResp resp = client.attendance().v1().userStatsField().query(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserStatsViewSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserStatsViewSample.java index f55f90760..0b0d44b1f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserStatsViewSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserStatsViewSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - QueryUserStatsViewResp resp = client.attendance().userStatsView().query(req); + QueryUserStatsViewResp resp = client.attendance().v1().userStatsView().query(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserTaskRemedySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserTaskRemedySample.java index 03a716ba6..d3890cdac 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserTaskRemedySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserTaskRemedySample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - QueryUserTaskRemedyResp resp = client.attendance().userTaskRemedy().query(req); + QueryUserTaskRemedyResp resp = client.attendance().v1().userTaskRemedy().query(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserTaskSample.java index 07af53736..e38536bff 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserTaskSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/QueryUserTaskSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - QueryUserTaskResp resp = client.attendance().userTask().query(req); + QueryUserTaskResp resp = client.attendance().v1().userTask().query(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/SearchGroupSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/SearchGroupSample.java index d41e8988c..585271452 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/SearchGroupSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/SearchGroupSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SearchGroupResp resp = client.attendance().group().search(req); + SearchGroupResp resp = client.attendance().v1().group().search(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/UpdateUserStatsViewSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/UpdateUserStatsViewSample.java index c5d8fd114..24068133d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/UpdateUserStatsViewSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/UpdateUserStatsViewSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateUserStatsViewResp resp = client.attendance().userStatsView().update(req); + UpdateUserStatsViewResp resp = client.attendance().v1().userStatsView().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/UploadFileSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/UploadFileSample.java index f83f1a326..27b27ec53 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/UploadFileSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/attendancev1/UploadFileSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UploadFileResp resp = client.attendance().file().upload(req); + UploadFileResp resp = client.attendance().v1().file().upload(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateAccessTokenSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateAccessTokenSample.java index a126e0339..359cc2e92 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateAccessTokenSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateAccessTokenSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateAccessTokenResp resp = client.authen().accessToken().create(req); + CreateAccessTokenResp resp = client.authen().v1().accessToken().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateOidcAccessTokenSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateOidcAccessTokenSample.java index 0fc68f860..d009923c4 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateOidcAccessTokenSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateOidcAccessTokenSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateOidcAccessTokenResp resp = client.authen().oidcAccessToken().create(req); + CreateOidcAccessTokenResp resp = client.authen().v1().oidcAccessToken().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateOidcRefreshAccessTokenSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateOidcRefreshAccessTokenSample.java index 4e841ffe1..4883856ca 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateOidcRefreshAccessTokenSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateOidcRefreshAccessTokenSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateOidcRefreshAccessTokenResp resp = client.authen().oidcRefreshAccessToken().create(req); + CreateOidcRefreshAccessTokenResp resp = client.authen().v1().oidcRefreshAccessToken().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateRefreshAccessTokenSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateRefreshAccessTokenSample.java index a1180540a..03c07ef63 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateRefreshAccessTokenSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/CreateRefreshAccessTokenSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateRefreshAccessTokenResp resp = client.authen().refreshAccessToken().create(req); + CreateRefreshAccessTokenResp resp = client.authen().v1().refreshAccessToken().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/CreateAppAccessTokenSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/CreateAppAccessTokenSample.java index 813aa8d2c..4e22c29d7 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/CreateAppAccessTokenSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/CreateAppAccessTokenSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateAppAccessTokenResp resp = client.auth().appAccessToken().create(req); + CreateAppAccessTokenResp resp = client.auth().v3().appAccessToken().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/CreateTenantAccessTokenSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/CreateTenantAccessTokenSample.java index c21a0cb3c..ad9a5eedc 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/CreateTenantAccessTokenSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/CreateTenantAccessTokenSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateTenantAccessTokenResp resp = client.auth().tenantAccessToken().create(req); + CreateTenantAccessTokenResp resp = client.auth().v3().tenantAccessToken().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/InternalAppAccessTokenSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/InternalAppAccessTokenSample.java index 3c3e2b2de..06a6804b3 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/InternalAppAccessTokenSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/InternalAppAccessTokenSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - InternalAppAccessTokenResp resp = client.auth().appAccessToken().internal(req); + InternalAppAccessTokenResp resp = client.auth().v3().appAccessToken().internal(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/InternalTenantAccessTokenSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/InternalTenantAccessTokenSample.java index 3376d9ba0..8c8e096ec 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/InternalTenantAccessTokenSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/InternalTenantAccessTokenSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - InternalTenantAccessTokenResp resp = client.auth().tenantAccessToken().internal(req); + InternalTenantAccessTokenResp resp = client.auth().v3().tenantAccessToken().internal(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/ResendAppTicketSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/ResendAppTicketSample.java index 92a1abcec..9eeda01b4 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/ResendAppTicketSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/authv3/ResendAppTicketSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ResendAppTicketResp resp = client.auth().appTicket().resend(req); + ResendAppTicketResp resp = client.auth().v3().appTicket().resend(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/CreateDraftSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/CreateDraftSample.java index e62fb4963..370bddc67 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/CreateDraftSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/CreateDraftSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateDraftResp resp = client.baike().draft().create(req); + CreateDraftResp resp = client.baike().v1().draft().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/CreateEntitySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/CreateEntitySample.java index 4612088d7..97a464f1d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/CreateEntitySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/CreateEntitySample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateEntityResp resp = client.baike().entity().create(req); + CreateEntityResp resp = client.baike().v1().entity().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/DownloadFileSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/DownloadFileSample.java index 496301903..c53775e7a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/DownloadFileSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/DownloadFileSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DownloadFileResp resp = client.baike().file().download(req); + DownloadFileResp resp = client.baike().v1().file().download(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/ExtractEntitySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/ExtractEntitySample.java index 5be03b522..2bd40fd8b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/ExtractEntitySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/ExtractEntitySample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ExtractEntityResp resp = client.baike().entity().extract(req); + ExtractEntityResp resp = client.baike().v1().entity().extract(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/GetEntitySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/GetEntitySample.java index 2c4c25f1a..5d41cd36c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/GetEntitySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/GetEntitySample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetEntityResp resp = client.baike().entity().get(req); + GetEntityResp resp = client.baike().v1().entity().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/HighlightEntitySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/HighlightEntitySample.java index 4841533c0..c9c80ea72 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/HighlightEntitySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/HighlightEntitySample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - HighlightEntityResp resp = client.baike().entity().highlight(req); + HighlightEntityResp resp = client.baike().v1().entity().highlight(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/ListClassificationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/ListClassificationSample.java index ec0eb3aed..ffa8589d5 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/ListClassificationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/ListClassificationSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListClassificationResp resp = client.baike().classification().list(req); + ListClassificationResp resp = client.baike().v1().classification().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/ListEntitySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/ListEntitySample.java index 7de767103..5485f1bf1 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/ListEntitySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/ListEntitySample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListEntityResp resp = client.baike().entity().list(req); + ListEntityResp resp = client.baike().v1().entity().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/MatchEntitySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/MatchEntitySample.java index dedea8a94..6bfb75759 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/MatchEntitySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/MatchEntitySample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - MatchEntityResp resp = client.baike().entity().match(req); + MatchEntityResp resp = client.baike().v1().entity().match(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/SearchEntitySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/SearchEntitySample.java index a7154a808..f2c48bf6d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/SearchEntitySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/SearchEntitySample.java @@ -28,7 +28,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SearchEntityResp resp = client.baike().entity().search(req); + SearchEntityResp resp = client.baike().v1().entity().search(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/UpdateDraftSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/UpdateDraftSample.java index 73eaaec55..d15558bcd 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/UpdateDraftSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/UpdateDraftSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateDraftResp resp = client.baike().draft().update(req); + UpdateDraftResp resp = client.baike().v1().draft().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/UpdateEntitySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/UpdateEntitySample.java index 3b564c2d8..7f2639f40 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/UpdateEntitySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/UpdateEntitySample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateEntityResp resp = client.baike().entity().update(req); + UpdateEntityResp resp = client.baike().v1().entity().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/UploadFileSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/UploadFileSample.java index ac503cddf..51fff1b3e 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/UploadFileSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/baikev1/UploadFileSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UploadFileResp resp = client.baike().file().upload(req); + UploadFileResp resp = client.baike().v1().file().upload(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchCreateAppRoleMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchCreateAppRoleMemberSample.java index 5dc2f042a..820656295 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchCreateAppRoleMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchCreateAppRoleMemberSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchCreateAppRoleMemberResp resp = client.bitable().appRoleMember().batchCreate(req); + BatchCreateAppRoleMemberResp resp = client.bitable().v1().appRoleMember().batchCreate(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchCreateAppTableRecordSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchCreateAppTableRecordSample.java index 8754aff25..5ab661e8e 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchCreateAppTableRecordSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchCreateAppTableRecordSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchCreateAppTableRecordResp resp = client.bitable().appTableRecord().batchCreate(req); + BatchCreateAppTableRecordResp resp = client.bitable().v1().appTableRecord().batchCreate(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchCreateAppTableSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchCreateAppTableSample.java index 0fb358653..ab441a84c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchCreateAppTableSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchCreateAppTableSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchCreateAppTableResp resp = client.bitable().appTable().batchCreate(req); + BatchCreateAppTableResp resp = client.bitable().v1().appTable().batchCreate(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchDeleteAppRoleMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchDeleteAppRoleMemberSample.java index a63128356..5ea342567 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchDeleteAppRoleMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchDeleteAppRoleMemberSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchDeleteAppRoleMemberResp resp = client.bitable().appRoleMember().batchDelete(req); + BatchDeleteAppRoleMemberResp resp = client.bitable().v1().appRoleMember().batchDelete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchDeleteAppTableRecordSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchDeleteAppTableRecordSample.java index 8a46f3d85..05306cc41 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchDeleteAppTableRecordSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchDeleteAppTableRecordSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchDeleteAppTableRecordResp resp = client.bitable().appTableRecord().batchDelete(req); + BatchDeleteAppTableRecordResp resp = client.bitable().v1().appTableRecord().batchDelete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchDeleteAppTableSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchDeleteAppTableSample.java index beaeda912..5c691df95 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchDeleteAppTableSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchDeleteAppTableSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchDeleteAppTableResp resp = client.bitable().appTable().batchDelete(req); + BatchDeleteAppTableResp resp = client.bitable().v1().appTable().batchDelete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchUpdateAppTableRecordSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchUpdateAppTableRecordSample.java index 5bb80bf1d..02e2065c4 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchUpdateAppTableRecordSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/BatchUpdateAppTableRecordSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchUpdateAppTableRecordResp resp = client.bitable().appTableRecord().batchUpdate(req); + BatchUpdateAppTableRecordResp resp = client.bitable().v1().appTableRecord().batchUpdate(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CopyAppDashboardSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CopyAppDashboardSample.java index 1f798f63b..37a784d92 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CopyAppDashboardSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CopyAppDashboardSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CopyAppDashboardResp resp = client.bitable().appDashboard().copy(req); + CopyAppDashboardResp resp = client.bitable().v1().appDashboard().copy(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CopyAppSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CopyAppSample.java index c5427c829..df61fdcc7 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CopyAppSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CopyAppSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CopyAppResp resp = client.bitable().app().copy(req); + CopyAppResp resp = client.bitable().v1().app().copy(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppRoleMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppRoleMemberSample.java index 0773aa8d5..1a5d335ff 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppRoleMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppRoleMemberSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateAppRoleMemberResp resp = client.bitable().appRoleMember().create(req); + CreateAppRoleMemberResp resp = client.bitable().v1().appRoleMember().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppRoleSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppRoleSample.java index 53c102d81..beba34edd 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppRoleSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppRoleSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateAppRoleResp resp = client.bitable().appRole().create(req); + CreateAppRoleResp resp = client.bitable().v1().appRole().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppSample.java index 7f8424364..9b8433274 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateAppResp resp = client.bitable().app().create(req); + CreateAppResp resp = client.bitable().v1().app().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableFieldSample.java index de9b44ee2..bcaabede6 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableFieldSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableFieldSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateAppTableFieldResp resp = client.bitable().appTableField().create(req); + CreateAppTableFieldResp resp = client.bitable().v1().appTableField().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableRecordSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableRecordSample.java index cbefd176c..8d36a048c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableRecordSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableRecordSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateAppTableRecordResp resp = client.bitable().appTableRecord().create(req); + CreateAppTableRecordResp resp = client.bitable().v1().appTableRecord().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableSample.java index 2024b1d1f..e65c05b24 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateAppTableResp resp = client.bitable().appTable().create(req); + CreateAppTableResp resp = client.bitable().v1().appTable().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableViewSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableViewSample.java index bd274b147..d865cbf52 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableViewSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/CreateAppTableViewSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateAppTableViewResp resp = client.bitable().appTableView().create(req); + CreateAppTableViewResp resp = client.bitable().v1().appTableView().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppRoleMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppRoleMemberSample.java index 81cace92c..51b1ff6b8 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppRoleMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppRoleMemberSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteAppRoleMemberResp resp = client.bitable().appRoleMember().delete(req); + DeleteAppRoleMemberResp resp = client.bitable().v1().appRoleMember().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppRoleSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppRoleSample.java index ce365e42c..88917bbf8 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppRoleSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppRoleSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteAppRoleResp resp = client.bitable().appRole().delete(req); + DeleteAppRoleResp resp = client.bitable().v1().appRole().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableFieldSample.java index b3cf94b1c..aada91fe0 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableFieldSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableFieldSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteAppTableFieldResp resp = client.bitable().appTableField().delete(req); + DeleteAppTableFieldResp resp = client.bitable().v1().appTableField().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableRecordSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableRecordSample.java index 37d4da8b2..2c24a53db 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableRecordSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableRecordSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteAppTableRecordResp resp = client.bitable().appTableRecord().delete(req); + DeleteAppTableRecordResp resp = client.bitable().v1().appTableRecord().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableSample.java index 28eb28db2..db7dbd4ff 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteAppTableResp resp = client.bitable().appTable().delete(req); + DeleteAppTableResp resp = client.bitable().v1().appTable().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableViewSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableViewSample.java index 8ef1ffeec..44a67736f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableViewSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/DeleteAppTableViewSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteAppTableViewResp resp = client.bitable().appTableView().delete(req); + DeleteAppTableViewResp resp = client.bitable().v1().appTableView().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppSample.java index 03e654ae7..f24818395 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetAppResp resp = client.bitable().app().get(req); + GetAppResp resp = client.bitable().v1().app().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppTableFormSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppTableFormSample.java index 16b0ad601..14bb3ed01 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppTableFormSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppTableFormSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetAppTableFormResp resp = client.bitable().appTableForm().get(req); + GetAppTableFormResp resp = client.bitable().v1().appTableForm().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppTableRecordSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppTableRecordSample.java index 95eda735c..e05318a67 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppTableRecordSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppTableRecordSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetAppTableRecordResp resp = client.bitable().appTableRecord().get(req); + GetAppTableRecordResp resp = client.bitable().v1().appTableRecord().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppTableViewSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppTableViewSample.java index 2b167fb97..2c6ac10df 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppTableViewSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/GetAppTableViewSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetAppTableViewResp resp = client.bitable().appTableView().get(req); + GetAppTableViewResp resp = client.bitable().v1().appTableView().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppDashboardSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppDashboardSample.java index e6afc159f..2b95a0ce4 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppDashboardSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppDashboardSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListAppDashboardResp resp = client.bitable().appDashboard().list(req); + ListAppDashboardResp resp = client.bitable().v1().appDashboard().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppRoleMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppRoleMemberSample.java index 64c0fdc75..b72fed866 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppRoleMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppRoleMemberSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListAppRoleMemberResp resp = client.bitable().appRoleMember().list(req); + ListAppRoleMemberResp resp = client.bitable().v1().appRoleMember().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppRoleSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppRoleSample.java index 01a4522c4..5a9874639 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppRoleSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppRoleSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListAppRoleResp resp = client.bitable().appRole().list(req); + ListAppRoleResp resp = client.bitable().v1().appRole().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableFieldSample.java index 7bd1140d3..2448c6ee3 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableFieldSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableFieldSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListAppTableFieldResp resp = client.bitable().appTableField().list(req); + ListAppTableFieldResp resp = client.bitable().v1().appTableField().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableFormFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableFormFieldSample.java index ddbd57dec..89f5bc056 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableFormFieldSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableFormFieldSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListAppTableFormFieldResp resp = client.bitable().appTableFormField().list(req); + ListAppTableFormFieldResp resp = client.bitable().v1().appTableFormField().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableRecordSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableRecordSample.java index b521f74aa..b510d9564 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableRecordSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableRecordSample.java @@ -29,7 +29,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListAppTableRecordResp resp = client.bitable().appTableRecord().list(req); + ListAppTableRecordResp resp = client.bitable().v1().appTableRecord().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableSample.java index 57af70f95..20ce8fc03 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListAppTableResp resp = client.bitable().appTable().list(req); + ListAppTableResp resp = client.bitable().v1().appTable().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableViewSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableViewSample.java index 5876b5e88..77cf8de69 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableViewSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableViewSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListAppTableViewResp resp = client.bitable().appTableView().list(req); + ListAppTableViewResp resp = client.bitable().v1().appTableView().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableFormFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableFormFieldSample.java index 97ae876c1..cf285751a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableFormFieldSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableFormFieldSample.java @@ -29,7 +29,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchAppTableFormFieldResp resp = client.bitable().appTableFormField().patch(req); + PatchAppTableFormFieldResp resp = client.bitable().v1().appTableFormField().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableFormSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableFormSample.java index 5fcf6cdb1..a252c51eb 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableFormSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableFormSample.java @@ -28,7 +28,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchAppTableFormResp resp = client.bitable().appTableForm().patch(req); + PatchAppTableFormResp resp = client.bitable().v1().appTableForm().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableSample.java index 0afe25ab5..cb5b0d723 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchAppTableResp resp = client.bitable().appTable().patch(req); + PatchAppTableResp resp = client.bitable().v1().appTable().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableViewSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableViewSample.java index 29a9c889c..76d10d599 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableViewSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/PatchAppTableViewSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchAppTableViewResp resp = client.bitable().appTableView().patch(req); + PatchAppTableViewResp resp = client.bitable().v1().appTableView().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppRoleSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppRoleSample.java index 4c873f619..4bfcb3b3d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppRoleSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppRoleSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateAppRoleResp resp = client.bitable().appRole().update(req); + UpdateAppRoleResp resp = client.bitable().v1().appRole().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppSample.java index 636fcd126..a40598b7b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateAppResp resp = client.bitable().app().update(req); + UpdateAppResp resp = client.bitable().v1().app().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppTableFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppTableFieldSample.java index 6a2f40eaf..c408bb81a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppTableFieldSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppTableFieldSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateAppTableFieldResp resp = client.bitable().appTableField().update(req); + UpdateAppTableFieldResp resp = client.bitable().v1().appTableField().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppTableRecordSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppTableRecordSample.java index 89c3b2431..4e40db3f7 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppTableRecordSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/UpdateAppTableRecordSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateAppTableRecordResp resp = client.bitable().appTableRecord().update(req); + UpdateAppTableRecordResp resp = client.bitable().v1().appTableRecord().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/blockv2/CreateEntitySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/blockv2/CreateEntitySample.java index b49694daa..13e2ca3ee 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/blockv2/CreateEntitySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/blockv2/CreateEntitySample.java @@ -32,7 +32,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateEntityResp resp = client.block().entity().create(req); + CreateEntityResp resp = client.block().v2().entity().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/blockv2/CreateMessageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/blockv2/CreateMessageSample.java index b96fc18b1..53a5dbf9f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/blockv2/CreateMessageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/blockv2/CreateMessageSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateMessageResp resp = client.block().message().create(req); + CreateMessageResp resp = client.block().v2().message().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/blockv2/UpdateEntitySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/blockv2/UpdateEntitySample.java index 1f0611a0c..486463494 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/blockv2/UpdateEntitySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/blockv2/UpdateEntitySample.java @@ -33,7 +33,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateEntityResp resp = client.block().entity().update(req); + UpdateEntityResp resp = client.block().v2().entity().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/BatchDeleteCalendarEventAttendeeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/BatchDeleteCalendarEventAttendeeSample.java index 8b8897226..ed146e976 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/BatchDeleteCalendarEventAttendeeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/BatchDeleteCalendarEventAttendeeSample.java @@ -29,7 +29,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchDeleteCalendarEventAttendeeResp resp = client.calendar().calendarEventAttendee().batchDelete(req); + BatchDeleteCalendarEventAttendeeResp resp = client.calendar().v4().calendarEventAttendee().batchDelete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarAclSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarAclSample.java index a14973bfc..350763958 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarAclSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarAclSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateCalendarAclResp resp = client.calendar().calendarAcl().create(req); + CreateCalendarAclResp resp = client.calendar().v4().calendarAcl().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarEventAttendeeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarEventAttendeeSample.java index c50d339af..f5b6908a4 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarEventAttendeeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarEventAttendeeSample.java @@ -29,7 +29,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateCalendarEventAttendeeResp resp = client.calendar().calendarEventAttendee().create(req); + CreateCalendarEventAttendeeResp resp = client.calendar().v4().calendarEventAttendee().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarEventMeetingChatSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarEventMeetingChatSample.java index 2a6f1569e..26c308d64 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarEventMeetingChatSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarEventMeetingChatSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateCalendarEventMeetingChatResp resp = client.calendar().calendarEventMeetingChat().create(req); + CreateCalendarEventMeetingChatResp resp = client.calendar().v4().calendarEventMeetingChat().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarEventSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarEventSample.java index 8959322f0..104b00a60 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarEventSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarEventSample.java @@ -35,7 +35,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateCalendarEventResp resp = client.calendar().calendarEvent().create(req); + CreateCalendarEventResp resp = client.calendar().v4().calendarEvent().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarSample.java index 25ab6ad13..d92e259bf 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateCalendarSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateCalendarResp resp = client.calendar().calendar().create(req); + CreateCalendarResp resp = client.calendar().v4().calendar().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateExchangeBindingSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateExchangeBindingSample.java index 140556a3b..b8a74ab6e 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateExchangeBindingSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateExchangeBindingSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateExchangeBindingResp resp = client.calendar().exchangeBinding().create(req); + CreateExchangeBindingResp resp = client.calendar().v4().exchangeBinding().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateTimeoffEventSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateTimeoffEventSample.java index e0f278994..3805dc67e 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateTimeoffEventSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/CreateTimeoffEventSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateTimeoffEventResp resp = client.calendar().timeoffEvent().create(req); + CreateTimeoffEventResp resp = client.calendar().v4().timeoffEvent().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarAclSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarAclSample.java index 2c9752fe2..7094185a4 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarAclSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarAclSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteCalendarAclResp resp = client.calendar().calendarAcl().delete(req); + DeleteCalendarAclResp resp = client.calendar().v4().calendarAcl().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarEventMeetingChatSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarEventMeetingChatSample.java index bdf45013c..5471b60a0 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarEventMeetingChatSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarEventMeetingChatSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteCalendarEventMeetingChatResp resp = client.calendar().calendarEventMeetingChat().delete(req); + DeleteCalendarEventMeetingChatResp resp = client.calendar().v4().calendarEventMeetingChat().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarEventSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarEventSample.java index 040a84d5f..61916c530 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarEventSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarEventSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteCalendarEventResp resp = client.calendar().calendarEvent().delete(req); + DeleteCalendarEventResp resp = client.calendar().v4().calendarEvent().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarSample.java index e4cab1945..e4a66c4d8 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteCalendarSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteCalendarResp resp = client.calendar().calendar().delete(req); + DeleteCalendarResp resp = client.calendar().v4().calendar().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteExchangeBindingSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteExchangeBindingSample.java index 19e8462b6..56e668c08 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteExchangeBindingSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteExchangeBindingSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteExchangeBindingResp resp = client.calendar().exchangeBinding().delete(req); + DeleteExchangeBindingResp resp = client.calendar().v4().exchangeBinding().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteTimeoffEventSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteTimeoffEventSample.java index db69228d8..d2784123a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteTimeoffEventSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/DeleteTimeoffEventSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteTimeoffEventResp resp = client.calendar().timeoffEvent().delete(req); + DeleteTimeoffEventResp resp = client.calendar().v4().timeoffEvent().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GenerateCaldavConfSettingSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GenerateCaldavConfSettingSample.java index aeda6ca91..7b2dce795 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GenerateCaldavConfSettingSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GenerateCaldavConfSettingSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GenerateCaldavConfSettingResp resp = client.calendar().setting().generateCaldavConf(req); + GenerateCaldavConfSettingResp resp = client.calendar().v4().setting().generateCaldavConf(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GetCalendarEventSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GetCalendarEventSample.java index 07fb74dee..07ccb5816 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GetCalendarEventSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GetCalendarEventSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetCalendarEventResp resp = client.calendar().calendarEvent().get(req); + GetCalendarEventResp resp = client.calendar().v4().calendarEvent().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GetCalendarSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GetCalendarSample.java index 2c750b0ba..90699723f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GetCalendarSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GetCalendarSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetCalendarResp resp = client.calendar().calendar().get(req); + GetCalendarResp resp = client.calendar().v4().calendar().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GetExchangeBindingSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GetExchangeBindingSample.java index a4d358ab1..ab7520b40 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GetExchangeBindingSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/GetExchangeBindingSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetExchangeBindingResp resp = client.calendar().exchangeBinding().get(req); + GetExchangeBindingResp resp = client.calendar().v4().exchangeBinding().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarAclSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarAclSample.java index 517b38249..7621b0f59 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarAclSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarAclSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListCalendarAclResp resp = client.calendar().calendarAcl().list(req); + ListCalendarAclResp resp = client.calendar().v4().calendarAcl().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarEventAttendeeChatMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarEventAttendeeChatMemberSample.java index 6e8871a6e..b75fbd5f6 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarEventAttendeeChatMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarEventAttendeeChatMemberSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListCalendarEventAttendeeChatMemberResp resp = client.calendar().calendarEventAttendeeChatMember().list(req); + ListCalendarEventAttendeeChatMemberResp resp = client.calendar().v4().calendarEventAttendeeChatMember().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarEventAttendeeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarEventAttendeeSample.java index 8932d10e6..55c5b72b4 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarEventAttendeeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarEventAttendeeSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListCalendarEventAttendeeResp resp = client.calendar().calendarEventAttendee().list(req); + ListCalendarEventAttendeeResp resp = client.calendar().v4().calendarEventAttendee().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarEventSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarEventSample.java index 4c5d0fa4b..b77d55409 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarEventSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarEventSample.java @@ -21,10 +21,11 @@ public static void main(String arg[]) throws Exception { .syncToken("ListCalendarsSyncToken_1632452910") .startTime("1631777271") .endTime("1631777271") + .userIdType("user_id") .build(); // 发起请求 - ListCalendarEventResp resp = client.calendar().calendarEvent().list(req); + ListCalendarEventResp resp = client.calendar().v4().calendarEvent().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarSample.java index 776d22d60..d959c2e74 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListCalendarSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListCalendarResp resp = client.calendar().calendar().list(req); + ListCalendarResp resp = client.calendar().v4().calendar().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListFreebusySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListFreebusySample.java index 182cb1fe3..112159d18 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListFreebusySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/ListFreebusySample.java @@ -21,11 +21,13 @@ public static void main(String arg[]) throws Exception { .timeMax("2020-12-28T12:00:00+08:00") .userId("ou_xxxxxxxxxx") .roomId("omm_xxxxxxxxxx") + .includeExternalCalendar(true) + .onlyBusy(true) .build()) .build(); // 发起请求 - ListFreebusyResp resp = client.calendar().freebusy().list(req); + ListFreebusyResp resp = client.calendar().v4().freebusy().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/PatchCalendarEventSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/PatchCalendarEventSample.java index d22215d24..bb1cb8ebe 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/PatchCalendarEventSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/PatchCalendarEventSample.java @@ -35,7 +35,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchCalendarEventResp resp = client.calendar().calendarEvent().patch(req); + PatchCalendarEventResp resp = client.calendar().v4().calendarEvent().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/PatchCalendarSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/PatchCalendarSample.java index 523d50ca5..41dc97d26 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/PatchCalendarSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/PatchCalendarSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchCalendarResp resp = client.calendar().calendar().patch(req); + PatchCalendarResp resp = client.calendar().v4().calendar().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/PrimaryCalendarSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/PrimaryCalendarSample.java index 49239e8bb..2645e1e9d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/PrimaryCalendarSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/PrimaryCalendarSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PrimaryCalendarResp resp = client.calendar().calendar().primary(req); + PrimaryCalendarResp resp = client.calendar().v4().calendar().primary(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SearchCalendarEventSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SearchCalendarEventSample.java index e42068a82..52e283770 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SearchCalendarEventSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SearchCalendarEventSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SearchCalendarEventResp resp = client.calendar().calendarEvent().search(req); + SearchCalendarEventResp resp = client.calendar().v4().calendarEvent().search(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SearchCalendarSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SearchCalendarSample.java index ce272071b..e59b53496 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SearchCalendarSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SearchCalendarSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SearchCalendarResp resp = client.calendar().calendar().search(req); + SearchCalendarResp resp = client.calendar().v4().calendar().search(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscribeCalendarSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscribeCalendarSample.java index 6b389164f..7b535be89 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscribeCalendarSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscribeCalendarSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SubscribeCalendarResp resp = client.calendar().calendar().subscribe(req); + SubscribeCalendarResp resp = client.calendar().v4().calendar().subscribe(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscriptionCalendarAclSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscriptionCalendarAclSample.java index bf6c3a563..34f3edb89 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscriptionCalendarAclSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscriptionCalendarAclSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SubscriptionCalendarAclResp resp = client.calendar().calendarAcl().subscription(req); + SubscriptionCalendarAclResp resp = client.calendar().v4().calendarAcl().subscription(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscriptionCalendarEventSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscriptionCalendarEventSample.java index cf7fcf5d2..49eb74e1e 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscriptionCalendarEventSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/SubscriptionCalendarEventSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SubscriptionCalendarEventResp resp = client.calendar().calendarEvent().subscription(req); + SubscriptionCalendarEventResp resp = client.calendar().v4().calendarEvent().subscription(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscribeCalendarSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscribeCalendarSample.java index 646a77cf8..d61c6b45e 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscribeCalendarSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscribeCalendarSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UnsubscribeCalendarResp resp = client.calendar().calendar().unsubscribe(req); + UnsubscribeCalendarResp resp = client.calendar().v4().calendar().unsubscribe(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscriptionCalendarAclSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscriptionCalendarAclSample.java index 3b8130c47..64f9e292b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscriptionCalendarAclSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscriptionCalendarAclSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UnsubscriptionCalendarAclResp resp = client.calendar().calendarAcl().unsubscription(req); + UnsubscriptionCalendarAclResp resp = client.calendar().v4().calendarAcl().unsubscription(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscriptionCalendarEventSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscriptionCalendarEventSample.java index 7090a02a5..5e5dc41ad 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscriptionCalendarEventSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/calendarv4/UnsubscriptionCalendarEventSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UnsubscriptionCalendarEventResp resp = client.calendar().calendarEvent().unsubscription(req); + UnsubscriptionCalendarEventResp resp = client.calendar().v4().calendarEvent().unsubscription(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/AddGroupMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/AddGroupMemberSample.java index 1537fee4a..3c70d9c11 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/AddGroupMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/AddGroupMemberSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - AddGroupMemberResp resp = client.contact().groupMember().add(req); + AddGroupMemberResp resp = client.contact().v3().groupMember().add(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchAddGroupMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchAddGroupMemberSample.java index 3bb7a3e59..d2cfe96c3 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchAddGroupMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchAddGroupMemberSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchAddGroupMemberResp resp = client.contact().groupMember().batchAdd(req); + BatchAddGroupMemberResp resp = client.contact().v3().groupMember().batchAdd(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchCreateFunctionalRoleMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchCreateFunctionalRoleMemberSample.java index 77211a8dc..5ad28fccc 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchCreateFunctionalRoleMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchCreateFunctionalRoleMemberSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchCreateFunctionalRoleMemberResp resp = client.contact().functionalRoleMember().batchCreate(req); + BatchCreateFunctionalRoleMemberResp resp = client.contact().v3().functionalRoleMember().batchCreate(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchDeleteFunctionalRoleMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchDeleteFunctionalRoleMemberSample.java index ee1109fb0..62b9df0fd 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchDeleteFunctionalRoleMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchDeleteFunctionalRoleMemberSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchDeleteFunctionalRoleMemberResp resp = client.contact().functionalRoleMember().batchDelete(req); + BatchDeleteFunctionalRoleMemberResp resp = client.contact().v3().functionalRoleMember().batchDelete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchDepartmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchDepartmentSample.java index 525ea0004..85d6e91ba 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchDepartmentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchDepartmentSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchDepartmentResp resp = client.contact().department().batch(req); + BatchDepartmentResp resp = client.contact().v3().department().batch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchGetIdUserSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchGetIdUserSample.java index 7a63bc2cd..21fcffea8 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchGetIdUserSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchGetIdUserSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchGetIdUserResp resp = client.contact().user().batchGetId(req); + BatchGetIdUserResp resp = client.contact().v3().user().batchGetId(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchRemoveGroupMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchRemoveGroupMemberSample.java index 815319a0f..98b8199b1 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchRemoveGroupMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchRemoveGroupMemberSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchRemoveGroupMemberResp resp = client.contact().groupMember().batchRemove(req); + BatchRemoveGroupMemberResp resp = client.contact().v3().groupMember().batchRemove(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchUserSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchUserSample.java index e51e1f6dc..f62ea7b91 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchUserSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchUserSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchUserResp resp = client.contact().user().batch(req); + BatchUserResp resp = client.contact().v3().user().batch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BindDepartmentUnitSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BindDepartmentUnitSample.java index 546282935..74afa8a43 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BindDepartmentUnitSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BindDepartmentUnitSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BindDepartmentUnitResp resp = client.contact().unit().bindDepartment(req); + BindDepartmentUnitResp resp = client.contact().v3().unit().bindDepartment(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ChildrenDepartmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ChildrenDepartmentSample.java index 9b5d5e158..80691c1e5 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ChildrenDepartmentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ChildrenDepartmentSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ChildrenDepartmentResp resp = client.contact().department().children(req); + ChildrenDepartmentResp resp = client.contact().v3().department().children(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateDepartmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateDepartmentSample.java index 6e1180195..d078048d4 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateDepartmentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateDepartmentSample.java @@ -32,7 +32,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateDepartmentResp resp = client.contact().department().create(req); + CreateDepartmentResp resp = client.contact().v3().department().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateEmployeeTypeEnumSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateEmployeeTypeEnumSample.java index 39a15e08e..8a488e57b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateEmployeeTypeEnumSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateEmployeeTypeEnumSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateEmployeeTypeEnumResp resp = client.contact().employeeTypeEnum().create(req); + CreateEmployeeTypeEnumResp resp = client.contact().v3().employeeTypeEnum().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateFunctionalRoleSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateFunctionalRoleSample.java index 4ff40d437..3389034d8 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateFunctionalRoleSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateFunctionalRoleSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateFunctionalRoleResp resp = client.contact().functionalRole().create(req); + CreateFunctionalRoleResp resp = client.contact().v3().functionalRole().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateGroupSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateGroupSample.java index ce9528482..39581c024 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateGroupSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateGroupSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateGroupResp resp = client.contact().group().create(req); + CreateGroupResp resp = client.contact().v3().group().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateJobFamilySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateJobFamilySample.java index 8c1632665..f2c0fc277 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateJobFamilySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateJobFamilySample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateJobFamilyResp resp = client.contact().jobFamily().create(req); + CreateJobFamilyResp resp = client.contact().v3().jobFamily().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateJobLevelSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateJobLevelSample.java index ad9bb3fc2..71f4d836f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateJobLevelSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateJobLevelSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateJobLevelResp resp = client.contact().jobLevel().create(req); + CreateJobLevelResp resp = client.contact().v3().jobLevel().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateUnitSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateUnitSample.java index d53551c43..2443039b2 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateUnitSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateUnitSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateUnitResp resp = client.contact().unit().create(req); + CreateUnitResp resp = client.contact().v3().unit().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateUserSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateUserSample.java index 2c933cc65..8eba64be6 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateUserSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateUserSample.java @@ -47,7 +47,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateUserResp resp = client.contact().user().create(req); + CreateUserResp resp = client.contact().v3().user().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteDepartmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteDepartmentSample.java index 03e445428..433ec5f7a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteDepartmentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteDepartmentSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteDepartmentResp resp = client.contact().department().delete(req); + DeleteDepartmentResp resp = client.contact().v3().department().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteEmployeeTypeEnumSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteEmployeeTypeEnumSample.java index 28b0bde9e..7be6dd407 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteEmployeeTypeEnumSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteEmployeeTypeEnumSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteEmployeeTypeEnumResp resp = client.contact().employeeTypeEnum().delete(req); + DeleteEmployeeTypeEnumResp resp = client.contact().v3().employeeTypeEnum().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteFunctionalRoleSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteFunctionalRoleSample.java index 28dcc1002..1a74c445b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteFunctionalRoleSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteFunctionalRoleSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteFunctionalRoleResp resp = client.contact().functionalRole().delete(req); + DeleteFunctionalRoleResp resp = client.contact().v3().functionalRole().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteGroupSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteGroupSample.java index 484bc09d1..3aef48d97 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteGroupSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteGroupSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteGroupResp resp = client.contact().group().delete(req); + DeleteGroupResp resp = client.contact().v3().group().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteJobFamilySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteJobFamilySample.java index 5abdad6d7..dd5ecc127 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteJobFamilySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteJobFamilySample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteJobFamilyResp resp = client.contact().jobFamily().delete(req); + DeleteJobFamilyResp resp = client.contact().v3().jobFamily().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteJobLevelSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteJobLevelSample.java index 0f8fb0b3a..f1cf6190b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteJobLevelSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteJobLevelSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteJobLevelResp resp = client.contact().jobLevel().delete(req); + DeleteJobLevelResp resp = client.contact().v3().jobLevel().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteUnitSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteUnitSample.java index 7094d69c6..67980beaa 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteUnitSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteUnitSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteUnitResp resp = client.contact().unit().delete(req); + DeleteUnitResp resp = client.contact().v3().unit().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteUserSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteUserSample.java index 62ec53165..299094614 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteUserSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteUserSample.java @@ -31,7 +31,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteUserResp resp = client.contact().user().delete(req); + DeleteUserResp resp = client.contact().v3().user().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/FindByDepartmentUserSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/FindByDepartmentUserSample.java index 338a2ed16..263f6e802 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/FindByDepartmentUserSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/FindByDepartmentUserSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - FindByDepartmentUserResp resp = client.contact().user().findByDepartment(req); + FindByDepartmentUserResp resp = client.contact().v3().user().findByDepartment(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetDepartmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetDepartmentSample.java index d09dd2516..c3749564d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetDepartmentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetDepartmentSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetDepartmentResp resp = client.contact().department().get(req); + GetDepartmentResp resp = client.contact().v3().department().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetFunctionalRoleMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetFunctionalRoleMemberSample.java index 21d71b0d1..336b9ed7b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetFunctionalRoleMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetFunctionalRoleMemberSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetFunctionalRoleMemberResp resp = client.contact().functionalRoleMember().get(req); + GetFunctionalRoleMemberResp resp = client.contact().v3().functionalRoleMember().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetGroupSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetGroupSample.java index 8a69fecf3..b235ae1c8 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetGroupSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetGroupSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetGroupResp resp = client.contact().group().get(req); + GetGroupResp resp = client.contact().v3().group().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetJobFamilySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetJobFamilySample.java index ecf974fb1..7491b4797 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetJobFamilySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetJobFamilySample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetJobFamilyResp resp = client.contact().jobFamily().get(req); + GetJobFamilyResp resp = client.contact().v3().jobFamily().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetJobLevelSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetJobLevelSample.java index 06de6c98c..7d6412e04 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetJobLevelSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetJobLevelSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetJobLevelResp resp = client.contact().jobLevel().get(req); + GetJobLevelResp resp = client.contact().v3().jobLevel().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetJobTitleSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetJobTitleSample.java index 816df44f0..ca58361fe 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetJobTitleSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetJobTitleSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetJobTitleResp resp = client.contact().jobTitle().get(req); + GetJobTitleResp resp = client.contact().v3().jobTitle().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetUnitSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetUnitSample.java index ac747fb87..7fb368a5a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetUnitSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetUnitSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetUnitResp resp = client.contact().unit().get(req); + GetUnitResp resp = client.contact().v3().unit().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetUserSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetUserSample.java index 88b406029..1ac8e72f5 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetUserSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetUserSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetUserResp resp = client.contact().user().get(req); + GetUserResp resp = client.contact().v3().user().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetWorkCitySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetWorkCitySample.java index bbf00bd9c..fd4316449 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetWorkCitySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetWorkCitySample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetWorkCityResp resp = client.contact().workCity().get(req); + GetWorkCityResp resp = client.contact().v3().workCity().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListCustomAttrSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListCustomAttrSample.java index fb56f3f9c..95b8982e7 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListCustomAttrSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListCustomAttrSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListCustomAttrResp resp = client.contact().customAttr().list(req); + ListCustomAttrResp resp = client.contact().v3().customAttr().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListDepartmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListDepartmentSample.java index 6955bc2cd..b255ce34b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListDepartmentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListDepartmentSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListDepartmentResp resp = client.contact().department().list(req); + ListDepartmentResp resp = client.contact().v3().department().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListDepartmentUnitSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListDepartmentUnitSample.java index 9627f7468..f3d8ffd65 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListDepartmentUnitSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListDepartmentUnitSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListDepartmentUnitResp resp = client.contact().unit().listDepartment(req); + ListDepartmentUnitResp resp = client.contact().v3().unit().listDepartment(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListEmployeeTypeEnumSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListEmployeeTypeEnumSample.java index 694323b87..043faf951 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListEmployeeTypeEnumSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListEmployeeTypeEnumSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListEmployeeTypeEnumResp resp = client.contact().employeeTypeEnum().list(req); + ListEmployeeTypeEnumResp resp = client.contact().v3().employeeTypeEnum().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListFunctionalRoleMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListFunctionalRoleMemberSample.java index 87155b2e0..3bb4666f9 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListFunctionalRoleMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListFunctionalRoleMemberSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListFunctionalRoleMemberResp resp = client.contact().functionalRoleMember().list(req); + ListFunctionalRoleMemberResp resp = client.contact().v3().functionalRoleMember().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListJobFamilySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListJobFamilySample.java index 172db85ea..1f6d315ac 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListJobFamilySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListJobFamilySample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListJobFamilyResp resp = client.contact().jobFamily().list(req); + ListJobFamilyResp resp = client.contact().v3().jobFamily().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListJobLevelSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListJobLevelSample.java index 2ca78579f..42052101d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListJobLevelSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListJobLevelSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListJobLevelResp resp = client.contact().jobLevel().list(req); + ListJobLevelResp resp = client.contact().v3().jobLevel().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListJobTitleSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListJobTitleSample.java index 49f5bbd53..d96a4d745 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListJobTitleSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListJobTitleSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListJobTitleResp resp = client.contact().jobTitle().list(req); + ListJobTitleResp resp = client.contact().v3().jobTitle().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListScopeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListScopeSample.java index 4e9cf7032..87d9fa98f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListScopeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListScopeSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListScopeResp resp = client.contact().scope().list(req); + ListScopeResp resp = client.contact().v3().scope().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListUnitSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListUnitSample.java index 5fcf29bea..f397260e2 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListUnitSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListUnitSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListUnitResp resp = client.contact().unit().list(req); + ListUnitResp resp = client.contact().v3().unit().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListUserSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListUserSample.java index 16eb437f8..bbb50a463 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListUserSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListUserSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListUserResp resp = client.contact().user().list(req); + ListUserResp resp = client.contact().v3().user().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListWorkCitySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListWorkCitySample.java index f31e9ffb9..cdbf5c9d5 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListWorkCitySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListWorkCitySample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListWorkCityResp resp = client.contact().workCity().list(req); + ListWorkCityResp resp = client.contact().v3().workCity().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/MemberBelongGroupSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/MemberBelongGroupSample.java index 8ee20d716..571bfd425 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/MemberBelongGroupSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/MemberBelongGroupSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - MemberBelongGroupResp resp = client.contact().group().memberBelong(req); + MemberBelongGroupResp resp = client.contact().v3().group().memberBelong(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ParentDepartmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ParentDepartmentSample.java index 0ece5a884..9bc200bee 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ParentDepartmentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ParentDepartmentSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ParentDepartmentResp resp = client.contact().department().parent(req); + ParentDepartmentResp resp = client.contact().v3().department().parent(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchDepartmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchDepartmentSample.java index fc12a2db1..b4afe69ed 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchDepartmentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchDepartmentSample.java @@ -31,7 +31,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchDepartmentResp resp = client.contact().department().patch(req); + PatchDepartmentResp resp = client.contact().v3().department().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchGroupSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchGroupSample.java index edfeecde0..2eccb59ca 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchGroupSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchGroupSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchGroupResp resp = client.contact().group().patch(req); + PatchGroupResp resp = client.contact().v3().group().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchUnitSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchUnitSample.java index 74541a0d3..eafb55038 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchUnitSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchUnitSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchUnitResp resp = client.contact().unit().patch(req); + PatchUnitResp resp = client.contact().v3().unit().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchUserSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchUserSample.java index 8f41d9e23..6f3e05195 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchUserSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchUserSample.java @@ -46,7 +46,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchUserResp resp = client.contact().user().patch(req); + PatchUserResp resp = client.contact().v3().user().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/RemoveGroupMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/RemoveGroupMemberSample.java index c8e00d01d..24378fd34 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/RemoveGroupMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/RemoveGroupMemberSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - RemoveGroupMemberResp resp = client.contact().groupMember().remove(req); + RemoveGroupMemberResp resp = client.contact().v3().groupMember().remove(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ResurrectUserSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ResurrectUserSample.java index a568bcbd9..a1c91da73 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ResurrectUserSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ResurrectUserSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ResurrectUserResp resp = client.contact().user().resurrect(req); + ResurrectUserResp resp = client.contact().v3().user().resurrect(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ScopesFunctionalRoleMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ScopesFunctionalRoleMemberSample.java index e967e01c7..d5fff0237 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ScopesFunctionalRoleMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ScopesFunctionalRoleMemberSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ScopesFunctionalRoleMemberResp resp = client.contact().functionalRoleMember().scopes(req); + ScopesFunctionalRoleMemberResp resp = client.contact().v3().functionalRoleMember().scopes(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/SearchDepartmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/SearchDepartmentSample.java index 0f600a461..c0bb7392d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/SearchDepartmentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/SearchDepartmentSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SearchDepartmentResp resp = client.contact().department().search(req); + SearchDepartmentResp resp = client.contact().v3().department().search(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/SimplelistGroupMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/SimplelistGroupMemberSample.java index 2bfcb0086..57da1369a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/SimplelistGroupMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/SimplelistGroupMemberSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SimplelistGroupMemberResp resp = client.contact().groupMember().simplelist(req); + SimplelistGroupMemberResp resp = client.contact().v3().groupMember().simplelist(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/SimplelistGroupSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/SimplelistGroupSample.java index 90e47178d..c34e5ce39 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/SimplelistGroupSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/SimplelistGroupSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SimplelistGroupResp resp = client.contact().group().simplelist(req); + SimplelistGroupResp resp = client.contact().v3().group().simplelist(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UnbindDepartmentChatDepartmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UnbindDepartmentChatDepartmentSample.java index 1e721731e..a05a29d91 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UnbindDepartmentChatDepartmentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UnbindDepartmentChatDepartmentSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UnbindDepartmentChatDepartmentResp resp = client.contact().department().unbindDepartmentChat(req); + UnbindDepartmentChatDepartmentResp resp = client.contact().v3().department().unbindDepartmentChat(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UnbindDepartmentUnitSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UnbindDepartmentUnitSample.java index 9171ea080..20d00792f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UnbindDepartmentUnitSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UnbindDepartmentUnitSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UnbindDepartmentUnitResp resp = client.contact().unit().unbindDepartment(req); + UnbindDepartmentUnitResp resp = client.contact().v3().unit().unbindDepartment(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateDepartmentIdDepartmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateDepartmentIdDepartmentSample.java index 695b052a7..3f8813aca 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateDepartmentIdDepartmentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateDepartmentIdDepartmentSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateDepartmentIdDepartmentResp resp = client.contact().department().updateDepartmentId(req); + UpdateDepartmentIdDepartmentResp resp = client.contact().v3().department().updateDepartmentId(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateDepartmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateDepartmentSample.java index 387b94f3c..f965a5c7b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateDepartmentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateDepartmentSample.java @@ -30,7 +30,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateDepartmentResp resp = client.contact().department().update(req); + UpdateDepartmentResp resp = client.contact().v3().department().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateEmployeeTypeEnumSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateEmployeeTypeEnumSample.java index 9125de7ca..2c2071d17 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateEmployeeTypeEnumSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateEmployeeTypeEnumSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateEmployeeTypeEnumResp resp = client.contact().employeeTypeEnum().update(req); + UpdateEmployeeTypeEnumResp resp = client.contact().v3().employeeTypeEnum().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateFunctionalRoleSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateFunctionalRoleSample.java index 8e04fc719..9e9a7551d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateFunctionalRoleSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateFunctionalRoleSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateFunctionalRoleResp resp = client.contact().functionalRole().update(req); + UpdateFunctionalRoleResp resp = client.contact().v3().functionalRole().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateJobFamilySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateJobFamilySample.java index 65fcfb55e..db67dc186 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateJobFamilySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateJobFamilySample.java @@ -28,7 +28,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateJobFamilyResp resp = client.contact().jobFamily().update(req); + UpdateJobFamilyResp resp = client.contact().v3().jobFamily().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateJobLevelSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateJobLevelSample.java index aa869e6c8..955ca738d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateJobLevelSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateJobLevelSample.java @@ -28,7 +28,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateJobLevelResp resp = client.contact().jobLevel().update(req); + UpdateJobLevelResp resp = client.contact().v3().jobLevel().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateUserIdUserSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateUserIdUserSample.java index 7a9bbc76c..216925c96 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateUserIdUserSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateUserIdUserSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateUserIdUserResp resp = client.contact().user().updateUserId(req); + UpdateUserIdUserResp resp = client.contact().v3().user().updateUserId(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateUserSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateUserSample.java index 98c5ab210..52676a7ba 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateUserSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateUserSample.java @@ -42,7 +42,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateUserResp resp = client.contact().user().update(req); + UpdateUserResp resp = client.contact().v3().user().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateCompanySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateCompanySample.java index b05be5a2a..f2769363f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateCompanySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateCompanySample.java @@ -2,8 +2,8 @@ import com.lark.oapi.Client; import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.service.corehr.v1.model.*; import com.lark.oapi.service.corehr.v1.model.Enum; +import com.lark.oapi.service.corehr.v1.model.*; // POST /open-apis/corehr/v1/companies public class CreateCompanySample { @@ -27,11 +27,14 @@ public static void main(String arg[]) throws Exception { .branchCompany(true) .primaryManager(new I18n[]{}) .customFields(new ObjectFieldData[]{}) + .currency(Currency.newBuilder().build()) + .phone(PhoneNumberAndAreaCode.newBuilder().build()) + .fax(PhoneNumberAndAreaCode.newBuilder().build()) .build()) .build(); // 发起请求 - CreateCompanyResp resp = client.corehr().company().create(req); + CreateCompanyResp resp = client.corehr().v1().company().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateContractSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateContractSample.java index 313df0941..454399a29 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateContractSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateContractSample.java @@ -5,7 +5,6 @@ import com.lark.oapi.service.corehr.v1.model.Enum; import com.lark.oapi.service.corehr.v1.model.*; - // POST /open-apis/corehr/v1/contracts public class CreateContractSample { @@ -32,7 +31,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateContractResp resp = client.corehr().contract().create(req); + CreateContractResp resp = client.corehr().v1().contract().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateDepartmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateDepartmentSample.java index a0a56285f..8c5ba3074 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateDepartmentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateDepartmentSample.java @@ -2,8 +2,8 @@ import com.lark.oapi.Client; import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.service.corehr.v1.model.*; import com.lark.oapi.service.corehr.v1.model.Enum; +import com.lark.oapi.service.corehr.v1.model.*; // POST /open-apis/corehr/v1/departments public class CreateDepartmentSample { @@ -29,7 +29,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateDepartmentResp resp = client.corehr().department().create(req); + CreateDepartmentResp resp = client.corehr().v1().department().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateEmployeeTypeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateEmployeeTypeSample.java index cb87b7b92..ad0373735 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateEmployeeTypeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateEmployeeTypeSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateEmployeeTypeResp resp = client.corehr().employeeType().create(req); + CreateEmployeeTypeResp resp = client.corehr().v1().employeeType().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateEmploymentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateEmploymentSample.java index a6d03e1c2..5f59402ba 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateEmploymentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateEmploymentSample.java @@ -2,8 +2,8 @@ import com.lark.oapi.Client; import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.service.corehr.v1.model.*; import com.lark.oapi.service.corehr.v1.model.Enum; +import com.lark.oapi.service.corehr.v1.model.*; // POST /open-apis/corehr/v1/employments public class CreateEmploymentSample { @@ -34,7 +34,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateEmploymentResp resp = client.corehr().employment().create(req); + CreateEmploymentResp resp = client.corehr().v1().employment().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobChangeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobChangeSample.java index 774a7498f..a6f4edb37 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobChangeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobChangeSample.java @@ -31,7 +31,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateJobChangeResp resp = client.corehr().jobChange().create(req); + CreateJobChangeResp resp = client.corehr().v1().jobChange().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobDataSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobDataSample.java index b20c2d98e..400c0e1ca 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobDataSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobDataSample.java @@ -2,8 +2,8 @@ import com.lark.oapi.Client; import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.service.corehr.v1.model.*; import com.lark.oapi.service.corehr.v1.model.Enum; +import com.lark.oapi.service.corehr.v1.model.*; // POST /open-apis/corehr/v1/job_datas public class CreateJobDataSample { @@ -43,7 +43,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateJobDataResp resp = client.corehr().jobData().create(req); + CreateJobDataResp resp = client.corehr().v1().jobData().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobFamilySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobFamilySample.java index d87e4c327..31b49799a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobFamilySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobFamilySample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateJobFamilyResp resp = client.corehr().jobFamily().create(req); + CreateJobFamilyResp resp = client.corehr().v1().jobFamily().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobLevelSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobLevelSample.java index 07b7209c2..5b58d65a2 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobLevelSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobLevelSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateJobLevelResp resp = client.corehr().jobLevel().create(req); + CreateJobLevelResp resp = client.corehr().v1().jobLevel().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobSample.java index 922087bc7..38bdad590 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateJobSample.java @@ -30,7 +30,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateJobResp resp = client.corehr().job().create(req); + CreateJobResp resp = client.corehr().v1().job().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateLeaveGrantingRecordSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateLeaveGrantingRecordSample.java index 66d971659..e8de7165a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateLeaveGrantingRecordSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateLeaveGrantingRecordSample.java @@ -30,7 +30,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateLeaveGrantingRecordResp resp = client.corehr().leaveGrantingRecord().create(req); + CreateLeaveGrantingRecordResp resp = client.corehr().v1().leaveGrantingRecord().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateLocationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateLocationSample.java index 84fa15815..4c55b56b3 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateLocationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateLocationSample.java @@ -2,8 +2,8 @@ import com.lark.oapi.Client; import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.service.corehr.v1.model.*; import com.lark.oapi.service.corehr.v1.model.Enum; +import com.lark.oapi.service.corehr.v1.model.*; // POST /open-apis/corehr/v1/locations public class CreateLocationSample { @@ -28,7 +28,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateLocationResp resp = client.corehr().location().create(req); + CreateLocationResp resp = client.corehr().v1().location().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateNationalIdTypeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateNationalIdTypeSample.java index 167c4763f..ac6d88c01 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateNationalIdTypeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateNationalIdTypeSample.java @@ -2,8 +2,8 @@ import com.lark.oapi.Client; import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.service.corehr.v1.model.*; import com.lark.oapi.service.corehr.v1.model.Enum; +import com.lark.oapi.service.corehr.v1.model.*; // POST /open-apis/corehr/v1/national_id_types public class CreateNationalIdTypeSample { @@ -28,7 +28,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateNationalIdTypeResp resp = client.corehr().nationalIdType().create(req); + CreateNationalIdTypeResp resp = client.corehr().v1().nationalIdType().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateWorkingHoursTypeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateWorkingHoursTypeSample.java index 42d72bb76..94570daaa 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateWorkingHoursTypeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/CreateWorkingHoursTypeSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateWorkingHoursTypeResp resp = client.corehr().workingHoursType().create(req); + CreateWorkingHoursTypeResp resp = client.corehr().v1().workingHoursType().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteCompanySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteCompanySample.java index 0a64044d2..183c8117d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteCompanySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteCompanySample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteCompanyResp resp = client.corehr().company().delete(req); + DeleteCompanyResp resp = client.corehr().v1().company().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteContractSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteContractSample.java index aaf90783c..29ab853e5 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteContractSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteContractSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteContractResp resp = client.corehr().contract().delete(req); + DeleteContractResp resp = client.corehr().v1().contract().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteDepartmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteDepartmentSample.java index 34ec64752..6db8958a9 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteDepartmentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteDepartmentSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteDepartmentResp resp = client.corehr().department().delete(req); + DeleteDepartmentResp resp = client.corehr().v1().department().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteEmployeeTypeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteEmployeeTypeSample.java index c3f5df4f3..3446ac294 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteEmployeeTypeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteEmployeeTypeSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteEmployeeTypeResp resp = client.corehr().employeeType().delete(req); + DeleteEmployeeTypeResp resp = client.corehr().v1().employeeType().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteEmploymentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteEmploymentSample.java index ae448ac21..8b1417721 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteEmploymentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteEmploymentSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteEmploymentResp resp = client.corehr().employment().delete(req); + DeleteEmploymentResp resp = client.corehr().v1().employment().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobDataSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobDataSample.java index ac2ec46fa..31d8c19fb 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobDataSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobDataSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteJobDataResp resp = client.corehr().jobData().delete(req); + DeleteJobDataResp resp = client.corehr().v1().jobData().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobFamilySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobFamilySample.java index e46aa6add..6d4a6407a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobFamilySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobFamilySample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteJobFamilyResp resp = client.corehr().jobFamily().delete(req); + DeleteJobFamilyResp resp = client.corehr().v1().jobFamily().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobLevelSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobLevelSample.java index b86888cb9..0fc8a610e 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobLevelSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobLevelSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteJobLevelResp resp = client.corehr().jobLevel().delete(req); + DeleteJobLevelResp resp = client.corehr().v1().jobLevel().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobSample.java index d835b4088..d6bace350 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteJobSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteJobResp resp = client.corehr().job().delete(req); + DeleteJobResp resp = client.corehr().v1().job().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteLeaveGrantingRecordSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteLeaveGrantingRecordSample.java index 0d3f57a2a..2bffecd8a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteLeaveGrantingRecordSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteLeaveGrantingRecordSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteLeaveGrantingRecordResp resp = client.corehr().leaveGrantingRecord().delete(req); + DeleteLeaveGrantingRecordResp resp = client.corehr().v1().leaveGrantingRecord().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteLocationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteLocationSample.java index 8fe2dfeec..2f8a33477 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteLocationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteLocationSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteLocationResp resp = client.corehr().location().delete(req); + DeleteLocationResp resp = client.corehr().v1().location().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteNationalIdTypeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteNationalIdTypeSample.java index 13df7f2ee..fe14b100c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteNationalIdTypeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteNationalIdTypeSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteNationalIdTypeResp resp = client.corehr().nationalIdType().delete(req); + DeleteNationalIdTypeResp resp = client.corehr().v1().nationalIdType().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeletePersonSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeletePersonSample.java index 6e9840e03..83c63dc6b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeletePersonSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeletePersonSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeletePersonResp resp = client.corehr().person().delete(req); + DeletePersonResp resp = client.corehr().v1().person().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeletePreHireSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeletePreHireSample.java index 127a56454..f2829516c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeletePreHireSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeletePreHireSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeletePreHireResp resp = client.corehr().preHire().delete(req); + DeletePreHireResp resp = client.corehr().v1().preHire().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteWorkingHoursTypeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteWorkingHoursTypeSample.java index a6fd6ea74..a9aa85371 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteWorkingHoursTypeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/DeleteWorkingHoursTypeSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteWorkingHoursTypeResp resp = client.corehr().workingHoursType().delete(req); + DeleteWorkingHoursTypeResp resp = client.corehr().v1().workingHoursType().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetByParamCustomFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetByParamCustomFieldSample.java index aea9351d5..da6762318 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetByParamCustomFieldSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetByParamCustomFieldSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetByParamCustomFieldResp resp = client.corehr().customField().getByParam(req); + GetByParamCustomFieldResp resp = client.corehr().v1().customField().getByParam(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetCompanySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetCompanySample.java index 54d2d6705..d7b76dafe 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetCompanySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetCompanySample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetCompanyResp resp = client.corehr().company().get(req); + GetCompanyResp resp = client.corehr().v1().company().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetContractSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetContractSample.java index d8d188eba..255f596ec 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetContractSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetContractSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetContractResp resp = client.corehr().contract().get(req); + GetContractResp resp = client.corehr().v1().contract().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetCountryRegionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetCountryRegionSample.java index 0db6f662c..52453c6b0 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetCountryRegionSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetCountryRegionSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetCountryRegionResp resp = client.corehr().countryRegion().get(req); + GetCountryRegionResp resp = client.corehr().v1().countryRegion().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetCurrencySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetCurrencySample.java index d65026637..56af9a64f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetCurrencySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetCurrencySample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetCurrencyResp resp = client.corehr().currency().get(req); + GetCurrencyResp resp = client.corehr().v1().currency().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetDepartmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetDepartmentSample.java index fda84583a..2b427bcb3 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetDepartmentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetDepartmentSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetDepartmentResp resp = client.corehr().department().get(req); + GetDepartmentResp resp = client.corehr().v1().department().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetEmployeeTypeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetEmployeeTypeSample.java index fc8f2a674..440a4218a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetEmployeeTypeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetEmployeeTypeSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetEmployeeTypeResp resp = client.corehr().employeeType().get(req); + GetEmployeeTypeResp resp = client.corehr().v1().employeeType().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetFileSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetFileSample.java index 29deb2377..5daeb9840 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetFileSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetFileSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetFileResp resp = client.corehr().file().get(req); + GetFileResp resp = client.corehr().v1().file().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobDataSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobDataSample.java index 4ab9fe6eb..c603e4772 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobDataSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobDataSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetJobDataResp resp = client.corehr().jobData().get(req); + GetJobDataResp resp = client.corehr().v1().jobData().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobFamilySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobFamilySample.java index 2bc58b219..5fb3519bf 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobFamilySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobFamilySample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetJobFamilyResp resp = client.corehr().jobFamily().get(req); + GetJobFamilyResp resp = client.corehr().v1().jobFamily().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobLevelSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobLevelSample.java index c7edef4e2..247e315a5 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobLevelSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobLevelSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetJobLevelResp resp = client.corehr().jobLevel().get(req); + GetJobLevelResp resp = client.corehr().v1().jobLevel().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobSample.java index bd653581d..7f5c3422c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetJobSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetJobResp resp = client.corehr().job().get(req); + GetJobResp resp = client.corehr().v1().job().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetLocationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetLocationSample.java index 780e0cb3e..411688217 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetLocationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetLocationSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetLocationResp resp = client.corehr().location().get(req); + GetLocationResp resp = client.corehr().v1().location().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetNationalIdTypeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetNationalIdTypeSample.java index 932f1b8da..8e8e18104 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetNationalIdTypeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetNationalIdTypeSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetNationalIdTypeResp resp = client.corehr().nationalIdType().get(req); + GetNationalIdTypeResp resp = client.corehr().v1().nationalIdType().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetPersonSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetPersonSample.java index 4164e7947..847482b74 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetPersonSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetPersonSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetPersonResp resp = client.corehr().person().get(req); + GetPersonResp resp = client.corehr().v1().person().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetPreHireSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetPreHireSample.java index 5c501c810..e3604eaa9 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetPreHireSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetPreHireSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetPreHireResp resp = client.corehr().preHire().get(req); + GetPreHireResp resp = client.corehr().v1().preHire().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetProcessFormVariableDataSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetProcessFormVariableDataSample.java index 451dbee6d..e4042b8ee 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetProcessFormVariableDataSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetProcessFormVariableDataSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetProcessFormVariableDataResp resp = client.corehr().processFormVariableData().get(req); + GetProcessFormVariableDataResp resp = client.corehr().v1().processFormVariableData().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetSubdivisionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetSubdivisionSample.java index 278bed5cb..4db4859ce 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetSubdivisionSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetSubdivisionSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetSubdivisionResp resp = client.corehr().subdivision().get(req); + GetSubdivisionResp resp = client.corehr().v1().subdivision().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetSubregionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetSubregionSample.java index d2748f994..a6e3e36d2 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetSubregionSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetSubregionSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetSubregionResp resp = client.corehr().subregion().get(req); + GetSubregionResp resp = client.corehr().v1().subregion().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetWorkingHoursTypeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetWorkingHoursTypeSample.java index 46cadc49c..85d3054bc 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetWorkingHoursTypeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/GetWorkingHoursTypeSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetWorkingHoursTypeResp resp = client.corehr().workingHoursType().get(req); + GetWorkingHoursTypeResp resp = client.corehr().v1().workingHoursType().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/LeaveBalancesLeaveSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/LeaveBalancesLeaveSample.java index 3bbef6f9f..dd5ccdfd6 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/LeaveBalancesLeaveSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/LeaveBalancesLeaveSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - LeaveBalancesLeaveResp resp = client.corehr().leave().leaveBalances(req); + LeaveBalancesLeaveResp resp = client.corehr().v1().leave().leaveBalances(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/LeaveRequestHistoryLeaveSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/LeaveRequestHistoryLeaveSample.java index 29fe8d9b3..79b655e8f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/LeaveRequestHistoryLeaveSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/LeaveRequestHistoryLeaveSample.java @@ -36,7 +36,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - LeaveRequestHistoryLeaveResp resp = client.corehr().leave().leaveRequestHistory(req); + LeaveRequestHistoryLeaveResp resp = client.corehr().v1().leave().leaveRequestHistory(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/LeaveTypesLeaveSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/LeaveTypesLeaveSample.java index f1c8dea1c..33824c94c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/LeaveTypesLeaveSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/LeaveTypesLeaveSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - LeaveTypesLeaveResp resp = client.corehr().leave().leaveTypes(req); + LeaveTypesLeaveResp resp = client.corehr().v1().leave().leaveTypes(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListCompanySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListCompanySample.java index 5c8f58819..6d8e53af5 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListCompanySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListCompanySample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListCompanyResp resp = client.corehr().company().list(req); + ListCompanyResp resp = client.corehr().v1().company().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListContractSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListContractSample.java index 2e69e4cb5..8ac2ff3ba 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListContractSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListContractSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListContractResp resp = client.corehr().contract().list(req); + ListContractResp resp = client.corehr().v1().contract().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListCountryRegionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListCountryRegionSample.java index bae123e40..e56e4a6ea 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListCountryRegionSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListCountryRegionSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListCountryRegionResp resp = client.corehr().countryRegion().list(req); + ListCountryRegionResp resp = client.corehr().v1().countryRegion().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListCurrencySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListCurrencySample.java index abfce5ac7..7ee2f489f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListCurrencySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListCurrencySample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListCurrencyResp resp = client.corehr().currency().list(req); + ListCurrencyResp resp = client.corehr().v1().currency().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListDepartmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListDepartmentSample.java index 43b38ca2c..7f7cfa4fe 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListDepartmentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListDepartmentSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListDepartmentResp resp = client.corehr().department().list(req); + ListDepartmentResp resp = client.corehr().v1().department().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListEmployeeTypeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListEmployeeTypeSample.java index 062b302f7..9e3e035fa 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListEmployeeTypeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListEmployeeTypeSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListEmployeeTypeResp resp = client.corehr().employeeType().list(req); + ListEmployeeTypeResp resp = client.corehr().v1().employeeType().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobDataSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobDataSample.java index 52f7c8e2b..7c5a0d88c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobDataSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobDataSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListJobDataResp resp = client.corehr().jobData().list(req); + ListJobDataResp resp = client.corehr().v1().jobData().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobFamilySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobFamilySample.java index 22fdca8c1..839a8d54f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobFamilySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobFamilySample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListJobFamilyResp resp = client.corehr().jobFamily().list(req); + ListJobFamilyResp resp = client.corehr().v1().jobFamily().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobLevelSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobLevelSample.java index 3958030ed..b24dde9f0 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobLevelSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobLevelSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListJobLevelResp resp = client.corehr().jobLevel().list(req); + ListJobLevelResp resp = client.corehr().v1().jobLevel().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobSample.java index 7137c6ef2..cdbb22cb5 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListJobSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListJobResp resp = client.corehr().job().list(req); + ListJobResp resp = client.corehr().v1().job().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListLocationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListLocationSample.java index d8a61e02f..402551dde 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListLocationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListLocationSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListLocationResp resp = client.corehr().location().list(req); + ListLocationResp resp = client.corehr().v1().location().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListNationalIdTypeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListNationalIdTypeSample.java index e52cc4d7e..1e2bcae37 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListNationalIdTypeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListNationalIdTypeSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListNationalIdTypeResp resp = client.corehr().nationalIdType().list(req); + ListNationalIdTypeResp resp = client.corehr().v1().nationalIdType().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListObjectApiNameCustomFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListObjectApiNameCustomFieldSample.java index 907056ef0..d5c4b0e8e 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListObjectApiNameCustomFieldSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListObjectApiNameCustomFieldSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListObjectApiNameCustomFieldResp resp = client.corehr().customField().listObjectApiName(req); + ListObjectApiNameCustomFieldResp resp = client.corehr().v1().customField().listObjectApiName(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListPreHireSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListPreHireSample.java index 23a00c919..2f4b74545 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListPreHireSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListPreHireSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListPreHireResp resp = client.corehr().preHire().list(req); + ListPreHireResp resp = client.corehr().v1().preHire().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListSecurityGroupSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListSecurityGroupSample.java index 3973151af..b0c461357 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListSecurityGroupSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListSecurityGroupSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListSecurityGroupResp resp = client.corehr().securityGroup().list(req); + ListSecurityGroupResp resp = client.corehr().v1().securityGroup().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListSubdivisionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListSubdivisionSample.java index 173870473..e7b173349 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListSubdivisionSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListSubdivisionSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListSubdivisionResp resp = client.corehr().subdivision().list(req); + ListSubdivisionResp resp = client.corehr().v1().subdivision().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListSubregionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListSubregionSample.java index d4e8619f0..b95be7fcc 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListSubregionSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListSubregionSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListSubregionResp resp = client.corehr().subregion().list(req); + ListSubregionResp resp = client.corehr().v1().subregion().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListWorkingHoursTypeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListWorkingHoursTypeSample.java index 95a4c2cc5..0f407fa7a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListWorkingHoursTypeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/ListWorkingHoursTypeSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListWorkingHoursTypeResp resp = client.corehr().workingHoursType().list(req); + ListWorkingHoursTypeResp resp = client.corehr().v1().workingHoursType().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/MatchCompensationStandardSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/MatchCompensationStandardSample.java index de5b5bae9..b24413020 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/MatchCompensationStandardSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/MatchCompensationStandardSample.java @@ -33,7 +33,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - MatchCompensationStandardResp resp = client.corehr().compensationStandard().match(req); + MatchCompensationStandardResp resp = client.corehr().v1().compensationStandard().match(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchCompanySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchCompanySample.java new file mode 100644 index 000000000..2691223d8 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchCompanySample.java @@ -0,0 +1,50 @@ +package com.lark.oapi.sample.apiall.corehrv1; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v1.model.Enum; +import com.lark.oapi.service.corehr.v1.model.*; + +// PATCH /open-apis/corehr/v1/companies/:company_id +public class PatchCompanySample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + PatchCompanyReq req = PatchCompanyReq.newBuilder() + .companyId("1616161616") + .clientToken("12454646") + .company(Company.newBuilder() + .hiberarchyCommon(HiberarchyCommon.newBuilder().build()) + .type(Enum.newBuilder().build()) + .industryList(new Enum[]{}) + .legalRepresentative(new I18n[]{}) + .postCode("邮编") + .taxPayerId("123456840") + .confidential(true) + .subTypeList(new Enum[]{}) + .branchCompany(true) + .primaryManager(new I18n[]{}) + .customFields(new ObjectFieldData[]{}) + .currency(Currency.newBuilder().build()) + .phone(PhoneNumberAndAreaCode.newBuilder().build()) + .fax(PhoneNumberAndAreaCode.newBuilder().build()) + .build()) + .build(); + + // 发起请求 + PatchCompanyResp resp = client.corehr().v1().company().patch(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchContractSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchContractSample.java index 1e2bf83b2..dffee3298 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchContractSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchContractSample.java @@ -2,12 +2,8 @@ import com.lark.oapi.Client; import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.service.corehr.v1.model.Contract; -import com.lark.oapi.service.corehr.v1.model.ObjectFieldData; -import com.lark.oapi.service.corehr.v1.model.PatchContractReq; -import com.lark.oapi.service.corehr.v1.model.PatchContractResp; import com.lark.oapi.service.corehr.v1.model.Enum; - +import com.lark.oapi.service.corehr.v1.model.*; // PATCH /open-apis/corehr/v1/contracts/:contract_id public class PatchContractSample { @@ -36,7 +32,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchContractResp resp = client.corehr().contract().patch(req); + PatchContractResp resp = client.corehr().v1().contract().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchDepartmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchDepartmentSample.java index 572c94cc8..b28812d96 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchDepartmentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchDepartmentSample.java @@ -2,8 +2,8 @@ import com.lark.oapi.Client; import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.service.corehr.v1.model.*; import com.lark.oapi.service.corehr.v1.model.Enum; +import com.lark.oapi.service.corehr.v1.model.*; // PATCH /open-apis/corehr/v1/departments/:department_id public class PatchDepartmentSample { @@ -31,7 +31,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchDepartmentResp resp = client.corehr().department().patch(req); + PatchDepartmentResp resp = client.corehr().v1().department().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchEmployeeTypeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchEmployeeTypeSample.java index 45c68c09f..56a21273b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchEmployeeTypeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchEmployeeTypeSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchEmployeeTypeResp resp = client.corehr().employeeType().patch(req); + PatchEmployeeTypeResp resp = client.corehr().v1().employeeType().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchEmploymentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchEmploymentSample.java index b63165f99..912ea3c6c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchEmploymentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchEmploymentSample.java @@ -2,8 +2,8 @@ import com.lark.oapi.Client; import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.service.corehr.v1.model.*; import com.lark.oapi.service.corehr.v1.model.Enum; +import com.lark.oapi.service.corehr.v1.model.*; // PATCH /open-apis/corehr/v1/employments/:employment_id public class PatchEmploymentSample { @@ -32,7 +32,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchEmploymentResp resp = client.corehr().employment().patch(req); + PatchEmploymentResp resp = client.corehr().v1().employment().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobDataSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobDataSample.java index 4bd531d7a..09a5cec3c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobDataSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobDataSample.java @@ -2,8 +2,8 @@ import com.lark.oapi.Client; import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.service.corehr.v1.model.*; import com.lark.oapi.service.corehr.v1.model.Enum; +import com.lark.oapi.service.corehr.v1.model.*; // PATCH /open-apis/corehr/v1/job_datas/:job_data_id public class PatchJobDataSample { @@ -44,7 +44,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchJobDataResp resp = client.corehr().jobData().patch(req); + PatchJobDataResp resp = client.corehr().v1().jobData().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobFamilySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobFamilySample.java index 70debe73e..e61995494 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobFamilySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobFamilySample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchJobFamilyResp resp = client.corehr().jobFamily().patch(req); + PatchJobFamilyResp resp = client.corehr().v1().jobFamily().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobLevelSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobLevelSample.java index 414fdffde..70c1f217f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobLevelSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobLevelSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchJobLevelResp resp = client.corehr().jobLevel().patch(req); + PatchJobLevelResp resp = client.corehr().v1().jobLevel().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobSample.java index a0e92073b..ea0eeff5e 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchJobSample.java @@ -31,7 +31,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchJobResp resp = client.corehr().job().patch(req); + PatchJobResp resp = client.corehr().v1().job().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchNationalIdTypeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchNationalIdTypeSample.java index fc746214e..9d01cc5b9 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchNationalIdTypeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchNationalIdTypeSample.java @@ -2,8 +2,8 @@ import com.lark.oapi.Client; import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.service.corehr.v1.model.*; import com.lark.oapi.service.corehr.v1.model.Enum; +import com.lark.oapi.service.corehr.v1.model.*; // PATCH /open-apis/corehr/v1/national_id_types/:national_id_type_id public class PatchNationalIdTypeSample { @@ -29,7 +29,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchNationalIdTypeResp resp = client.corehr().nationalIdType().patch(req); + PatchNationalIdTypeResp resp = client.corehr().v1().nationalIdType().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchPreHireSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchPreHireSample.java index 3f51f4938..4b406c867 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchPreHireSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchPreHireSample.java @@ -2,8 +2,8 @@ import com.lark.oapi.Client; import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.service.corehr.v1.model.*; import com.lark.oapi.service.corehr.v1.model.Enum; +import com.lark.oapi.service.corehr.v1.model.*; // PATCH /open-apis/corehr/v1/pre_hires/:pre_hire_id public class PatchPreHireSample { @@ -30,7 +30,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchPreHireResp resp = client.corehr().preHire().patch(req); + PatchPreHireResp resp = client.corehr().v1().preHire().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchWorkingHoursTypeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchWorkingHoursTypeSample.java index d7d1e001c..d7dca6619 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchWorkingHoursTypeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/PatchWorkingHoursTypeSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchWorkingHoursTypeResp resp = client.corehr().workingHoursType().patch(req); + PatchWorkingHoursTypeResp resp = client.corehr().v1().workingHoursType().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryCustomFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryCustomFieldSample.java index 14fa4a334..08369dfcd 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryCustomFieldSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryCustomFieldSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - QueryCustomFieldResp resp = client.corehr().customField().query(req); + QueryCustomFieldResp resp = client.corehr().v1().customField().query(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryOffboardingSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryOffboardingSample.java index 771b7fb09..cdba79208 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryOffboardingSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryOffboardingSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - QueryOffboardingResp resp = client.corehr().offboarding().query(req); + QueryOffboardingResp resp = client.corehr().v1().offboarding().query(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QuerySecurityGroupSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QuerySecurityGroupSample.java index 0598fe5f1..77906c7e7 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QuerySecurityGroupSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QuerySecurityGroupSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - QuerySecurityGroupResp resp = client.corehr().securityGroup().query(req); + QuerySecurityGroupResp resp = client.corehr().v1().securityGroup().query(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryTransferReasonSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryTransferReasonSample.java index 10272dc70..d85131815 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryTransferReasonSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryTransferReasonSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - QueryTransferReasonResp resp = client.corehr().transferReason().query(req); + QueryTransferReasonResp resp = client.corehr().v1().transferReason().query(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryTransferTypeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryTransferTypeSample.java index 1da6952c6..f4bec178b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryTransferTypeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/QueryTransferTypeSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - QueryTransferTypeResp resp = client.corehr().transferType().query(req); + QueryTransferTypeResp resp = client.corehr().v1().transferType().query(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/SearchAssignedUserSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/SearchAssignedUserSample.java index 9661840af..6add1f08c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/SearchAssignedUserSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/SearchAssignedUserSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SearchAssignedUserResp resp = client.corehr().assignedUser().search(req); + SearchAssignedUserResp resp = client.corehr().v1().assignedUser().search(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/SearchOffboardingSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/SearchOffboardingSample.java index 81b70c659..f102589d2 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/SearchOffboardingSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/SearchOffboardingSample.java @@ -33,7 +33,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SearchOffboardingResp resp = client.corehr().offboarding().search(req); + SearchOffboardingResp resp = client.corehr().v1().offboarding().search(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/SubmitOffboardingSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/SubmitOffboardingSample.java index 1cb8285a2..b8629d90e 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/SubmitOffboardingSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/SubmitOffboardingSample.java @@ -32,7 +32,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SubmitOffboardingResp resp = client.corehr().offboarding().submit(req); + SubmitOffboardingResp resp = client.corehr().v1().offboarding().submit(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/UploadPersonSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/UploadPersonSample.java index 6898ae424..941525799 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/UploadPersonSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv1/UploadPersonSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UploadPersonResp resp = client.corehr().person().upload(req); + UploadPersonResp resp = client.corehr().v1().person().upload(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetCompanySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetCompanySample.java new file mode 100644 index 000000000..347be4694 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetCompanySample.java @@ -0,0 +1,36 @@ +package com.lark.oapi.sample.apiall.corehrv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v2.model.BatchGetCompanyReq; +import com.lark.oapi.service.corehr.v2.model.BatchGetCompanyReqBody; +import com.lark.oapi.service.corehr.v2.model.BatchGetCompanyResp; + +// POST /open-apis/corehr/v2/companies/batch_get +public class BatchGetCompanySample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + BatchGetCompanyReq req = BatchGetCompanyReq.newBuilder() + .batchGetCompanyReqBody(BatchGetCompanyReqBody.newBuilder() + .companyIds(new String[]{}) + .build()) + .build(); + + // 发起请求 + BatchGetCompanyResp resp = client.corehr().v2().company().batchGet(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetEmployeeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetEmployeeSample.java new file mode 100644 index 000000000..9c22a4b01 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetEmployeeSample.java @@ -0,0 +1,41 @@ +package com.lark.oapi.sample.apiall.corehrv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v2.model.BatchGetEmployeeReq; +import com.lark.oapi.service.corehr.v2.model.BatchGetEmployeeReqBody; +import com.lark.oapi.service.corehr.v2.model.BatchGetEmployeeResp; + +// POST /open-apis/corehr/v2/employees/batch_get +public class BatchGetEmployeeSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + BatchGetEmployeeReq req = BatchGetEmployeeReq.newBuilder() + .userIdType("open_id") + .departmentIdType("open_department_id") + .batchGetEmployeeReqBody(BatchGetEmployeeReqBody.newBuilder() + .fields(new String[]{}) + .employmentIds(new String[]{}) + .personIds(new String[]{}) + .workEmails(new String[]{}) + .build()) + .build(); + + // 发起请求 + BatchGetEmployeeResp resp = client.corehr().v2().employee().batchGet(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetEmployeesBpSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetEmployeesBpSample.java new file mode 100644 index 000000000..b900bc29e --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetEmployeesBpSample.java @@ -0,0 +1,38 @@ +package com.lark.oapi.sample.apiall.corehrv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v2.model.BatchGetEmployeesBpReq; +import com.lark.oapi.service.corehr.v2.model.BatchGetEmployeesBpReqBody; +import com.lark.oapi.service.corehr.v2.model.BatchGetEmployeesBpResp; + +// POST /open-apis/corehr/v2/employees/bps/batch_get +public class BatchGetEmployeesBpSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + BatchGetEmployeesBpReq req = BatchGetEmployeesBpReq.newBuilder() + .userIdType("open_id") + .batchGetEmployeesBpReqBody(BatchGetEmployeesBpReqBody.newBuilder() + .employmentIds(new String[]{}) + .getAll(false) + .build()) + .build(); + + // 发起请求 + BatchGetEmployeesBpResp resp = client.corehr().v2().employeesBp().batchGet(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetEmployeesJobDataSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetEmployeesJobDataSample.java new file mode 100644 index 000000000..027a4037c --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetEmployeesJobDataSample.java @@ -0,0 +1,42 @@ +package com.lark.oapi.sample.apiall.corehrv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v2.model.BatchGetEmployeesJobDataReq; +import com.lark.oapi.service.corehr.v2.model.BatchGetEmployeesJobDataReqBody; +import com.lark.oapi.service.corehr.v2.model.BatchGetEmployeesJobDataResp; + +// POST /open-apis/corehr/v2/employees/job_datas/batch_get +public class BatchGetEmployeesJobDataSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + BatchGetEmployeesJobDataReq req = BatchGetEmployeesJobDataReq.newBuilder() + .userIdType("open_id") + .departmentIdType("people_corehr_department_id") + .batchGetEmployeesJobDataReqBody(BatchGetEmployeesJobDataReqBody.newBuilder() + .employmentIds(new String[]{}) + .getAllVersion(false) + .effectiveDateStart("2020-01-01") + .effectiveDateEnd("2020-01-01") + .dataDate("2020-01-01") + .build()) + .build(); + + // 发起请求 + BatchGetEmployeesJobDataResp resp = client.corehr().v2().employeesJobData().batchGet(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetJobFamilySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetJobFamilySample.java new file mode 100644 index 000000000..d4fbb6292 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetJobFamilySample.java @@ -0,0 +1,36 @@ +package com.lark.oapi.sample.apiall.corehrv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v2.model.BatchGetJobFamilyReq; +import com.lark.oapi.service.corehr.v2.model.BatchGetJobFamilyReqBody; +import com.lark.oapi.service.corehr.v2.model.BatchGetJobFamilyResp; + +// POST /open-apis/corehr/v2/job_families/batch_get +public class BatchGetJobFamilySample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + BatchGetJobFamilyReq req = BatchGetJobFamilyReq.newBuilder() + .batchGetJobFamilyReqBody(BatchGetJobFamilyReqBody.newBuilder() + .jobFamilyIds(new String[]{}) + .build()) + .build(); + + // 发起请求 + BatchGetJobFamilyResp resp = client.corehr().v2().jobFamily().batchGet(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetJobLevelSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetJobLevelSample.java new file mode 100644 index 000000000..f34d16da0 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetJobLevelSample.java @@ -0,0 +1,36 @@ +package com.lark.oapi.sample.apiall.corehrv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v2.model.BatchGetJobLevelReq; +import com.lark.oapi.service.corehr.v2.model.BatchGetJobLevelReqBody; +import com.lark.oapi.service.corehr.v2.model.BatchGetJobLevelResp; + +// POST /open-apis/corehr/v2/job_levels/batch_get +public class BatchGetJobLevelSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + BatchGetJobLevelReq req = BatchGetJobLevelReq.newBuilder() + .batchGetJobLevelReqBody(BatchGetJobLevelReqBody.newBuilder() + .jobLevelIds(new String[]{}) + .build()) + .build(); + + // 发起请求 + BatchGetJobLevelResp resp = client.corehr().v2().jobLevel().batchGet(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetLocationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetLocationSample.java new file mode 100644 index 000000000..61955b222 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/BatchGetLocationSample.java @@ -0,0 +1,36 @@ +package com.lark.oapi.sample.apiall.corehrv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v2.model.BatchGetLocationReq; +import com.lark.oapi.service.corehr.v2.model.BatchGetLocationReqBody; +import com.lark.oapi.service.corehr.v2.model.BatchGetLocationResp; + +// POST /open-apis/corehr/v2/locations/batch_get +public class BatchGetLocationSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + BatchGetLocationReq req = BatchGetLocationReq.newBuilder() + .batchGetLocationReqBody(BatchGetLocationReqBody.newBuilder() + .locationIds(new String[]{}) + .build()) + .build(); + + // 发起请求 + BatchGetLocationResp resp = client.corehr().v2().location().batchGet(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/CreatePersonSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/CreatePersonSample.java new file mode 100644 index 000000000..b75348a90 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/CreatePersonSample.java @@ -0,0 +1,66 @@ +package com.lark.oapi.sample.apiall.corehrv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v2.model.Enum; +import com.lark.oapi.service.corehr.v2.model.*; + +// POST /open-apis/corehr/v2/persons +public class CreatePersonSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + CreatePersonReq req = CreatePersonReq.newBuilder() + .clientToken("12454646") + .personInfo(PersonInfo.newBuilder() + .nameList(new PersonName[]{}) + .gender(Enum.newBuilder().build()) + .dateOfBirth("2020-01-01") + .race(Enum.newBuilder().build()) + .maritalStatus(Enum.newBuilder().build()) + .phoneList(new Phone[]{}) + .addressList(new Address[]{}) + .emailList(new Email[]{}) + .workExperienceList(new WorkExperienceInfo[]{}) + .educationList(new Education[]{}) + .bankAccountList(new BankAccount[]{}) + .nationalIdList(new NationalId[]{}) + .dependentList(new Dependent[]{}) + .emergencyContactList(new EmergencyContact[]{}) + .dateEnteredWorkforce("2020-10-01") + .profileImageId("dfysuc8x76dsfsw") + .personalProfile(new PersonalProfile[]{}) + .nativeRegion("6863326262618752111") + .hukouType(Enum.newBuilder().build()) + .hukouLocation("山东省平阴县") + .talentId("6863326262618752123") + .customFields(new CustomFieldData[]{}) + .bornCountryRegion("中国") + .isDisabled(true) + .disableCardNumber("1110000") + .isMartyrFamily(true) + .martyrCardNumber("1110000") + .isOldAlone(true) + .residentTaxes(new ResidentTax[]{}) + .firstEntryTime("2021-01-02") + .leaveTime("2022-01-02") + .build()) + .build(); + + // 发起请求 + CreatePersonResp resp = client.corehr().v2().person().create(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/CreatePreHireSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/CreatePreHireSample.java new file mode 100644 index 000000000..df45f6596 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/CreatePreHireSample.java @@ -0,0 +1,38 @@ +package com.lark.oapi.sample.apiall.corehrv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v2.model.*; + +// POST /open-apis/corehr/v2/pre_hires +public class CreatePreHireSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + CreatePreHireReq req = CreatePreHireReq.newBuilder() + .prehireCreate(PrehireCreate.newBuilder() + .basicInfo(BasicInfo.newBuilder().build()) + .offerInfo(OfferInfo.newBuilder().build()) + .educationInfo(new EducationInfo[]{}) + .workExperience(new WorkExperience[]{}) + .atsApplicationId("7140946969586010376") + .build()) + .build(); + + // 发起请求 + CreatePreHireResp resp = client.corehr().v2().preHire().create(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/CreateProbationAssessmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/CreateProbationAssessmentSample.java new file mode 100644 index 000000000..326052559 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/CreateProbationAssessmentSample.java @@ -0,0 +1,40 @@ +package com.lark.oapi.sample.apiall.corehrv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v2.model.AssessmentForCreate; +import com.lark.oapi.service.corehr.v2.model.CreateProbationAssessmentReq; +import com.lark.oapi.service.corehr.v2.model.CreateProbationAssessmentReqBody; +import com.lark.oapi.service.corehr.v2.model.CreateProbationAssessmentResp; + +// POST /open-apis/corehr/v2/probation/assessments +public class CreateProbationAssessmentSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + CreateProbationAssessmentReq req = CreateProbationAssessmentReq.newBuilder() + .clientToken("6822122262122064111") + .userIdType("open_id") + .createProbationAssessmentReqBody(CreateProbationAssessmentReqBody.newBuilder() + .employmentId("7140964208476371111") + .assessments(new AssessmentForCreate[]{}) + .build()) + .build(); + + // 发起请求 + CreateProbationAssessmentResp resp = client.corehr().v2().probationAssessment().create(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/GetAuthorizeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/DeleteProbationAssessmentSample.java similarity index 53% rename from sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/GetAuthorizeSample.java rename to sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/DeleteProbationAssessmentSample.java index 8588d7eba..cc2d574ab 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/authenv1/GetAuthorizeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/DeleteProbationAssessmentSample.java @@ -1,27 +1,24 @@ -package com.lark.oapi.sample.apiall.authenv1; +package com.lark.oapi.sample.apiall.corehrv2; import com.lark.oapi.Client; import com.lark.oapi.core.utils.Jsons; -import com.lark.oapi.service.authen.v1.model.GetAuthorizeReq; -import com.lark.oapi.service.authen.v1.model.GetAuthorizeResp; +import com.lark.oapi.service.corehr.v2.model.DeleteProbationAssessmentReq; +import com.lark.oapi.service.corehr.v2.model.DeleteProbationAssessmentResp; -// GET /open-apis/authen/v1/authorize -public class GetAuthorizeSample { +// DELETE /open-apis/corehr/v2/probation/assessments/:assessment_id +public class DeleteProbationAssessmentSample { public static void main(String arg[]) throws Exception { // 构建client Client client = Client.newBuilder("appId", "appSecret").build(); // 创建请求对象 - GetAuthorizeReq req = GetAuthorizeReq.newBuilder() - .appId("cli_9dff7f6ae02ad104") - .redirectUri("https%3A%2F%2F127.0.0.1%2Fmock") - .scope("contact:contact bitable:app:readonly") - .state("RANDOMSTATE") + DeleteProbationAssessmentReq req = DeleteProbationAssessmentReq.newBuilder() + .assessmentId("7140964208476371331") .build(); // 发起请求 - GetAuthorizeResp resp = client.authen().authorize().get(req); + DeleteProbationAssessmentResp resp = client.corehr().v2().probationAssessment().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/EnableDisableAssessmentProbationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/EnableDisableAssessmentProbationSample.java new file mode 100644 index 000000000..9af98cd81 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/EnableDisableAssessmentProbationSample.java @@ -0,0 +1,37 @@ +package com.lark.oapi.sample.apiall.corehrv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v2.model.EnableDisableAssessmentProbationReq; +import com.lark.oapi.service.corehr.v2.model.EnableDisableAssessmentProbationReqBody; +import com.lark.oapi.service.corehr.v2.model.EnableDisableAssessmentProbationResp; + +// POST /open-apis/corehr/v2/probation/enable_disable_assessment +public class EnableDisableAssessmentProbationSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + EnableDisableAssessmentProbationReq req = EnableDisableAssessmentProbationReq.newBuilder() + .enableDisableAssessmentProbationReqBody(EnableDisableAssessmentProbationReqBody.newBuilder() + .active(true) + .appUrl("https://qwe111.feishuapp.bytedance.net/ae/ui/apps/176612345027111/appPages/l11bsrwss13yt?dataGrid%41pye4fsbajo21l=%7B%7D&key=ffm41o1&dataGrid%41wmv98t29vif3kj=%1B%7D") + .build()) + .build(); + + // 发起请求 + EnableDisableAssessmentProbationResp resp = client.corehr().v2().probation().enableDisableAssessment(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/GetByDepartmentBpSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/GetByDepartmentBpSample.java new file mode 100644 index 000000000..bf6154fed --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/GetByDepartmentBpSample.java @@ -0,0 +1,38 @@ +package com.lark.oapi.sample.apiall.corehrv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v2.model.GetByDepartmentBpReq; +import com.lark.oapi.service.corehr.v2.model.GetByDepartmentBpReqBody; +import com.lark.oapi.service.corehr.v2.model.GetByDepartmentBpResp; + +// POST /open-apis/corehr/v2/bps/get_by_department +public class GetByDepartmentBpSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + GetByDepartmentBpReq req = GetByDepartmentBpReq.newBuilder() + .userIdType("open_id") + .departmentIdType("open_department_id") + .getByDepartmentBpReqBody(GetByDepartmentBpReqBody.newBuilder() + .departmentId("6893014062142064111") + .build()) + .build(); + + // 发起请求 + GetByDepartmentBpResp resp = client.corehr().v2().bp().getByDepartment(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/GetJobSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/GetJobSample.java new file mode 100644 index 000000000..77dbd1ee2 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/GetJobSample.java @@ -0,0 +1,33 @@ +package com.lark.oapi.sample.apiall.corehrv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v2.model.GetJobReq; +import com.lark.oapi.service.corehr.v2.model.GetJobResp; + +// GET /open-apis/corehr/v2/jobs/:job_id +public class GetJobSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + GetJobReq req = GetJobReq.newBuilder() + .jobId("151515") + .build(); + + // 发起请求 + GetJobResp resp = client.corehr().v2().job().get(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/GetProcessSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/GetProcessSample.java new file mode 100644 index 000000000..d202c781b --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/GetProcessSample.java @@ -0,0 +1,34 @@ +package com.lark.oapi.sample.apiall.corehrv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v2.model.GetProcessReq; +import com.lark.oapi.service.corehr.v2.model.GetProcessResp; + +// GET /open-apis/corehr/v2/processes/:process_id +public class GetProcessSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + GetProcessReq req = GetProcessReq.newBuilder() + .processId("7278949005675988535") + .userIdType("open_id") + .build(); + + // 发起请求 + GetProcessResp resp = client.corehr().v2().process().get(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/ListBpSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/ListBpSample.java new file mode 100644 index 000000000..85d3adc47 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/ListBpSample.java @@ -0,0 +1,36 @@ +package com.lark.oapi.sample.apiall.corehrv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v2.model.ListBpReq; +import com.lark.oapi.service.corehr.v2.model.ListBpResp; + +// GET /open-apis/corehr/v2/bps +public class ListBpSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + ListBpReq req = ListBpReq.newBuilder() + .pageSize(500) + .pageToken("6891251722631890445") + .userIdType("open_id") + .departmentIdType("open_department_id") + .build(); + + // 发起请求 + ListBpResp resp = client.corehr().v2().bp().list(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/ListJobSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/ListJobSample.java new file mode 100644 index 000000000..66843f372 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/ListJobSample.java @@ -0,0 +1,36 @@ +package com.lark.oapi.sample.apiall.corehrv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v2.model.ListJobReq; +import com.lark.oapi.service.corehr.v2.model.ListJobResp; + +// GET /open-apis/corehr/v2/jobs +public class ListJobSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + ListJobReq req = ListJobReq.newBuilder() + .pageToken("1231231987") + .pageSize("100") + .name("keyword") + .queryLanguage("zh") + .build(); + + // 发起请求 + ListJobResp resp = client.corehr().v2().job().list(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/ListProcessSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/ListProcessSample.java new file mode 100644 index 000000000..450cc0c9c --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/ListProcessSample.java @@ -0,0 +1,38 @@ +package com.lark.oapi.sample.apiall.corehrv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v2.model.ListProcessReq; +import com.lark.oapi.service.corehr.v2.model.ListProcessResp; + +// GET /open-apis/corehr/v2/processes +public class ListProcessSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + ListProcessReq req = ListProcessReq.newBuilder() + .modifyTimeTo("1547654251506") + .statuses(new Integer[]{}) + .pageToken("7278949005675988535") + .pageSize(100) + .modifyTimeFrom("1547654251506") + .flowDefinitionId("people_6961286846093788680_7081951411982077732") + .build(); + + // 发起请求 + ListProcessResp resp = client.corehr().v2().process().list(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/ParentsDepartmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/ParentsDepartmentSample.java new file mode 100644 index 000000000..0eeb91357 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/ParentsDepartmentSample.java @@ -0,0 +1,37 @@ +package com.lark.oapi.sample.apiall.corehrv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v2.model.ParentsDepartmentReq; +import com.lark.oapi.service.corehr.v2.model.ParentsDepartmentReqBody; +import com.lark.oapi.service.corehr.v2.model.ParentsDepartmentResp; + +// POST /open-apis/corehr/v2/departments/parents +public class ParentsDepartmentSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + ParentsDepartmentReq req = ParentsDepartmentReq.newBuilder() + .departmentIdType("open_department_id") + .parentsDepartmentReqBody(ParentsDepartmentReqBody.newBuilder() + .departmentIdList(new String[]{}) + .build()) + .build(); + + // 发起请求 + ParentsDepartmentResp resp = client.corehr().v2().department().parents(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/PatchPersonSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/PatchPersonSample.java new file mode 100644 index 000000000..df4c44e3d --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/PatchPersonSample.java @@ -0,0 +1,67 @@ +package com.lark.oapi.sample.apiall.corehrv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v2.model.Enum; +import com.lark.oapi.service.corehr.v2.model.*; + +// PATCH /open-apis/corehr/v2/persons/:person_id +public class PatchPersonSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + PatchPersonReq req = PatchPersonReq.newBuilder() + .personId("12454646") + .clientToken("12454646") + .personInfo(PersonInfo.newBuilder() + .nameList(new PersonName[]{}) + .gender(Enum.newBuilder().build()) + .dateOfBirth("2020-01-01") + .race(Enum.newBuilder().build()) + .maritalStatus(Enum.newBuilder().build()) + .phoneList(new Phone[]{}) + .addressList(new Address[]{}) + .emailList(new Email[]{}) + .workExperienceList(new WorkExperienceInfo[]{}) + .educationList(new Education[]{}) + .bankAccountList(new BankAccount[]{}) + .nationalIdList(new NationalId[]{}) + .dependentList(new Dependent[]{}) + .emergencyContactList(new EmergencyContact[]{}) + .dateEnteredWorkforce("2020-10-01") + .profileImageId("dfysuc8x76dsfsw") + .personalProfile(new PersonalProfile[]{}) + .nativeRegion("6863326262618752111") + .hukouType(Enum.newBuilder().build()) + .hukouLocation("山东省平阴县") + .talentId("6863326262618752123") + .customFields(new CustomFieldData[]{}) + .bornCountryRegion("中国") + .isDisabled(true) + .disableCardNumber("1110000") + .isMartyrFamily(true) + .martyrCardNumber("1110000") + .isOldAlone(true) + .residentTaxes(new ResidentTax[]{}) + .firstEntryTime("2021-01-02") + .leaveTime("2022-01-02") + .build()) + .build(); + + // 发起请求 + PatchPersonResp resp = client.corehr().v2().person().patch(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/PatchProbationAssessmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/PatchProbationAssessmentSample.java new file mode 100644 index 000000000..b5833f063 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/PatchProbationAssessmentSample.java @@ -0,0 +1,44 @@ +package com.lark.oapi.sample.apiall.corehrv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v2.model.AssessmentForCreate; +import com.lark.oapi.service.corehr.v2.model.PatchProbationAssessmentReq; +import com.lark.oapi.service.corehr.v2.model.PatchProbationAssessmentResp; + +// PATCH /open-apis/corehr/v2/probation/assessments/:assessment_id +public class PatchProbationAssessmentSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + PatchProbationAssessmentReq req = PatchProbationAssessmentReq.newBuilder() + .assessmentId("7140964208476371331") + .clientToken("6822122262122064111") + .assessmentForCreate(AssessmentForCreate.newBuilder() + .assessmentStatus("completed") + .assessmentResult("approved") + .assessmentScore(99.9) + .assessmentGrade("grade_a") + .assessmentComment("超出预期") + .assessmentDetail("暂无示例") + .isFinalAsssessment(false) + .build()) + .build(); + + // 发起请求 + PatchProbationAssessmentResp resp = client.corehr().v2().probationAssessment().patch(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/QueryEmployeesJobDataSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/QueryEmployeesJobDataSample.java new file mode 100644 index 000000000..03e353586 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/QueryEmployeesJobDataSample.java @@ -0,0 +1,43 @@ +package com.lark.oapi.sample.apiall.corehrv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v2.model.QueryEmployeesJobDataReq; +import com.lark.oapi.service.corehr.v2.model.QueryEmployeesJobDataReqBody; +import com.lark.oapi.service.corehr.v2.model.QueryEmployeesJobDataResp; + +// POST /open-apis/corehr/v2/employees/job_datas/query +public class QueryEmployeesJobDataSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + QueryEmployeesJobDataReq req = QueryEmployeesJobDataReq.newBuilder() + .pageSize(100) + .pageToken("6891251722631890445") + .userIdType("open_id") + .departmentIdType("people_corehr_department_id") + .queryEmployeesJobDataReqBody(QueryEmployeesJobDataReqBody.newBuilder() + .getAllVersion(false) + .dataDate("2020-01-01") + .effectiveDateStart("2020-01-01") + .effectiveDateEnd("2020-01-01") + .build()) + .build(); + + // 发起请求 + QueryEmployeesJobDataResp resp = client.corehr().v2().employeesJobData().query(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchContractSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchContractSample.java new file mode 100644 index 000000000..ab3324001 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchContractSample.java @@ -0,0 +1,40 @@ +package com.lark.oapi.sample.apiall.corehrv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v2.model.SearchContractReq; +import com.lark.oapi.service.corehr.v2.model.SearchContractReqBody; +import com.lark.oapi.service.corehr.v2.model.SearchContractResp; + +// POST /open-apis/corehr/v2/contracts/search +public class SearchContractSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + SearchContractReq req = SearchContractReq.newBuilder() + .pageSize(100) + .pageToken("6891251722631890445") + .userIdType("open_id") + .searchContractReqBody(SearchContractReqBody.newBuilder() + .employmentIdList(new String[]{}) + .contractIdList(new String[]{}) + .build()) + .build(); + + // 发起请求 + SearchContractResp resp = client.corehr().v2().contract().search(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchDepartmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchDepartmentSample.java new file mode 100644 index 000000000..fa25a9584 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchDepartmentSample.java @@ -0,0 +1,47 @@ +package com.lark.oapi.sample.apiall.corehrv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v2.model.SearchDepartmentReq; +import com.lark.oapi.service.corehr.v2.model.SearchDepartmentReqBody; +import com.lark.oapi.service.corehr.v2.model.SearchDepartmentResp; + +// POST /open-apis/corehr/v2/departments/search +public class SearchDepartmentSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + SearchDepartmentReq req = SearchDepartmentReq.newBuilder() + .pageSize(100) + .pageToken("6891251722631890445") + .userIdType("open_id") + .departmentIdType("open_department_id") + .searchDepartmentReqBody(SearchDepartmentReqBody.newBuilder() + .active(true) + .getAllChildren(false) + .managerList(new String[]{}) + .departmentIdList(new String[]{}) + .nameList(new String[]{}) + .parentDepartmentId("7094136522860922222") + .codeList(new String[]{}) + .fields(new String[]{}) + .build()) + .build(); + + // 发起请求 + SearchDepartmentResp resp = client.corehr().v2().department().search(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchEmployeeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchEmployeeSample.java new file mode 100644 index 000000000..ba69ac1b4 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchEmployeeSample.java @@ -0,0 +1,61 @@ +package com.lark.oapi.sample.apiall.corehrv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v2.model.SearchEmployeeReq; +import com.lark.oapi.service.corehr.v2.model.SearchEmployeeReqBody; +import com.lark.oapi.service.corehr.v2.model.SearchEmployeeResp; + +// POST /open-apis/corehr/v2/employees/search +public class SearchEmployeeSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + SearchEmployeeReq req = SearchEmployeeReq.newBuilder() + .pageSize(100) + .pageToken("6891251722631890445") + .userIdType("open_id") + .departmentIdType("open_department_id") + .searchEmployeeReqBody(SearchEmployeeReqBody.newBuilder() + .fields(new String[]{}) + .employmentIdList(new String[]{}) + .employeeNumberList(new String[]{}) + .workEmail("13312345678@qq.com") + .phoneNumber("16760342300") + .keyWord("张三") + .employmentStatus("hired") + .employeeTypeId("6971090097697521314") + .departmentIdList(new String[]{}) + .directManagerIdList(new String[]{}) + .dottedLineManagerIdList(new String[]{}) + .regularEmployeeStartDateStart("2020-01-01") + .regularEmployeeStartDateEnd("2020-01-01") + .effectiveTimeStart("2020-01-01") + .effectiveTimeEnd("2020-01-01") + .workLocationIdListIncludeSub(new String[]{}) + .preferredEnglishFullNameList(new String[]{}) + .preferredLocalFullNameList(new String[]{}) + .nationalIdNumberList(new String[]{}) + .phoneNumberList(new String[]{}) + .emailAddressList(new String[]{}) + .departmentIdListIncludeSub(new String[]{}) + .build()) + .build(); + + // 发起请求 + SearchEmployeeResp resp = client.corehr().v2().employee().search(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchJobChangeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchJobChangeSample.java new file mode 100644 index 000000000..c8bfabf80 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchJobChangeSample.java @@ -0,0 +1,42 @@ +package com.lark.oapi.sample.apiall.corehrv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v2.model.SearchJobChangeReq; +import com.lark.oapi.service.corehr.v2.model.SearchJobChangeReqBody; +import com.lark.oapi.service.corehr.v2.model.SearchJobChangeResp; + +// POST /open-apis/corehr/v2/job_changes/search +public class SearchJobChangeSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + SearchJobChangeReq req = SearchJobChangeReq.newBuilder() + .pageSize(100) + .pageToken("6891251722631890445") + .userIdType("open_id") + .departmentIdType("open_department_id") + .searchJobChangeReqBody(SearchJobChangeReqBody.newBuilder() + .employmentIds(new String[]{}) + .jobChangeIds(new String[]{}) + .statuses(new String[]{}) + .build()) + .build(); + + // 发起请求 + SearchJobChangeResp resp = client.corehr().v2().jobChange().search(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchProbationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchProbationSample.java new file mode 100644 index 000000000..fc82d3db5 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/corehrv2/SearchProbationSample.java @@ -0,0 +1,52 @@ +package com.lark.oapi.sample.apiall.corehrv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.corehr.v2.model.SearchProbationReq; +import com.lark.oapi.service.corehr.v2.model.SearchProbationReqBody; +import com.lark.oapi.service.corehr.v2.model.SearchProbationResp; + +// POST /open-apis/corehr/v2/probation/search +public class SearchProbationSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + SearchProbationReq req = SearchProbationReq.newBuilder() + .pageSize(100) + .pageToken("6891251722631890445") + .userIdType("open_id") + .departmentIdType("open_department_id") + .searchProbationReqBody(SearchProbationReqBody.newBuilder() + .employmentIds(new String[]{}) + .departmentIds(new String[]{}) + .probationStartDateStart("2022-05-18") + .probationStartDateEnd("2022-05-20") + .probationExpectedEndDateStart("2022-06-20") + .probationExpectedEndDateEnd("2022-07-20") + .actualProbationEndDateStart("2022-08-20") + .actualProbationEndDateEnd("2022-09-20") + .initiatingTimeStart("2022-10-20") + .initiatingTimeEnd("2022-11-20") + .probationStatus("approved") + .finalAssessmentResult("approved") + .finalAssessmentGrade("grade_a") + .build()) + .build(); + + // 发起请求 + SearchProbationResp resp = client.corehr().v2().probation().search(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/FieldExtractionContractSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/FieldExtractionContractSample.java index bdf43fb77..63a27e5c5 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/FieldExtractionContractSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/FieldExtractionContractSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - FieldExtractionContractResp resp = client.documentAi().contract().fieldExtraction(req); + FieldExtractionContractResp resp = client.documentAi().v1().contract().fieldExtraction(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeBankCardSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeBankCardSample.java index 2eb3395e6..2a27997f3 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeBankCardSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeBankCardSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - RecognizeBankCardResp resp = client.documentAi().bankCard().recognize(req); + RecognizeBankCardResp resp = client.documentAi().v1().bankCard().recognize(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeBusinessCardSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeBusinessCardSample.java index debc4049c..b7f5fff96 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeBusinessCardSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeBusinessCardSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - RecognizeBusinessCardResp resp = client.documentAi().businessCard().recognize(req); + RecognizeBusinessCardResp resp = client.documentAi().v1().businessCard().recognize(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeBusinessLicenseSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeBusinessLicenseSample.java index 56fecda60..a6c5c71b1 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeBusinessLicenseSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeBusinessLicenseSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - RecognizeBusinessLicenseResp resp = client.documentAi().businessLicense().recognize(req); + RecognizeBusinessLicenseResp resp = client.documentAi().v1().businessLicense().recognize(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeChinesePassportSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeChinesePassportSample.java index 342bebb89..1d2a6b4c0 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeChinesePassportSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeChinesePassportSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - RecognizeChinesePassportResp resp = client.documentAi().chinesePassport().recognize(req); + RecognizeChinesePassportResp resp = client.documentAi().v1().chinesePassport().recognize(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeDrivingLicenseSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeDrivingLicenseSample.java index 87ebb4837..795b4e9c1 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeDrivingLicenseSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeDrivingLicenseSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - RecognizeDrivingLicenseResp resp = client.documentAi().drivingLicense().recognize(req); + RecognizeDrivingLicenseResp resp = client.documentAi().v1().drivingLicense().recognize(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeFoodManageLicenseSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeFoodManageLicenseSample.java index c27e3dc79..4d988aa76 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeFoodManageLicenseSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeFoodManageLicenseSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - RecognizeFoodManageLicenseResp resp = client.documentAi().foodManageLicense().recognize(req); + RecognizeFoodManageLicenseResp resp = client.documentAi().v1().foodManageLicense().recognize(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeFoodProduceLicenseSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeFoodProduceLicenseSample.java index fdda654c6..0f7c140f7 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeFoodProduceLicenseSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeFoodProduceLicenseSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - RecognizeFoodProduceLicenseResp resp = client.documentAi().foodProduceLicense().recognize(req); + RecognizeFoodProduceLicenseResp resp = client.documentAi().v1().foodProduceLicense().recognize(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeHkmMainlandTravelPermitSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeHkmMainlandTravelPermitSample.java index 4c7b09000..d20a10c63 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeHkmMainlandTravelPermitSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeHkmMainlandTravelPermitSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - RecognizeHkmMainlandTravelPermitResp resp = client.documentAi().hkmMainlandTravelPermit().recognize(req); + RecognizeHkmMainlandTravelPermitResp resp = client.documentAi().v1().hkmMainlandTravelPermit().recognize(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeIdCardSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeIdCardSample.java index cdba60b43..4286f2d70 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeIdCardSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeIdCardSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - RecognizeIdCardResp resp = client.documentAi().idCard().recognize(req); + RecognizeIdCardResp resp = client.documentAi().v1().idCard().recognize(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeTaxiInvoiceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeTaxiInvoiceSample.java index 58e6af4c5..582c682d5 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeTaxiInvoiceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeTaxiInvoiceSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - RecognizeTaxiInvoiceResp resp = client.documentAi().taxiInvoice().recognize(req); + RecognizeTaxiInvoiceResp resp = client.documentAi().v1().taxiInvoice().recognize(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeTrainInvoiceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeTrainInvoiceSample.java index bec16eb7b..0aac5de9d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeTrainInvoiceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeTrainInvoiceSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - RecognizeTrainInvoiceResp resp = client.documentAi().trainInvoice().recognize(req); + RecognizeTrainInvoiceResp resp = client.documentAi().v1().trainInvoice().recognize(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeTwMainlandTravelPermitSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeTwMainlandTravelPermitSample.java index 2e95fed4f..9c17e9b9b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeTwMainlandTravelPermitSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeTwMainlandTravelPermitSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - RecognizeTwMainlandTravelPermitResp resp = client.documentAi().twMainlandTravelPermit().recognize(req); + RecognizeTwMainlandTravelPermitResp resp = client.documentAi().v1().twMainlandTravelPermit().recognize(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeVatInvoiceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeVatInvoiceSample.java index bb8d3eeec..70050ee84 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeVatInvoiceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeVatInvoiceSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - RecognizeVatInvoiceResp resp = client.documentAi().vatInvoice().recognize(req); + RecognizeVatInvoiceResp resp = client.documentAi().v1().vatInvoice().recognize(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeVehicleLicenseSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeVehicleLicenseSample.java index 2ed466eb6..07e2696d4 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeVehicleLicenseSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/document_aiv1/RecognizeVehicleLicenseSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - RecognizeVehicleLicenseResp resp = client.documentAi().vehicleLicense().recognize(req); + RecognizeVehicleLicenseResp resp = client.documentAi().v1().vehicleLicense().recognize(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/BatchDeleteDocumentBlockChildrenSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/BatchDeleteDocumentBlockChildrenSample.java index 7022d0f9c..893b5442c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/BatchDeleteDocumentBlockChildrenSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/BatchDeleteDocumentBlockChildrenSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchDeleteDocumentBlockChildrenResp resp = client.docx().documentBlockChildren().batchDelete(req); + BatchDeleteDocumentBlockChildrenResp resp = client.docx().v1().documentBlockChildren().batchDelete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/BatchUpdateDocumentBlockSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/BatchUpdateDocumentBlockSample.java index 71cff1975..63525650d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/BatchUpdateDocumentBlockSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/BatchUpdateDocumentBlockSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchUpdateDocumentBlockResp resp = client.docx().documentBlock().batchUpdate(req); + BatchUpdateDocumentBlockResp resp = client.docx().v1().documentBlock().batchUpdate(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/CreateDocumentBlockChildrenSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/CreateDocumentBlockChildrenSample.java index 93206f8ec..8da3078f5 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/CreateDocumentBlockChildrenSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/CreateDocumentBlockChildrenSample.java @@ -28,7 +28,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateDocumentBlockChildrenResp resp = client.docx().documentBlockChildren().create(req); + CreateDocumentBlockChildrenResp resp = client.docx().v1().documentBlockChildren().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/CreateDocumentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/CreateDocumentSample.java index c0f616308..8faab5810 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/CreateDocumentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/CreateDocumentSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateDocumentResp resp = client.docx().document().create(req); + CreateDocumentResp resp = client.docx().v1().document().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/GetDocumentBlockChildrenSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/GetDocumentBlockChildrenSample.java index 5578f51e2..471c7f013 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/GetDocumentBlockChildrenSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/GetDocumentBlockChildrenSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetDocumentBlockChildrenResp resp = client.docx().documentBlockChildren().get(req); + GetDocumentBlockChildrenResp resp = client.docx().v1().documentBlockChildren().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/GetDocumentBlockSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/GetDocumentBlockSample.java index fa5f86a0f..1aac49004 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/GetDocumentBlockSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/GetDocumentBlockSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetDocumentBlockResp resp = client.docx().documentBlock().get(req); + GetDocumentBlockResp resp = client.docx().v1().documentBlock().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/GetDocumentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/GetDocumentSample.java index cb2a58106..d249f07ae 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/GetDocumentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/GetDocumentSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetDocumentResp resp = client.docx().document().get(req); + GetDocumentResp resp = client.docx().v1().document().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/ListDocumentBlockSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/ListDocumentBlockSample.java index a88d1d1ec..86e51676d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/ListDocumentBlockSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/ListDocumentBlockSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListDocumentBlockResp resp = client.docx().documentBlock().list(req); + ListDocumentBlockResp resp = client.docx().v1().documentBlock().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/PatchDocumentBlockSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/PatchDocumentBlockSample.java index cd7b299c6..d01cd2e08 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/PatchDocumentBlockSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/PatchDocumentBlockSample.java @@ -34,11 +34,12 @@ public static void main(String arg[]) throws Exception { .replaceImage(ReplaceImageRequest.newBuilder().build()) .replaceFile(ReplaceFileRequest.newBuilder().build()) .updateText(UpdateTextRequest.newBuilder().build()) + .updateTask(UpdateTaskRequest.newBuilder().build()) .build()) .build(); // 发起请求 - PatchDocumentBlockResp resp = client.docx().documentBlock().patch(req); + PatchDocumentBlockResp resp = client.docx().v1().documentBlock().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/RawContentDocumentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/RawContentDocumentSample.java index e559e6f81..626329458 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/RawContentDocumentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/docxv1/RawContentDocumentSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - RawContentDocumentResp resp = client.docx().document().rawContent(req); + RawContentDocumentResp resp = client.docx().v1().document().rawContent(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/AuthPermissionMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/AuthPermissionMemberSample.java index 1bce1ad08..e9a78851a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/AuthPermissionMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/AuthPermissionMemberSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - AuthPermissionMemberResp resp = client.drive().permissionMember().auth(req); + AuthPermissionMemberResp resp = client.drive().v1().permissionMember().auth(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/BatchGetTmpDownloadUrlMediaSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/BatchGetTmpDownloadUrlMediaSample.java index e6c2a3b39..b4c72a319 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/BatchGetTmpDownloadUrlMediaSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/BatchGetTmpDownloadUrlMediaSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchGetTmpDownloadUrlMediaResp resp = client.drive().media().batchGetTmpDownloadUrl(req); + BatchGetTmpDownloadUrlMediaResp resp = client.drive().v1().media().batchGetTmpDownloadUrl(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/BatchQueryFileCommentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/BatchQueryFileCommentSample.java index 41540ce31..5fedb4b9d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/BatchQueryFileCommentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/BatchQueryFileCommentSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchQueryFileCommentResp resp = client.drive().fileComment().batchQuery(req); + BatchQueryFileCommentResp resp = client.drive().v1().fileComment().batchQuery(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/BatchQueryMetaSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/BatchQueryMetaSample.java index 3839c8a24..89e1efeda 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/BatchQueryMetaSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/BatchQueryMetaSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchQueryMetaResp resp = client.drive().meta().batchQuery(req); + BatchQueryMetaResp resp = client.drive().v1().meta().batchQuery(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CopyFileSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CopyFileSample.java index 15d314895..79f25cfbd 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CopyFileSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CopyFileSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CopyFileResp resp = client.drive().file().copy(req); + CopyFileResp resp = client.drive().v1().file().copy(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateExportTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateExportTaskSample.java index a7107b149..09f77e92c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateExportTaskSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateExportTaskSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateExportTaskResp resp = client.drive().exportTask().create(req); + CreateExportTaskResp resp = client.drive().v1().exportTask().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFileCommentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFileCommentSample.java index ab4652f13..90636a41d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFileCommentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFileCommentSample.java @@ -36,7 +36,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateFileCommentResp resp = client.drive().fileComment().create(req); + CreateFileCommentResp resp = client.drive().v1().fileComment().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFileSubscriptionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFileSubscriptionSample.java index 98544358f..54283e479 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFileSubscriptionSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFileSubscriptionSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateFileSubscriptionResp resp = client.drive().fileSubscription().create(req); + CreateFileSubscriptionResp resp = client.drive().v1().fileSubscription().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFileVersionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFileVersionSample.java index 042b154bd..9d6c364c5 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFileVersionSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFileVersionSample.java @@ -32,7 +32,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateFileVersionResp resp = client.drive().fileVersion().create(req); + CreateFileVersionResp resp = client.drive().v1().fileVersion().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFolderFileSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFolderFileSample.java index fdbfae688..a71a3b426 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFolderFileSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateFolderFileSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateFolderFileResp resp = client.drive().file().createFolder(req); + CreateFolderFileResp resp = client.drive().v1().file().createFolder(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateImportTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateImportTaskSample.java index 402b5cb82..76f590e6d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateImportTaskSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateImportTaskSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateImportTaskResp resp = client.drive().importTask().create(req); + CreateImportTaskResp resp = client.drive().v1().importTask().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreatePermissionMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreatePermissionMemberSample.java index 26ec280ba..649bec3ef 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreatePermissionMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreatePermissionMemberSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreatePermissionMemberResp resp = client.drive().permissionMember().create(req); + CreatePermissionMemberResp resp = client.drive().v1().permissionMember().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreatePermissionPublicPasswordSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreatePermissionPublicPasswordSample.java index 30246906e..cedb798a0 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreatePermissionPublicPasswordSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreatePermissionPublicPasswordSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreatePermissionPublicPasswordResp resp = client.drive().permissionPublicPassword().create(req); + CreatePermissionPublicPasswordResp resp = client.drive().v1().permissionPublicPassword().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateShortcutFileSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateShortcutFileSample.java index 0791be205..3eb7741de 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateShortcutFileSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/CreateShortcutFileSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateShortcutFileResp resp = client.drive().file().createShortcut(req); + CreateShortcutFileResp resp = client.drive().v1().file().createShortcut(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteFileCommentReplySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteFileCommentReplySample.java index 7696a5de0..dc4cba30e 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteFileCommentReplySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteFileCommentReplySample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteFileCommentReplyResp resp = client.drive().fileCommentReply().delete(req); + DeleteFileCommentReplyResp resp = client.drive().v1().fileCommentReply().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteFileSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteFileSample.java index 7fc99320d..f37595cd9 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteFileSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteFileSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteFileResp resp = client.drive().file().delete(req); + DeleteFileResp resp = client.drive().v1().file().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteFileVersionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteFileVersionSample.java index 733151129..e27f14291 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteFileVersionSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteFileVersionSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteFileVersionResp resp = client.drive().fileVersion().delete(req); + DeleteFileVersionResp resp = client.drive().v1().fileVersion().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeletePermissionMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeletePermissionMemberSample.java index b87f4b277..0a097b7bf 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeletePermissionMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeletePermissionMemberSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeletePermissionMemberResp resp = client.drive().permissionMember().delete(req); + DeletePermissionMemberResp resp = client.drive().v1().permissionMember().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeletePermissionPublicPasswordSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeletePermissionPublicPasswordSample.java index 091a1fc63..4c63123ba 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeletePermissionPublicPasswordSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeletePermissionPublicPasswordSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeletePermissionPublicPasswordResp resp = client.drive().permissionPublicPassword().delete(req); + DeletePermissionPublicPasswordResp resp = client.drive().v1().permissionPublicPassword().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteSubscribeFileSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteSubscribeFileSample.java index 3e4882b98..7ce353836 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteSubscribeFileSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DeleteSubscribeFileSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteSubscribeFileResp resp = client.drive().file().deleteSubscribe(req); + DeleteSubscribeFileResp resp = client.drive().v1().file().deleteSubscribe(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DownloadExportTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DownloadExportTaskSample.java index 28e28a18d..2bc6f21d1 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DownloadExportTaskSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DownloadExportTaskSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DownloadExportTaskResp resp = client.drive().exportTask().download(req); + DownloadExportTaskResp resp = client.drive().v1().exportTask().download(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DownloadFileSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DownloadFileSample.java index 59c5d8485..00a7e9a57 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DownloadFileSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DownloadFileSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DownloadFileResp resp = client.drive().file().download(req); + DownloadFileResp resp = client.drive().v1().file().download(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DownloadMediaSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DownloadMediaSample.java index 9a8d1c302..cc6a12a02 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DownloadMediaSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/DownloadMediaSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DownloadMediaResp resp = client.drive().media().download(req); + DownloadMediaResp resp = client.drive().v1().media().download(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetExportTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetExportTaskSample.java index 1394b1d22..4bd2deeff 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetExportTaskSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetExportTaskSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetExportTaskResp resp = client.drive().exportTask().get(req); + GetExportTaskResp resp = client.drive().v1().exportTask().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileCommentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileCommentSample.java index b65ff8988..ce1f70218 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileCommentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileCommentSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetFileCommentResp resp = client.drive().fileComment().get(req); + GetFileCommentResp resp = client.drive().v1().fileComment().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileStatisticsSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileStatisticsSample.java index 2bd618ddd..a7fb8f2a7 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileStatisticsSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileStatisticsSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetFileStatisticsResp resp = client.drive().fileStatistics().get(req); + GetFileStatisticsResp resp = client.drive().v1().fileStatistics().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileSubscriptionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileSubscriptionSample.java index 89111b269..2a8a571e0 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileSubscriptionSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileSubscriptionSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetFileSubscriptionResp resp = client.drive().fileSubscription().get(req); + GetFileSubscriptionResp resp = client.drive().v1().fileSubscription().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileVersionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileVersionSample.java index bc708dc7d..1c403b784 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileVersionSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetFileVersionSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetFileVersionResp resp = client.drive().fileVersion().get(req); + GetFileVersionResp resp = client.drive().v1().fileVersion().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetImportTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetImportTaskSample.java index 9406ae808..c38387d08 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetImportTaskSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetImportTaskSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetImportTaskResp resp = client.drive().importTask().get(req); + GetImportTaskResp resp = client.drive().v1().importTask().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetPermissionPublicSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetPermissionPublicSample.java index 989665067..6e072b2dd 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetPermissionPublicSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetPermissionPublicSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetPermissionPublicResp resp = client.drive().permissionPublic().get(req); + GetPermissionPublicResp resp = client.drive().v1().permissionPublic().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetSubscribeFileSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetSubscribeFileSample.java index 4384ba8cb..cdae86b10 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetSubscribeFileSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/GetSubscribeFileSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetSubscribeFileResp resp = client.drive().file().getSubscribe(req); + GetSubscribeFileResp resp = client.drive().v1().file().getSubscribe(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileCommentReplySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileCommentReplySample.java index bdcc5a1b1..890665cd3 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileCommentReplySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileCommentReplySample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListFileCommentReplyResp resp = client.drive().fileCommentReply().list(req); + ListFileCommentReplyResp resp = client.drive().v1().fileCommentReply().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileCommentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileCommentSample.java index e03c262f9..418eab0b6 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileCommentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileCommentSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListFileCommentResp resp = client.drive().fileComment().list(req); + ListFileCommentResp resp = client.drive().v1().fileComment().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileSample.java index 9492cd92a..2e82c99de 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListFileResp resp = client.drive().file().list(req); + ListFileResp resp = client.drive().v1().file().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileVersionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileVersionSample.java index 17914242f..e0175942d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileVersionSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileVersionSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListFileVersionResp resp = client.drive().fileVersion().list(req); + ListFileVersionResp resp = client.drive().v1().fileVersion().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileViewRecordSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileViewRecordSample.java index 2c4fa9b36..5d826381c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileViewRecordSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListFileViewRecordSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListFileViewRecordResp resp = client.drive().fileViewRecord().list(req); + ListFileViewRecordResp resp = client.drive().v1().fileViewRecord().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListPermissionMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListPermissionMemberSample.java index c3048efb9..2e06f88e7 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListPermissionMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/ListPermissionMemberSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListPermissionMemberResp resp = client.drive().permissionMember().list(req); + ListPermissionMemberResp resp = client.drive().v1().permissionMember().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/MoveFileSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/MoveFileSample.java index 07ce2710b..1d8779628 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/MoveFileSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/MoveFileSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - MoveFileResp resp = client.drive().file().move(req); + MoveFileResp resp = client.drive().v1().file().move(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/PatchFileCommentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/PatchFileCommentSample.java index b1113aab2..962720994 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/PatchFileCommentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/PatchFileCommentSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchFileCommentResp resp = client.drive().fileComment().patch(req); + PatchFileCommentResp resp = client.drive().v1().fileComment().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/PatchFileSubscriptionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/PatchFileSubscriptionSample.java index 126b32632..f46385cdb 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/PatchFileSubscriptionSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/PatchFileSubscriptionSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchFileSubscriptionResp resp = client.drive().fileSubscription().patch(req); + PatchFileSubscriptionResp resp = client.drive().v1().fileSubscription().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/PatchPermissionPublicSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/PatchPermissionPublicSample.java index f5972fd0f..b2fe8d649 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/PatchPermissionPublicSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/PatchPermissionPublicSample.java @@ -28,7 +28,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchPermissionPublicResp resp = client.drive().permissionPublic().patch(req); + PatchPermissionPublicResp resp = client.drive().v1().permissionPublic().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/SubscribeFileSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/SubscribeFileSample.java index 6a2b9fbbf..9b177199d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/SubscribeFileSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/SubscribeFileSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SubscribeFileResp resp = client.drive().file().subscribe(req); + SubscribeFileResp resp = client.drive().v1().file().subscribe(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/TaskCheckFileSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/TaskCheckFileSample.java index 0234d2eb3..5f37ad9c5 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/TaskCheckFileSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/TaskCheckFileSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - TaskCheckFileResp resp = client.drive().file().taskCheck(req); + TaskCheckFileResp resp = client.drive().v1().file().taskCheck(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/TransferOwnerPermissionMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/TransferOwnerPermissionMemberSample.java index 4d72d8088..af241d065 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/TransferOwnerPermissionMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/TransferOwnerPermissionMemberSample.java @@ -28,7 +28,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - TransferOwnerPermissionMemberResp resp = client.drive().permissionMember().transferOwner(req); + TransferOwnerPermissionMemberResp resp = client.drive().v1().permissionMember().transferOwner(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UpdateFileCommentReplySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UpdateFileCommentReplySample.java index 6c95958b1..843947e09 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UpdateFileCommentReplySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UpdateFileCommentReplySample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateFileCommentReplyResp resp = client.drive().fileCommentReply().update(req); + UpdateFileCommentReplyResp resp = client.drive().v1().fileCommentReply().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UpdatePermissionMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UpdatePermissionMemberSample.java index 6ceabacf0..be479c5ec 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UpdatePermissionMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UpdatePermissionMemberSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdatePermissionMemberResp resp = client.drive().permissionMember().update(req); + UpdatePermissionMemberResp resp = client.drive().v1().permissionMember().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UpdatePermissionPublicPasswordSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UpdatePermissionPublicPasswordSample.java index b4afac195..8d0071e82 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UpdatePermissionPublicPasswordSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UpdatePermissionPublicPasswordSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdatePermissionPublicPasswordResp resp = client.drive().permissionPublicPassword().update(req); + UpdatePermissionPublicPasswordResp resp = client.drive().v1().permissionPublicPassword().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadAllFileSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadAllFileSample.java index 6d3f1a027..08b3c4ec3 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadAllFileSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadAllFileSample.java @@ -29,7 +29,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UploadAllFileResp resp = client.drive().file().uploadAll(req); + UploadAllFileResp resp = client.drive().v1().file().uploadAll(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadAllMediaSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadAllMediaSample.java index a3299fad5..164be4986 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadAllMediaSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadAllMediaSample.java @@ -30,7 +30,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UploadAllMediaResp resp = client.drive().media().uploadAll(req); + UploadAllMediaResp resp = client.drive().v1().media().uploadAll(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadFinishFileSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadFinishFileSample.java index 04eeb0cdc..9ea8496e8 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadFinishFileSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadFinishFileSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UploadFinishFileResp resp = client.drive().file().uploadFinish(req); + UploadFinishFileResp resp = client.drive().v1().file().uploadFinish(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadFinishMediaSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadFinishMediaSample.java index 897da83a8..09cf9f32a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadFinishMediaSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadFinishMediaSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UploadFinishMediaResp resp = client.drive().media().uploadFinish(req); + UploadFinishMediaResp resp = client.drive().v1().media().uploadFinish(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPartFileSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPartFileSample.java index f8a534324..744af6f29 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPartFileSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPartFileSample.java @@ -28,7 +28,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UploadPartFileResp resp = client.drive().file().uploadPart(req); + UploadPartFileResp resp = client.drive().v1().file().uploadPart(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPartMediaSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPartMediaSample.java index fbc9b5e4b..41ffb5239 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPartMediaSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPartMediaSample.java @@ -28,7 +28,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UploadPartMediaResp resp = client.drive().media().uploadPart(req); + UploadPartMediaResp resp = client.drive().v1().media().uploadPart(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPrepareFileSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPrepareFileSample.java index 558ed835d..9d156f60f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPrepareFileSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPrepareFileSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UploadPrepareFileResp resp = client.drive().file().uploadPrepare(req); + UploadPrepareFileResp resp = client.drive().v1().file().uploadPrepare(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPrepareMediaSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPrepareMediaSample.java index 1113fcef0..8a8d9970c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPrepareMediaSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev1/UploadPrepareMediaSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UploadPrepareMediaResp resp = client.drive().media().uploadPrepare(req); + UploadPrepareMediaResp resp = client.drive().v1().media().uploadPrepare(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev2/GetPermissionPublicSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev2/GetPermissionPublicSample.java new file mode 100644 index 000000000..2ae7ff30e --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev2/GetPermissionPublicSample.java @@ -0,0 +1,34 @@ +package com.lark.oapi.sample.apiall.drivev2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.drive.v2.model.GetPermissionPublicReq; +import com.lark.oapi.service.drive.v2.model.GetPermissionPublicResp; + +// GET /open-apis/drive/v2/permissions/:token/public +public class GetPermissionPublicSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + GetPermissionPublicReq req = GetPermissionPublicReq.newBuilder() + .token("doccnBKgoMyY5OMbUG6FioTXuBe") + .type("doc") + .build(); + + // 发起请求 + GetPermissionPublicResp resp = client.drive().v2().permissionPublic().get(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/drivev2/PatchPermissionPublicSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev2/PatchPermissionPublicSample.java new file mode 100644 index 000000000..edc9423a4 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/drivev2/PatchPermissionPublicSample.java @@ -0,0 +1,44 @@ +package com.lark.oapi.sample.apiall.drivev2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.drive.v2.model.PatchPermissionPublicReq; +import com.lark.oapi.service.drive.v2.model.PatchPermissionPublicResp; +import com.lark.oapi.service.drive.v2.model.PermissionPublic; + +// PATCH /open-apis/drive/v2/permissions/:token/public +public class PatchPermissionPublicSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + PatchPermissionPublicReq req = PatchPermissionPublicReq.newBuilder() + .token("doccnBKgoMyY5OMbUG6FioTXuBe") + .type("doc") + .permissionPublic(PermissionPublic.newBuilder() + .externalAccessEntity("open") + .securityEntity("anyone_can_view") + .commentEntity("anyone_can_view") + .shareEntity("anyone") + .manageCollaboratorEntity("collaborator_can_view") + .linkShareEntity("tenant_readable") + .copyEntity("anyone_can_view") + .build()) + .build(); + + // 发起请求 + PatchPermissionPublicResp resp = client.drive().v2().permissionPublic().patch(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/ehrv1/GetAttachmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/ehrv1/GetAttachmentSample.java index 1d851dd05..41124703f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/ehrv1/GetAttachmentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/ehrv1/GetAttachmentSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetAttachmentResp resp = client.ehr().attachment().get(req); + GetAttachmentResp resp = client.ehr().v1().attachment().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/ehrv1/ListEmployeeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/ehrv1/ListEmployeeSample.java index 73d9dac59..283a40295 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/ehrv1/ListEmployeeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/ehrv1/ListEmployeeSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListEmployeeResp resp = client.ehr().employee().list(req); + ListEmployeeResp resp = client.ehr().v1().employee().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/eventv1/ListOutboundIpSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/eventv1/ListOutboundIpSample.java index 874d5bdd3..e7f406bf8 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/eventv1/ListOutboundIpSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/eventv1/ListOutboundIpSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListOutboundIpResp resp = client.event().outboundIp().list(req); + ListOutboundIpResp resp = client.event().v1().outboundIp().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/gray_test_open_sgv1/CreateMotoSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/gray_test_open_sgv1/CreateMotoSample.java index cc45dc3f5..ef4031de4 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/gray_test_open_sgv1/CreateMotoSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/gray_test_open_sgv1/CreateMotoSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateMotoResp resp = client.grayTestOpenSg().moto().create(req); + CreateMotoResp resp = client.grayTestOpenSg().v1().moto().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/gray_test_open_sgv1/GetMotoSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/gray_test_open_sgv1/GetMotoSample.java index 7aab08ec2..21f6fbc53 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/gray_test_open_sgv1/GetMotoSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/gray_test_open_sgv1/GetMotoSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetMotoResp resp = client.grayTestOpenSg().moto().get(req); + GetMotoResp resp = client.grayTestOpenSg().v1().moto().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/gray_test_open_sgv1/ListMotoSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/gray_test_open_sgv1/ListMotoSample.java index 669aa9841..3b271bb10 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/gray_test_open_sgv1/ListMotoSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/gray_test_open_sgv1/ListMotoSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListMotoResp resp = client.grayTestOpenSg().moto().list(req); + ListMotoResp resp = client.grayTestOpenSg().v1().moto().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/AnswerUserQueryTicketSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/AnswerUserQueryTicketSample.java index a0a6a9e2d..b14006e81 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/AnswerUserQueryTicketSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/AnswerUserQueryTicketSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - AnswerUserQueryTicketResp resp = client.helpdesk().ticket().answerUserQuery(req); + AnswerUserQueryTicketResp resp = client.helpdesk().v1().ticket().answerUserQuery(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CancelApproveNotificationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CancelApproveNotificationSample.java index c5f112240..dd0240c2f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CancelApproveNotificationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CancelApproveNotificationSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CancelApproveNotificationResp resp = client.helpdesk().notification().cancelApprove(req); + CancelApproveNotificationResp resp = client.helpdesk().v1().notification().cancelApprove(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CancelSendNotificationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CancelSendNotificationSample.java index cb8095508..0b9a360fa 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CancelSendNotificationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CancelSendNotificationSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CancelSendNotificationResp resp = client.helpdesk().notification().cancelSend(req); + CancelSendNotificationResp resp = client.helpdesk().v1().notification().cancelSend(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateAgentScheduleSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateAgentScheduleSample.java index 294b7835e..3319bd2f8 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateAgentScheduleSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateAgentScheduleSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateAgentScheduleResp resp = client.helpdesk().agentSchedule().create(req); + CreateAgentScheduleResp resp = client.helpdesk().v1().agentSchedule().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateAgentSkillSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateAgentSkillSample.java index ad51453e0..74459a4b1 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateAgentSkillSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateAgentSkillSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateAgentSkillResp resp = client.helpdesk().agentSkill().create(req); + CreateAgentSkillResp resp = client.helpdesk().v1().agentSkill().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateBotMessageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateBotMessageSample.java index be7fbf480..6cc461624 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateBotMessageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateBotMessageSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateBotMessageResp resp = client.helpdesk().botMessage().create(req); + CreateBotMessageResp resp = client.helpdesk().v1().botMessage().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateCategorySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateCategorySample.java index b7912932f..f0b343425 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateCategorySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateCategorySample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateCategoryResp resp = client.helpdesk().category().create(req); + CreateCategoryResp resp = client.helpdesk().v1().category().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateFaqSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateFaqSample.java index bb0df288c..01993fd9b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateFaqSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateFaqSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateFaqResp resp = client.helpdesk().faq().create(req); + CreateFaqResp resp = client.helpdesk().v1().faq().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateNotificationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateNotificationSample.java index 9780f65ab..4ecb48c7b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateNotificationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateNotificationSample.java @@ -39,7 +39,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateNotificationResp resp = client.helpdesk().notification().create(req); + CreateNotificationResp resp = client.helpdesk().v1().notification().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateTicketCustomizedFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateTicketCustomizedFieldSample.java index 53f477726..ecc675d05 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateTicketCustomizedFieldSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateTicketCustomizedFieldSample.java @@ -30,7 +30,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateTicketCustomizedFieldResp resp = client.helpdesk().ticketCustomizedField().create(req); + CreateTicketCustomizedFieldResp resp = client.helpdesk().v1().ticketCustomizedField().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateTicketMessageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateTicketMessageSample.java index c9656afd1..8858c22a1 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateTicketMessageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateTicketMessageSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateTicketMessageResp resp = client.helpdesk().ticketMessage().create(req); + CreateTicketMessageResp resp = client.helpdesk().v1().ticketMessage().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CustomizedFieldsTicketSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CustomizedFieldsTicketSample.java index b833645e8..278d54a02 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CustomizedFieldsTicketSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CustomizedFieldsTicketSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CustomizedFieldsTicketResp resp = client.helpdesk().ticket().customizedFields(req); + CustomizedFieldsTicketResp resp = client.helpdesk().v1().ticket().customizedFields(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteAgentSchedulesSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteAgentSchedulesSample.java index 34d90a5ce..89bfe7748 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteAgentSchedulesSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteAgentSchedulesSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteAgentSchedulesResp resp = client.helpdesk().agentSchedules().delete(req); + DeleteAgentSchedulesResp resp = client.helpdesk().v1().agentSchedules().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteAgentSkillSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteAgentSkillSample.java index 6e766d920..e42b4b0bc 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteAgentSkillSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteAgentSkillSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteAgentSkillResp resp = client.helpdesk().agentSkill().delete(req); + DeleteAgentSkillResp resp = client.helpdesk().v1().agentSkill().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteCategorySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteCategorySample.java index 07051413f..35bc70779 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteCategorySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteCategorySample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteCategoryResp resp = client.helpdesk().category().delete(req); + DeleteCategoryResp resp = client.helpdesk().v1().category().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteFaqSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteFaqSample.java index 5a0e7b476..598b64f0c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteFaqSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteFaqSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteFaqResp resp = client.helpdesk().faq().delete(req); + DeleteFaqResp resp = client.helpdesk().v1().faq().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteTicketCustomizedFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteTicketCustomizedFieldSample.java index 4ddefc3a0..9b8ff91de 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteTicketCustomizedFieldSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/DeleteTicketCustomizedFieldSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteTicketCustomizedFieldResp resp = client.helpdesk().ticketCustomizedField().delete(req); + DeleteTicketCustomizedFieldResp resp = client.helpdesk().v1().ticketCustomizedField().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ExecuteSendNotificationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ExecuteSendNotificationSample.java index e93085bc2..6396feed7 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ExecuteSendNotificationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ExecuteSendNotificationSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ExecuteSendNotificationResp resp = client.helpdesk().notification().executeSend(req); + ExecuteSendNotificationResp resp = client.helpdesk().v1().notification().executeSend(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/FaqImageFaqSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/FaqImageFaqSample.java index 41bf20e1d..d22cb32fa 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/FaqImageFaqSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/FaqImageFaqSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - FaqImageFaqResp resp = client.helpdesk().faq().faqImage(req); + FaqImageFaqResp resp = client.helpdesk().v1().faq().faqImage(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetAgentSchedulesSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetAgentSchedulesSample.java index eadbeb559..8db60a463 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetAgentSchedulesSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetAgentSchedulesSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetAgentSchedulesResp resp = client.helpdesk().agentSchedules().get(req); + GetAgentSchedulesResp resp = client.helpdesk().v1().agentSchedules().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetAgentSkillSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetAgentSkillSample.java index c9fe8ea5a..22269c9a3 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetAgentSkillSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetAgentSkillSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetAgentSkillResp resp = client.helpdesk().agentSkill().get(req); + GetAgentSkillResp resp = client.helpdesk().v1().agentSkill().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetCategorySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetCategorySample.java index 5eb79ac0e..4ba8f87e0 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetCategorySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetCategorySample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetCategoryResp resp = client.helpdesk().category().get(req); + GetCategoryResp resp = client.helpdesk().v1().category().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetFaqSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetFaqSample.java index 68d6e3868..a9e038767 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetFaqSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetFaqSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetFaqResp resp = client.helpdesk().faq().get(req); + GetFaqResp resp = client.helpdesk().v1().faq().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetNotificationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetNotificationSample.java index 9a1609a8b..96c93e231 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetNotificationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetNotificationSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetNotificationResp resp = client.helpdesk().notification().get(req); + GetNotificationResp resp = client.helpdesk().v1().notification().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetTicketCustomizedFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetTicketCustomizedFieldSample.java index 2ba281253..8df9c20f9 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetTicketCustomizedFieldSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetTicketCustomizedFieldSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetTicketCustomizedFieldResp resp = client.helpdesk().ticketCustomizedField().get(req); + GetTicketCustomizedFieldResp resp = client.helpdesk().v1().ticketCustomizedField().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetTicketSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetTicketSample.java index 9d40a4f05..2b8b03ec7 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetTicketSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetTicketSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetTicketResp resp = client.helpdesk().ticket().get(req); + GetTicketResp resp = client.helpdesk().v1().ticket().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListAgentScheduleSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListAgentScheduleSample.java index facd9ace8..483cc5f91 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListAgentScheduleSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListAgentScheduleSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListAgentScheduleResp resp = client.helpdesk().agentSchedule().list(req); + ListAgentScheduleResp resp = client.helpdesk().v1().agentSchedule().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListCategorySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListCategorySample.java index 84ec01fae..e1ee26334 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListCategorySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListCategorySample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListCategoryResp resp = client.helpdesk().category().list(req); + ListCategoryResp resp = client.helpdesk().v1().category().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListFaqSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListFaqSample.java index f373447f5..56248ed1a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListFaqSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListFaqSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListFaqResp resp = client.helpdesk().faq().list(req); + ListFaqResp resp = client.helpdesk().v1().faq().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListTicketCustomizedFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListTicketCustomizedFieldSample.java index 4dffe7401..a3df11dd8 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListTicketCustomizedFieldSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListTicketCustomizedFieldSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListTicketCustomizedFieldResp resp = client.helpdesk().ticketCustomizedField().list(req); + ListTicketCustomizedFieldResp resp = client.helpdesk().v1().ticketCustomizedField().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListTicketMessageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListTicketMessageSample.java index ec837bc79..bee22f7f5 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListTicketMessageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListTicketMessageSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListTicketMessageResp resp = client.helpdesk().ticketMessage().list(req); + ListTicketMessageResp resp = client.helpdesk().v1().ticketMessage().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListTicketSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListTicketSample.java index f1f518714..4838338d4 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListTicketSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ListTicketSample.java @@ -34,7 +34,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListTicketResp resp = client.helpdesk().ticket().list(req); + ListTicketResp resp = client.helpdesk().v1().ticket().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchAgentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchAgentSample.java index a672b2564..6f1b074a5 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchAgentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchAgentSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchAgentResp resp = client.helpdesk().agent().patch(req); + PatchAgentResp resp = client.helpdesk().v1().agent().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchAgentSchedulesSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchAgentSchedulesSample.java index 602290dbf..c9935f30b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchAgentSchedulesSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchAgentSchedulesSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchAgentSchedulesResp resp = client.helpdesk().agentSchedules().patch(req); + PatchAgentSchedulesResp resp = client.helpdesk().v1().agentSchedules().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchAgentSkillSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchAgentSkillSample.java index 900ecfee4..d8727e7e8 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchAgentSkillSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchAgentSkillSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchAgentSkillResp resp = client.helpdesk().agentSkill().patch(req); + PatchAgentSkillResp resp = client.helpdesk().v1().agentSkill().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchCategorySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchCategorySample.java index 3a7f6eb6d..9fbba9b5c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchCategorySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchCategorySample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchCategoryResp resp = client.helpdesk().category().patch(req); + PatchCategoryResp resp = client.helpdesk().v1().category().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchFaqSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchFaqSample.java index 4893d553d..7cae9196d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchFaqSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchFaqSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchFaqResp resp = client.helpdesk().faq().patch(req); + PatchFaqResp resp = client.helpdesk().v1().faq().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchNotificationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchNotificationSample.java index c7fba15d1..9a37b468d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchNotificationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchNotificationSample.java @@ -40,7 +40,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchNotificationResp resp = client.helpdesk().notification().patch(req); + PatchNotificationResp resp = client.helpdesk().v1().notification().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchTicketCustomizedFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchTicketCustomizedFieldSample.java index a9c318756..5d6aea56b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchTicketCustomizedFieldSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchTicketCustomizedFieldSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchTicketCustomizedFieldResp resp = client.helpdesk().ticketCustomizedField().patch(req); + PatchTicketCustomizedFieldResp resp = client.helpdesk().v1().ticketCustomizedField().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PreviewNotificationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PreviewNotificationSample.java index eaaf8754c..106fe65bb 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PreviewNotificationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PreviewNotificationSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PreviewNotificationResp resp = client.helpdesk().notification().preview(req); + PreviewNotificationResp resp = client.helpdesk().v1().notification().preview(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/SearchFaqSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/SearchFaqSample.java index 1651a8f56..1d19f06a6 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/SearchFaqSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/SearchFaqSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SearchFaqResp resp = client.helpdesk().faq().search(req); + SearchFaqResp resp = client.helpdesk().v1().faq().search(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/StartServiceTicketSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/StartServiceTicketSample.java index caf403617..de6ed3b15 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/StartServiceTicketSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/StartServiceTicketSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - StartServiceTicketResp resp = client.helpdesk().ticket().startService(req); + StartServiceTicketResp resp = client.helpdesk().v1().ticket().startService(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/SubmitApproveNotificationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/SubmitApproveNotificationSample.java index fe2d897d9..55144a1ec 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/SubmitApproveNotificationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/SubmitApproveNotificationSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SubmitApproveNotificationResp resp = client.helpdesk().notification().submitApprove(req); + SubmitApproveNotificationResp resp = client.helpdesk().v1().notification().submitApprove(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/SubscribeEventSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/SubscribeEventSample.java index 852fd100c..a1561e716 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/SubscribeEventSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/SubscribeEventSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SubscribeEventResp resp = client.helpdesk().event().subscribe(req); + SubscribeEventResp resp = client.helpdesk().v1().event().subscribe(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/TicketImageTicketSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/TicketImageTicketSample.java index 6d5734abd..a7e246769 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/TicketImageTicketSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/TicketImageTicketSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - TicketImageTicketResp resp = client.helpdesk().ticket().ticketImage(req); + TicketImageTicketResp resp = client.helpdesk().v1().ticket().ticketImage(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/UnsubscribeEventSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/UnsubscribeEventSample.java index 2ef3df5cd..ef8bba3ff 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/UnsubscribeEventSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/UnsubscribeEventSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UnsubscribeEventResp resp = client.helpdesk().event().unsubscribe(req); + UnsubscribeEventResp resp = client.helpdesk().v1().event().unsubscribe(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/UpdateTicketSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/UpdateTicketSample.java index fe041f4b5..ef2ef289f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/UpdateTicketSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/UpdateTicketSample.java @@ -29,7 +29,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateTicketResp resp = client.helpdesk().ticket().update(req); + UpdateTicketResp resp = client.helpdesk().v1().ticket().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/AddToFolderTalentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/AddToFolderTalentSample.java index 4ad647f2d..2d051ee2d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/AddToFolderTalentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/AddToFolderTalentSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - AddToFolderTalentResp resp = client.hire().talent().addToFolder(req); + AddToFolderTalentResp resp = client.hire().v1().talent().addToFolder(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoAccountCustomFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoAccountCustomFieldSample.java index 73946c83e..07512e841 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoAccountCustomFieldSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoAccountCustomFieldSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchDeleteEcoAccountCustomFieldResp resp = client.hire().ecoAccountCustomField().batchDelete(req); + BatchDeleteEcoAccountCustomFieldResp resp = client.hire().v1().ecoAccountCustomField().batchDelete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoBackgroundCheckCustomFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoBackgroundCheckCustomFieldSample.java index 0d94f9ed9..1ace0cb05 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoBackgroundCheckCustomFieldSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoBackgroundCheckCustomFieldSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchDeleteEcoBackgroundCheckCustomFieldResp resp = client.hire().ecoBackgroundCheckCustomField().batchDelete(req); + BatchDeleteEcoBackgroundCheckCustomFieldResp resp = client.hire().v1().ecoBackgroundCheckCustomField().batchDelete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoBackgroundCheckPackageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoBackgroundCheckPackageSample.java index 5dba7d22e..458ffae4a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoBackgroundCheckPackageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoBackgroundCheckPackageSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchDeleteEcoBackgroundCheckPackageResp resp = client.hire().ecoBackgroundCheckPackage().batchDelete(req); + BatchDeleteEcoBackgroundCheckPackageResp resp = client.hire().v1().ecoBackgroundCheckPackage().batchDelete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoExamPaperSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoExamPaperSample.java index 5fcd70916..45a8444ab 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoExamPaperSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoExamPaperSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchDeleteEcoExamPaperResp resp = client.hire().ecoExamPaper().batchDelete(req); + BatchDeleteEcoExamPaperResp resp = client.hire().v1().ecoExamPaper().batchDelete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchGetIdTalentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchGetIdTalentSample.java index ebd27c06d..6133427c9 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchGetIdTalentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchGetIdTalentSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchGetIdTalentResp resp = client.hire().talent().batchGetId(req); + BatchGetIdTalentResp resp = client.hire().v1().talent().batchGetId(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoAccountCustomFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoAccountCustomFieldSample.java index d7506e156..ae2c99ce5 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoAccountCustomFieldSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoAccountCustomFieldSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchUpdateEcoAccountCustomFieldResp resp = client.hire().ecoAccountCustomField().batchUpdate(req); + BatchUpdateEcoAccountCustomFieldResp resp = client.hire().v1().ecoAccountCustomField().batchUpdate(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoBackgroundCheckCustomFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoBackgroundCheckCustomFieldSample.java index f83e803f5..777b27883 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoBackgroundCheckCustomFieldSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoBackgroundCheckCustomFieldSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchUpdateEcoBackgroundCheckCustomFieldResp resp = client.hire().ecoBackgroundCheckCustomField().batchUpdate(req); + BatchUpdateEcoBackgroundCheckCustomFieldResp resp = client.hire().v1().ecoBackgroundCheckCustomField().batchUpdate(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoBackgroundCheckPackageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoBackgroundCheckPackageSample.java index 437f020a9..80a50c2e0 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoBackgroundCheckPackageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoBackgroundCheckPackageSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchUpdateEcoBackgroundCheckPackageResp resp = client.hire().ecoBackgroundCheckPackage().batchUpdate(req); + BatchUpdateEcoBackgroundCheckPackageResp resp = client.hire().v1().ecoBackgroundCheckPackage().batchUpdate(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoExamPaperSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoExamPaperSample.java index ea777f2aa..faf69e2f7 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoExamPaperSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoExamPaperSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchUpdateEcoExamPaperResp resp = client.hire().ecoExamPaper().batchUpdate(req); + BatchUpdateEcoExamPaperResp resp = client.hire().v1().ecoExamPaper().batchUpdate(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CancelEcoBackgroundCheckSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CancelEcoBackgroundCheckSample.java index 0a1c08d69..92d3700e5 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CancelEcoBackgroundCheckSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CancelEcoBackgroundCheckSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CancelEcoBackgroundCheckResp resp = client.hire().ecoBackgroundCheck().cancel(req); + CancelEcoBackgroundCheckResp resp = client.hire().v1().ecoBackgroundCheck().cancel(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CombinedCreateJobSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CombinedCreateJobSample.java index 61ed7e256..390299a07 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CombinedCreateJobSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CombinedCreateJobSample.java @@ -15,6 +15,8 @@ public static void main(String arg[]) throws Exception { CombinedCreateJobReq req = CombinedCreateJobReq.newBuilder() .userIdType("open_id") .departmentIdType("open_department_id") + .jobLevelIdType("people_admin_job_level_id") + .jobFamilyIdType("people_admin_job_category_id") .combinedJob(CombinedJob.newBuilder() .code("R18") .experience(1) @@ -50,7 +52,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CombinedCreateJobResp resp = client.hire().job().combinedCreate(req); + CombinedCreateJobResp resp = client.hire().v1().job().combinedCreate(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CombinedUpdateJobSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CombinedUpdateJobSample.java index 8b20168df..e9e34e38a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CombinedUpdateJobSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CombinedUpdateJobSample.java @@ -16,6 +16,8 @@ public static void main(String arg[]) throws Exception { .jobId("6960663240925956660") .userIdType("open_id") .departmentIdType("open_department_id") + .jobLevelIdType("people_admin_job_level_id") + .jobFamilyIdType("people_admin_job_category_id") .combinedJob(CombinedJob.newBuilder() .id("6960663240925956576") .experience(1) @@ -47,7 +49,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CombinedUpdateJobResp resp = client.hire().job().combinedUpdate(req); + CombinedUpdateJobResp resp = client.hire().v1().job().combinedUpdate(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ConfigJobSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ConfigJobSample.java index 1d7c88900..6b73af274 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ConfigJobSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ConfigJobSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ConfigJobResp resp = client.hire().job().config(req); + ConfigJobResp resp = client.hire().v1().job().config(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateApplicationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateApplicationSample.java index a3b57a8be..9ed0cce58 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateApplicationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateApplicationSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateApplicationResp resp = client.hire().application().create(req); + CreateApplicationResp resp = client.hire().v1().application().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoAccountCustomFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoAccountCustomFieldSample.java index d8477a5c1..2151cd4ce 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoAccountCustomFieldSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoAccountCustomFieldSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateEcoAccountCustomFieldResp resp = client.hire().ecoAccountCustomField().create(req); + CreateEcoAccountCustomFieldResp resp = client.hire().v1().ecoAccountCustomField().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoBackgroundCheckCustomFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoBackgroundCheckCustomFieldSample.java index 91844ab4f..19d4259d3 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoBackgroundCheckCustomFieldSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoBackgroundCheckCustomFieldSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateEcoBackgroundCheckCustomFieldResp resp = client.hire().ecoBackgroundCheckCustomField().create(req); + CreateEcoBackgroundCheckCustomFieldResp resp = client.hire().v1().ecoBackgroundCheckCustomField().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoBackgroundCheckPackageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoBackgroundCheckPackageSample.java index 36243487b..c0f205a62 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoBackgroundCheckPackageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoBackgroundCheckPackageSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateEcoBackgroundCheckPackageResp resp = client.hire().ecoBackgroundCheckPackage().create(req); + CreateEcoBackgroundCheckPackageResp resp = client.hire().v1().ecoBackgroundCheckPackage().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoExamPaperSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoExamPaperSample.java index 57a9b3e4b..43029b3c6 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoExamPaperSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoExamPaperSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateEcoExamPaperResp resp = client.hire().ecoExamPaper().create(req); + CreateEcoExamPaperResp resp = client.hire().v1().ecoExamPaper().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalApplicationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalApplicationSample.java index aa97c7380..f6aa43463 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalApplicationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalApplicationSample.java @@ -29,7 +29,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateExternalApplicationResp resp = client.hire().externalApplication().create(req); + CreateExternalApplicationResp resp = client.hire().v1().externalApplication().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalBackgroundCheckSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalBackgroundCheckSample.java index 956534db3..042ea05d3 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalBackgroundCheckSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalBackgroundCheckSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateExternalBackgroundCheckResp resp = client.hire().externalBackgroundCheck().create(req); + CreateExternalBackgroundCheckResp resp = client.hire().v1().externalBackgroundCheck().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalInterviewAssessmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalInterviewAssessmentSample.java index 707f3e469..e7d702003 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalInterviewAssessmentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalInterviewAssessmentSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateExternalInterviewAssessmentResp resp = client.hire().externalInterviewAssessment().create(req); + CreateExternalInterviewAssessmentResp resp = client.hire().v1().externalInterviewAssessment().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalInterviewSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalInterviewSample.java index 6f1aa9106..f3ebf1d9d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalInterviewSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateExternalInterviewSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateExternalInterviewResp resp = client.hire().externalInterview().create(req); + CreateExternalInterviewResp resp = client.hire().v1().externalInterview().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateJobRequirementSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateJobRequirementSample.java index 42c712e71..f051e759e 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateJobRequirementSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateJobRequirementSample.java @@ -18,6 +18,9 @@ public static void main(String arg[]) throws Exception { CreateJobRequirementReq req = CreateJobRequirementReq.newBuilder() .userIdType("open_id") .departmentIdType("open_department_id") + .jobLevelIdType("people_admin_job_level_id") + .jobFamilyIdType("people_admin_job_category_id") + .employeeTypeIdType("people_admin_employee_type_id") .jobRequirement(JobRequirement.newBuilder() .shortCode("xx1") .name("test") @@ -48,7 +51,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateJobRequirementResp resp = client.hire().jobRequirement().create(req); + CreateJobRequirementResp resp = client.hire().v1().jobRequirement().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateNoteSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateNoteSample.java index bbac9517a..7dc258572 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateNoteSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateNoteSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateNoteResp resp = client.hire().note().create(req); + CreateNoteResp resp = client.hire().v1().note().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateOfferSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateOfferSample.java index 74cfacbe7..7ac7924ad 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateOfferSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateOfferSample.java @@ -15,6 +15,9 @@ public static void main(String arg[]) throws Exception { CreateOfferReq req = CreateOfferReq.newBuilder() .userIdType("open_id") .departmentIdType("open_department_id") + .jobLevelIdType("people_admin_job_level_id") + .jobFamilyIdType("people_admin_job_category_id") + .employeeTypeIdType("people_admin_employee_type_id") .offerInfo(OfferInfo.newBuilder() .applicationId("7013552389293279532") .schemaId("7013318077945596204") @@ -26,7 +29,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateOfferResp resp = client.hire().offer().create(req); + CreateOfferResp resp = client.hire().v1().offer().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateReferralAccountSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateReferralAccountSample.java index 5b05a13d3..9e3fb8456 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateReferralAccountSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateReferralAccountSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateReferralAccountResp resp = client.hire().referralAccount().create(req); + CreateReferralAccountResp resp = client.hire().v1().referralAccount().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/DeactivateReferralAccountSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/DeactivateReferralAccountSample.java index efdcf9ea6..c8c66a718 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/DeactivateReferralAccountSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/DeactivateReferralAccountSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeactivateReferralAccountResp resp = client.hire().referralAccount().deactivate(req); + DeactivateReferralAccountResp resp = client.hire().v1().referralAccount().deactivate(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/DeleteExternalApplicationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/DeleteExternalApplicationSample.java index d3579d758..f71c1843c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/DeleteExternalApplicationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/DeleteExternalApplicationSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteExternalApplicationResp resp = client.hire().externalApplication().delete(req); + DeleteExternalApplicationResp resp = client.hire().v1().externalApplication().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/DeleteJobRequirementSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/DeleteJobRequirementSample.java index 10155d2bf..999ae396f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/DeleteJobRequirementSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/DeleteJobRequirementSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteJobRequirementResp resp = client.hire().jobRequirement().delete(req); + DeleteJobRequirementResp resp = client.hire().v1().jobRequirement().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetApplicationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetApplicationSample.java index 195bc0771..77caaeced 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetApplicationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetApplicationSample.java @@ -15,10 +15,11 @@ public static void main(String arg[]) throws Exception { // 创建请求对象 GetApplicationReq req = GetApplicationReq.newBuilder() .applicationId("6949805467799537964") + .options(new String[]{}) .build(); // 发起请求 - GetApplicationResp resp = client.hire().application().get(req); + GetApplicationResp resp = client.hire().v1().application().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetAttachmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetAttachmentSample.java index 1d0d8cb34..d23f02b5e 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetAttachmentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetAttachmentSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetAttachmentResp resp = client.hire().attachment().get(req); + GetAttachmentResp resp = client.hire().v1().attachment().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetByApplicationEmployeeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetByApplicationEmployeeSample.java index cd3133ffc..e89cd8d8f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetByApplicationEmployeeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetByApplicationEmployeeSample.java @@ -17,10 +17,13 @@ public static void main(String arg[]) throws Exception { .applicationId("123") .userIdType("open_id") .departmentIdType("people_admin_department_id") + .jobLevelIdType("people_admin_job_level_id") + .jobFamilyIdType("people_admin_job_category_id") + .employeeTypeIdType("people_admin_employee_type_id") .build(); // 发起请求 - GetByApplicationEmployeeResp resp = client.hire().employee().getByApplication(req); + GetByApplicationEmployeeResp resp = client.hire().v1().employee().getByApplication(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetByApplicationReferralSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetByApplicationReferralSample.java index f734c1405..9919dbcfb 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetByApplicationReferralSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetByApplicationReferralSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetByApplicationReferralResp resp = client.hire().referral().getByApplication(req); + GetByApplicationReferralResp resp = client.hire().v1().referral().getByApplication(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetEmployeeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetEmployeeSample.java index bdc887ce4..0f55033ab 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetEmployeeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetEmployeeSample.java @@ -17,10 +17,13 @@ public static void main(String arg[]) throws Exception { .employeeId("123") .userIdType("open_id") .departmentIdType("people_admin_department_id") + .jobLevelIdType("people_admin_job_level_id") + .jobFamilyIdType("people_admin_job_category_id") + .employeeTypeIdType("people_admin_employee_type_id") .build(); // 发起请求 - GetEmployeeResp resp = client.hire().employee().get(req); + GetEmployeeResp resp = client.hire().v1().employee().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetJobManagerSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetJobManagerSample.java index d95e1cdaf..31310a83b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetJobManagerSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetJobManagerSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetJobManagerResp resp = client.hire().jobManager().get(req); + GetJobManagerResp resp = client.hire().v1().jobManager().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetJobSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetJobSample.java index 9f9917e1e..1302d06b4 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetJobSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetJobSample.java @@ -17,10 +17,12 @@ public static void main(String arg[]) throws Exception { .jobId("6001") .userIdType("user_id") .departmentIdType("open_department_id") + .jobLevelIdType("people_admin_job_level_id") + .jobFamilyIdType("people_admin_job_category_id") .build(); // 发起请求 - GetJobResp resp = client.hire().job().get(req); + GetJobResp resp = client.hire().v1().job().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetNoteSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetNoteSample.java index e0e7ebe0c..c36ef88db 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetNoteSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetNoteSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetNoteResp resp = client.hire().note().get(req); + GetNoteResp resp = client.hire().v1().note().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetOfferSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetOfferSample.java index 5130475f3..a734cc14a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetOfferSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetOfferSample.java @@ -17,10 +17,13 @@ public static void main(String arg[]) throws Exception { .offerId("1111111") .userIdType("user_id") .departmentIdType("open_department_id") + .jobLevelIdType("people_admin_job_level_id") + .jobFamilyIdType("people_admin_job_category_id") + .employeeTypeIdType("people_admin_employee_type_id") .build(); // 发起请求 - GetOfferResp resp = client.hire().offer().get(req); + GetOfferResp resp = client.hire().v1().offer().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetOfferSchemaSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetOfferSchemaSample.java index e0eddb2cb..01321e477 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetOfferSchemaSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetOfferSchemaSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetOfferSchemaResp resp = client.hire().offerSchema().get(req); + GetOfferSchemaResp resp = client.hire().v1().offerSchema().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetReferralWebsiteJobPostSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetReferralWebsiteJobPostSample.java index 6b5e19d18..dfb1a3f1c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetReferralWebsiteJobPostSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetReferralWebsiteJobPostSample.java @@ -17,10 +17,11 @@ public static void main(String arg[]) throws Exception { .jobPostId("6701528341100366094") .userIdType("open_id") .departmentIdType("open_department_id") + .jobLevelIdType("people_admin_job_level_id") .build(); // 发起请求 - GetReferralWebsiteJobPostResp resp = client.hire().referralWebsiteJobPost().get(req); + GetReferralWebsiteJobPostResp resp = client.hire().v1().referralWebsiteJobPost().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetTalentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetTalentSample.java index 6f31c9bf5..fa49b40c4 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetTalentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/GetTalentSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetTalentResp resp = client.hire().talent().get(req); + GetTalentResp resp = client.hire().v1().talent().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/InternOfferStatusOfferSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/InternOfferStatusOfferSample.java index 197eeeaca..f2218e175 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/InternOfferStatusOfferSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/InternOfferStatusOfferSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - InternOfferStatusOfferResp resp = client.hire().offer().internOfferStatus(req); + InternOfferStatusOfferResp resp = client.hire().v1().offer().internOfferStatus(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListApplicationInterviewSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListApplicationInterviewSample.java index acbbe9ac6..c084ec449 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListApplicationInterviewSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListApplicationInterviewSample.java @@ -18,10 +18,11 @@ public static void main(String arg[]) throws Exception { .pageSize(10) .pageToken("xx") .userIdType("open_id") + .jobLevelIdType("people_admin_job_level_id") .build(); // 发起请求 - ListApplicationInterviewResp resp = client.hire().applicationInterview().list(req); + ListApplicationInterviewResp resp = client.hire().v1().applicationInterview().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListApplicationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListApplicationSample.java index 2cfea5622..1a9bf9e13 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListApplicationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListApplicationSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListApplicationResp resp = client.hire().application().list(req); + ListApplicationResp resp = client.hire().v1().application().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListByIdJobRequirementSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListByIdJobRequirementSample.java index 77ba8913c..61a4ab193 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListByIdJobRequirementSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListByIdJobRequirementSample.java @@ -17,13 +17,16 @@ public static void main(String arg[]) throws Exception { ListByIdJobRequirementReq req = ListByIdJobRequirementReq.newBuilder() .userIdType("open_id") .departmentIdType("open_department_id") + .jobLevelIdType("people_admin_job_level_id") + .jobFamilyIdType("people_admin_job_category_id") + .employeeTypeIdType("people_admin_employee_type_id") .listByIdJobRequirementReqBody(ListByIdJobRequirementReqBody.newBuilder() .idList(new String[]{}) .build()) .build(); // 发起请求 - ListByIdJobRequirementResp resp = client.hire().jobRequirement().listById(req); + ListByIdJobRequirementResp resp = client.hire().v1().jobRequirement().listById(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListEvaluationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListEvaluationSample.java index 12979572c..a5238b137 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListEvaluationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListEvaluationSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListEvaluationResp resp = client.hire().evaluation().list(req); + ListEvaluationResp resp = client.hire().v1().evaluation().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListInterviewSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListInterviewSample.java index 42443f3db..747e57221 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListInterviewSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListInterviewSample.java @@ -20,11 +20,12 @@ public static void main(String arg[]) throws Exception { .interviewId("6888217964693309704") .startTime("1609489908000") .endTime("1610489908000") + .jobLevelIdType("people_admin_job_level_id") .userIdType("user_id") .build(); // 发起请求 - ListInterviewResp resp = client.hire().interview().list(req); + ListInterviewResp resp = client.hire().v1().interview().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobProcessSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobProcessSample.java index 4535860b3..cec664b29 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobProcessSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobProcessSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListJobProcessResp resp = client.hire().jobProcess().list(req); + ListJobProcessResp resp = client.hire().v1().jobProcess().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobRequirementSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobRequirementSample.java index 73c0c2de5..6fe08933d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobRequirementSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobRequirementSample.java @@ -23,10 +23,13 @@ public static void main(String arg[]) throws Exception { .updateTimeEnd("1658980233000") .userIdType("open_id") .departmentIdType("open_department_id") + .jobLevelIdType("people_admin_job_level_id") + .jobFamilyIdType("people_admin_job_category_id") + .employeeTypeIdType("people_admin_employee_type_id") .build(); // 发起请求 - ListJobRequirementResp resp = client.hire().jobRequirement().list(req); + ListJobRequirementResp resp = client.hire().v1().jobRequirement().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobRequirementSchemaSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobRequirementSchemaSample.java index 4e41216c8..2004f6db7 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobRequirementSchemaSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobRequirementSchemaSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListJobRequirementSchemaResp resp = client.hire().jobRequirementSchema().list(req); + ListJobRequirementSchemaResp resp = client.hire().v1().jobRequirementSchema().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobTypeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobTypeSample.java index 08f12a482..f0e134df9 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobTypeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListJobTypeSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListJobTypeResp resp = client.hire().jobType().list(req); + ListJobTypeResp resp = client.hire().v1().jobType().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListNoteSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListNoteSample.java index 42cf2f1a1..6b593e2ad 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListNoteSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListNoteSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListNoteResp resp = client.hire().note().list(req); + ListNoteResp resp = client.hire().v1().note().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListOfferSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListOfferSample.java index 46bcf1f8f..6d8346486 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListOfferSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListOfferSample.java @@ -18,10 +18,11 @@ public static void main(String arg[]) throws Exception { .pageSize(1) .talentId("7096320678581242123") .userIdType("user_id") + .employeeTypeIdType("people_admin_employee_type_id") .build(); // 发起请求 - ListOfferResp resp = client.hire().offer().list(req); + ListOfferResp resp = client.hire().v1().offer().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListQuestionnaireSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListQuestionnaireSample.java index f47ff2aac..414caeb81 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListQuestionnaireSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListQuestionnaireSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListQuestionnaireResp resp = client.hire().questionnaire().list(req); + ListQuestionnaireResp resp = client.hire().v1().questionnaire().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListReferralWebsiteJobPostSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListReferralWebsiteJobPostSample.java index f0dbccc0e..029609e19 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListReferralWebsiteJobPostSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListReferralWebsiteJobPostSample.java @@ -19,10 +19,11 @@ public static void main(String arg[]) throws Exception { .pageSize(10) .userIdType("open_id") .departmentIdType("open_department_id") + .jobLevelIdType("people_admin_job_level_id") .build(); // 发起请求 - ListReferralWebsiteJobPostResp resp = client.hire().referralWebsiteJobPost().list(req); + ListReferralWebsiteJobPostResp resp = client.hire().v1().referralWebsiteJobPost().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListRegistrationSchemaSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListRegistrationSchemaSample.java index 88fba830d..a1d31359d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListRegistrationSchemaSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListRegistrationSchemaSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListRegistrationSchemaResp resp = client.hire().registrationSchema().list(req); + ListRegistrationSchemaResp resp = client.hire().v1().registrationSchema().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListResumeSourceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListResumeSourceSample.java index 28d987dd5..053268404 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListResumeSourceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListResumeSourceSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListResumeSourceResp resp = client.hire().resumeSource().list(req); + ListResumeSourceResp resp = client.hire().v1().resumeSource().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListTalentFolderSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListTalentFolderSample.java index 0138f261c..4856a22e8 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListTalentFolderSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ListTalentFolderSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListTalentFolderResp resp = client.hire().talentFolder().list(req); + ListTalentFolderResp resp = client.hire().v1().talentFolder().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/LoginInfoEcoExamSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/LoginInfoEcoExamSample.java index 699b03db7..f7d6b40c0 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/LoginInfoEcoExamSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/LoginInfoEcoExamSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - LoginInfoEcoExamResp resp = client.hire().ecoExam().loginInfo(req); + LoginInfoEcoExamResp resp = client.hire().v1().ecoExam().loginInfo(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/OfferApplicationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/OfferApplicationSample.java index 8531a1a9e..7edd0e988 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/OfferApplicationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/OfferApplicationSample.java @@ -17,10 +17,13 @@ public static void main(String arg[]) throws Exception { .applicationId("6949805467799537964") .userIdType("open_id") .departmentIdType("open_department_id") + .jobLevelIdType("people_admin_job_level_id") + .jobFamilyIdType("people_admin_job_category_id") + .employeeTypeIdType("people_admin_employee_type_id") .build(); // 发起请求 - OfferApplicationResp resp = client.hire().application().offer(req); + OfferApplicationResp resp = client.hire().v1().application().offer(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/OfferStatusOfferSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/OfferStatusOfferSample.java index 5bdf7ccdf..170ce2f1d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/OfferStatusOfferSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/OfferStatusOfferSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - OfferStatusOfferResp resp = client.hire().offer().offerStatus(req); + OfferStatusOfferResp resp = client.hire().v1().offer().offerStatus(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PatchEhrImportTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PatchEhrImportTaskSample.java index 3605b8e28..dadab7021 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PatchEhrImportTaskSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PatchEhrImportTaskSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchEhrImportTaskResp resp = client.hire().ehrImportTask().patch(req); + PatchEhrImportTaskResp resp = client.hire().v1().ehrImportTask().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PatchEmployeeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PatchEmployeeSample.java index 88c319a08..eedb9a8af 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PatchEmployeeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PatchEmployeeSample.java @@ -16,6 +16,9 @@ public static void main(String arg[]) throws Exception { .employeeId("123") .userIdType("open_id") .departmentIdType("people_admin_department_id") + .jobLevelIdType("people_admin_job_level_id") + .jobFamilyIdType("people_admin_job_category_id") + .employeeTypeIdType("people_admin_employee_type_id") .changeEmployeeStage(ChangeEmployeeStage.newBuilder() .operation(1) .conversionInfo(EmployeeConversionInfo.newBuilder().build()) @@ -24,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchEmployeeResp resp = client.hire().employee().patch(req); + PatchEmployeeResp resp = client.hire().v1().employee().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PatchNoteSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PatchNoteSample.java index 3145fce83..ad4c6e67d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PatchNoteSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PatchNoteSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchNoteResp resp = client.hire().note().patch(req); + PatchNoteResp resp = client.hire().v1().note().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PreviewAttachmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PreviewAttachmentSample.java index 72a3971f2..a19a95068 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PreviewAttachmentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/PreviewAttachmentSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PreviewAttachmentResp resp = client.hire().attachment().preview(req); + PreviewAttachmentResp resp = client.hire().v1().attachment().preview(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ReconciliationReferralAccountSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ReconciliationReferralAccountSample.java index 7720bf219..ef77524d4 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ReconciliationReferralAccountSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/ReconciliationReferralAccountSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ReconciliationReferralAccountResp resp = client.hire().referralAccount().reconciliation(req); + ReconciliationReferralAccountResp resp = client.hire().v1().referralAccount().reconciliation(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/TerminateApplicationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/TerminateApplicationSample.java index 7fc626be7..d4d1be4a5 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/TerminateApplicationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/TerminateApplicationSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - TerminateApplicationResp resp = client.hire().application().terminate(req); + TerminateApplicationResp resp = client.hire().v1().application().terminate(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/TransferOnboardApplicationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/TransferOnboardApplicationSample.java index 8e57fb9d9..406dc5a6f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/TransferOnboardApplicationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/TransferOnboardApplicationSample.java @@ -18,6 +18,9 @@ public static void main(String arg[]) throws Exception { .applicationId("7073372582620416300") .userIdType("open_id") .departmentIdType("people_admin_department_id") + .jobLevelIdType("people_admin_job_level_id") + .jobFamilyIdType("people_admin_job_category_id") + .employeeTypeIdType("people_admin_employee_type_id") .transferOnboardApplicationReqBody(TransferOnboardApplicationReqBody.newBuilder() .actualOnboardTime(0) .expectedConversionTime(0) @@ -33,7 +36,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - TransferOnboardApplicationResp resp = client.hire().application().transferOnboard(req); + TransferOnboardApplicationResp resp = client.hire().v1().application().transferOnboard(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateConfigJobSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateConfigJobSample.java index 2d083e58e..809fb4432 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateConfigJobSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateConfigJobSample.java @@ -32,7 +32,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateConfigJobResp resp = client.hire().job().updateConfig(req); + UpdateConfigJobResp resp = client.hire().v1().job().updateConfig(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateExternalApplicationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateExternalApplicationSample.java index 1f52e4fb0..09b2ba4c4 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateExternalApplicationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateExternalApplicationSample.java @@ -30,7 +30,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateExternalApplicationResp resp = client.hire().externalApplication().update(req); + UpdateExternalApplicationResp resp = client.hire().v1().externalApplication().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateJobRequirementSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateJobRequirementSample.java index 30129a2ce..72a61387c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateJobRequirementSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateJobRequirementSample.java @@ -19,6 +19,9 @@ public static void main(String arg[]) throws Exception { .jobRequirementId("623455234") .userIdType("open_id") .departmentIdType("open_department_id") + .jobLevelIdType("people_admin_job_level_id") + .jobFamilyIdType("people_admin_job_category_id") + .employeeTypeIdType("people_admin_employee_type_id") .jobRequirement(JobRequirement.newBuilder() .name("test") .displayProgress(1) @@ -48,7 +51,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateJobRequirementResp resp = client.hire().jobRequirement().update(req); + UpdateJobRequirementResp resp = client.hire().v1().jobRequirement().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateOfferSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateOfferSample.java index 730c25b12..7bb6cd421 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateOfferSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateOfferSample.java @@ -16,6 +16,9 @@ public static void main(String arg[]) throws Exception { .offerId("7016605170635213100") .userIdType("open_id") .departmentIdType("open_department_id") + .jobLevelIdType("people_admin_job_level_id") + .jobFamilyIdType("people_admin_job_category_id") + .employeeTypeIdType("people_admin_employee_type_id") .offerInfo(OfferInfo.newBuilder() .schemaId("7013318077945596204") .basicInfo(OfferBasicInfo.newBuilder().build()) @@ -25,7 +28,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateOfferResp resp = client.hire().offer().update(req); + UpdateOfferResp resp = client.hire().v1().offer().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateProgressEcoBackgroundCheckSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateProgressEcoBackgroundCheckSample.java index f521cc7da..e27c19a22 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateProgressEcoBackgroundCheckSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateProgressEcoBackgroundCheckSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateProgressEcoBackgroundCheckResp resp = client.hire().ecoBackgroundCheck().updateProgress(req); + UpdateProgressEcoBackgroundCheckResp resp = client.hire().v1().ecoBackgroundCheck().updateProgress(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateResultEcoBackgroundCheckSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateResultEcoBackgroundCheckSample.java index 54d06946c..1835bee52 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateResultEcoBackgroundCheckSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateResultEcoBackgroundCheckSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateResultEcoBackgroundCheckResp resp = client.hire().ecoBackgroundCheck().updateResult(req); + UpdateResultEcoBackgroundCheckResp resp = client.hire().v1().ecoBackgroundCheck().updateResult(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateResultEcoExamSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateResultEcoExamSample.java index fe6aa1682..54a39ce3a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateResultEcoExamSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/UpdateResultEcoExamSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateResultEcoExamResp resp = client.hire().ecoExam().updateResult(req); + UpdateResultEcoExamResp resp = client.hire().v1().ecoExam().updateResult(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/WithdrawReferralAccountSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/WithdrawReferralAccountSample.java index 1ad8ba4b3..647ebcf1c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/WithdrawReferralAccountSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/WithdrawReferralAccountSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - WithdrawReferralAccountResp resp = client.hire().referralAccount().withdraw(req); + WithdrawReferralAccountResp resp = client.hire().v1().referralAccount().withdraw(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/human_authenticationv1/CreateIdentitySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/human_authenticationv1/CreateIdentitySample.java index fac876c49..bb7f426b7 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/human_authenticationv1/CreateIdentitySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/human_authenticationv1/CreateIdentitySample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateIdentityResp resp = client.humanAuthentication().identity().create(req); + CreateIdentityResp resp = client.humanAuthentication().v1().identity().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/AddManagersChatManagersSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/AddManagersChatManagersSample.java index 640630229..288a0008d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/AddManagersChatManagersSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/AddManagersChatManagersSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - AddManagersChatManagersResp resp = client.im().chatManagers().addManagers(req); + AddManagersChatManagersResp resp = client.im().v1().chatManagers().addManagers(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatMembersSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatMembersSample.java index e41857e7e..336c01af1 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatMembersSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatMembersSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateChatMembersResp resp = client.im().chatMembers().create(req); + CreateChatMembersResp resp = client.im().v1().chatMembers().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatMenuTreeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatMenuTreeSample.java index b71152a6d..60da21e59 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatMenuTreeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatMenuTreeSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateChatMenuTreeResp resp = client.im().chatMenuTree().create(req); + CreateChatMenuTreeResp resp = client.im().v1().chatMenuTree().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatSample.java index 33f6b25f2..70a2dce4c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatSample.java @@ -37,7 +37,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateChatResp resp = client.im().chat().create(req); + CreateChatResp resp = client.im().v1().chat().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatTabSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatTabSample.java index 212921f9d..095553008 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatTabSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateChatTabSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateChatTabResp resp = client.im().chatTab().create(req); + CreateChatTabResp resp = client.im().v1().chatTab().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateFileSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateFileSample.java index 3ab41051b..e2a8b1ede 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateFileSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateFileSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateFileResp resp = client.im().file().create(req); + CreateFileResp resp = client.im().v1().file().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateImageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateImageSample.java index cc0879392..e60cefe9d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateImageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateImageSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateImageResp resp = client.im().image().create(req); + CreateImageResp resp = client.im().v1().image().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateMessageReactionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateMessageReactionSample.java index 1e6fdc58e..0c50db7d6 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateMessageReactionSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateMessageReactionSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateMessageReactionResp resp = client.im().messageReaction().create(req); + CreateMessageReactionResp resp = client.im().v1().messageReaction().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateMessageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateMessageSample.java index 9150fdce4..f96e531c1 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateMessageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreateMessageSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateMessageResp resp = client.im().message().create(req); + CreateMessageResp resp = client.im().v1().message().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreatePinSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreatePinSample.java index 9a3c3f690..fcb3b4cca 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreatePinSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/CreatePinSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreatePinResp resp = client.im().pin().create(req); + CreatePinResp resp = client.im().v1().pin().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteBatchMessageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteBatchMessageSample.java index a0b608d32..7fa1b3b7d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteBatchMessageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteBatchMessageSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteBatchMessageResp resp = client.im().batchMessage().delete(req); + DeleteBatchMessageResp resp = client.im().v1().batchMessage().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteChatMembersSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteChatMembersSample.java index d3bdd1e55..6d5f5333a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteChatMembersSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteChatMembersSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteChatMembersResp resp = client.im().chatMembers().delete(req); + DeleteChatMembersResp resp = client.im().v1().chatMembers().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteChatMenuTreeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteChatMenuTreeSample.java index 2b4cac233..e66b81a64 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteChatMenuTreeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteChatMenuTreeSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteChatMenuTreeResp resp = client.im().chatMenuTree().delete(req); + DeleteChatMenuTreeResp resp = client.im().v1().chatMenuTree().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteChatSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteChatSample.java index 2b9a5d334..0dbed16ff 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteChatSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteChatSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteChatResp resp = client.im().chat().delete(req); + DeleteChatResp resp = client.im().v1().chat().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteManagersChatManagersSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteManagersChatManagersSample.java index 085b93dcb..562de910e 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteManagersChatManagersSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteManagersChatManagersSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteManagersChatManagersResp resp = client.im().chatManagers().deleteManagers(req); + DeleteManagersChatManagersResp resp = client.im().v1().chatManagers().deleteManagers(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteMessageReactionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteMessageReactionSample.java index f3079e165..85f29bd0a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteMessageReactionSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteMessageReactionSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteMessageReactionResp resp = client.im().messageReaction().delete(req); + DeleteMessageReactionResp resp = client.im().v1().messageReaction().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteMessageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteMessageSample.java index 01e59f69f..c0ee2ce75 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteMessageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteMessageSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteMessageResp resp = client.im().message().delete(req); + DeleteMessageResp resp = client.im().v1().message().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeletePinSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeletePinSample.java index 035062fcf..cd0c0b35f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeletePinSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeletePinSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeletePinResp resp = client.im().pin().delete(req); + DeletePinResp resp = client.im().v1().pin().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteTabsChatTabSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteTabsChatTabSample.java index 9ebd32e69..bf06276f6 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteTabsChatTabSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteTabsChatTabSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteTabsChatTabResp resp = client.im().chatTab().deleteTabs(req); + DeleteTabsChatTabResp resp = client.im().v1().chatTab().deleteTabs(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteTopNoticeChatTopNoticeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteTopNoticeChatTopNoticeSample.java index 27b9707a6..e5a523aa0 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteTopNoticeChatTopNoticeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/DeleteTopNoticeChatTopNoticeSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteTopNoticeChatTopNoticeResp resp = client.im().chatTopNotice().deleteTopNotice(req); + DeleteTopNoticeChatTopNoticeResp resp = client.im().v1().chatTopNotice().deleteTopNotice(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ForwardMessageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ForwardMessageSample.java index 995bc73af..674a17071 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ForwardMessageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ForwardMessageSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ForwardMessageResp resp = client.im().message().forward(req); + ForwardMessageResp resp = client.im().v1().message().forward(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatAnnouncementSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatAnnouncementSample.java index dbabdc383..6c054a787 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatAnnouncementSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatAnnouncementSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetChatAnnouncementResp resp = client.im().chatAnnouncement().get(req); + GetChatAnnouncementResp resp = client.im().v1().chatAnnouncement().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatMembersSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatMembersSample.java index 89222400b..b685dc03b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatMembersSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatMembersSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetChatMembersResp resp = client.im().chatMembers().get(req); + GetChatMembersResp resp = client.im().v1().chatMembers().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatMenuTreeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatMenuTreeSample.java index a55a74a18..220f2d7f4 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatMenuTreeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatMenuTreeSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetChatMenuTreeResp resp = client.im().chatMenuTree().get(req); + GetChatMenuTreeResp resp = client.im().v1().chatMenuTree().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatModerationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatModerationSample.java index 5f211dd93..6dee30414 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatModerationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatModerationSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetChatModerationResp resp = client.im().chatModeration().get(req); + GetChatModerationResp resp = client.im().v1().chatModeration().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatSample.java index d21e78d47..050f731f2 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetChatSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetChatResp resp = client.im().chat().get(req); + GetChatResp resp = client.im().v1().chat().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetFileSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetFileSample.java index cc36312ca..7afab5b17 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetFileSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetFileSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetFileResp resp = client.im().file().get(req); + GetFileResp resp = client.im().v1().file().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetImageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetImageSample.java index d40f5c23e..c0c0c6363 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetImageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetImageSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetImageResp resp = client.im().image().get(req); + GetImageResp resp = client.im().v1().image().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetMessageResourceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetMessageResourceSample.java index 248db4952..f821f186d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetMessageResourceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetMessageResourceSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetMessageResourceResp resp = client.im().messageResource().get(req); + GetMessageResourceResp resp = client.im().v1().messageResource().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetMessageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetMessageSample.java index 635598db4..c3b1752ed 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetMessageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetMessageSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetMessageResp resp = client.im().message().get(req); + GetMessageResp resp = client.im().v1().message().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetProgressBatchMessageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetProgressBatchMessageSample.java index e2afb4c40..230a594b9 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetProgressBatchMessageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/GetProgressBatchMessageSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetProgressBatchMessageResp resp = client.im().batchMessage().getProgress(req); + GetProgressBatchMessageResp resp = client.im().v1().batchMessage().getProgress(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/IsInChatChatMembersSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/IsInChatChatMembersSample.java index 216b62116..d8cb70127 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/IsInChatChatMembersSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/IsInChatChatMembersSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - IsInChatChatMembersResp resp = client.im().chatMembers().isInChat(req); + IsInChatChatMembersResp resp = client.im().v1().chatMembers().isInChat(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/LinkChatSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/LinkChatSample.java index 8594a0c5c..91e9234bc 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/LinkChatSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/LinkChatSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - LinkChatResp resp = client.im().chat().link(req); + LinkChatResp resp = client.im().v1().chat().link(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListChatSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListChatSample.java index 7706cc631..ff7a2e7e9 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListChatSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListChatSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListChatResp resp = client.im().chat().list(req); + ListChatResp resp = client.im().v1().chat().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListMessageReactionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListMessageReactionSample.java index 99829e0fe..b5184d36d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListMessageReactionSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListMessageReactionSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListMessageReactionResp resp = client.im().messageReaction().list(req); + ListMessageReactionResp resp = client.im().v1().messageReaction().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListMessageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListMessageSample.java index 45b0e0c6d..31e7973a6 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListMessageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListMessageSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListMessageResp resp = client.im().message().list(req); + ListMessageResp resp = client.im().v1().message().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListPinSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListPinSample.java index e5115a3ed..573408411 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListPinSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListPinSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListPinResp resp = client.im().pin().list(req); + ListPinResp resp = client.im().v1().pin().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListTabsChatTabSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListTabsChatTabSample.java index 6e0cc7e28..6d38ac5b6 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListTabsChatTabSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ListTabsChatTabSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListTabsChatTabResp resp = client.im().chatTab().listTabs(req); + ListTabsChatTabResp resp = client.im().v1().chatTab().listTabs(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/MeJoinChatMembersSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/MeJoinChatMembersSample.java index 9fbd78e7d..5424d33d9 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/MeJoinChatMembersSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/MeJoinChatMembersSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - MeJoinChatMembersResp resp = client.im().chatMembers().meJoin(req); + MeJoinChatMembersResp resp = client.im().v1().chatMembers().meJoin(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/MergeForwardMessageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/MergeForwardMessageSample.java index e5e973892..005b9dff9 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/MergeForwardMessageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/MergeForwardMessageSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - MergeForwardMessageResp resp = client.im().message().mergeForward(req); + MergeForwardMessageResp resp = client.im().v1().message().mergeForward(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PatchChatAnnouncementSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PatchChatAnnouncementSample.java index 5b4ad7c89..c888f5e24 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PatchChatAnnouncementSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PatchChatAnnouncementSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchChatAnnouncementResp resp = client.im().chatAnnouncement().patch(req); + PatchChatAnnouncementResp resp = client.im().v1().chatAnnouncement().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PatchChatMenuItemSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PatchChatMenuItemSample.java index 640c4743f..f967f4d0f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PatchChatMenuItemSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PatchChatMenuItemSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchChatMenuItemResp resp = client.im().chatMenuItem().patch(req); + PatchChatMenuItemResp resp = client.im().v1().chatMenuItem().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PatchMessageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PatchMessageSample.java index 73cc47173..342e24a28 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PatchMessageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PatchMessageSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchMessageResp resp = client.im().message().patch(req); + PatchMessageResp resp = client.im().v1().message().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PutTopNoticeChatTopNoticeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PutTopNoticeChatTopNoticeSample.java index 48ff36576..17feb7932 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PutTopNoticeChatTopNoticeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/PutTopNoticeChatTopNoticeSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PutTopNoticeChatTopNoticeResp resp = client.im().chatTopNotice().putTopNotice(req); + PutTopNoticeChatTopNoticeResp resp = client.im().v1().chatTopNotice().putTopNotice(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ReadUserBatchMessageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ReadUserBatchMessageSample.java index e25ed7bfd..c3f661454 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ReadUserBatchMessageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ReadUserBatchMessageSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ReadUserBatchMessageResp resp = client.im().batchMessage().readUser(req); + ReadUserBatchMessageResp resp = client.im().v1().batchMessage().readUser(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ReadUsersMessageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ReadUsersMessageSample.java index d10a0b5c7..4e6618767 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ReadUsersMessageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ReadUsersMessageSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ReadUsersMessageResp resp = client.im().message().readUsers(req); + ReadUsersMessageResp resp = client.im().v1().message().readUsers(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ReplyMessageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ReplyMessageSample.java index aaa48327b..9e1b06c33 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ReplyMessageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/ReplyMessageSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ReplyMessageResp resp = client.im().message().reply(req); + ReplyMessageResp resp = client.im().v1().message().reply(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/SearchChatSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/SearchChatSample.java index c35f2ffc0..6c5c9cd55 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/SearchChatSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/SearchChatSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SearchChatResp resp = client.im().chat().search(req); + SearchChatResp resp = client.im().v1().chat().search(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/SortChatMenuTreeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/SortChatMenuTreeSample.java index 988e1f5f9..ecf2527a0 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/SortChatMenuTreeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/SortChatMenuTreeSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SortChatMenuTreeResp resp = client.im().chatMenuTree().sort(req); + SortChatMenuTreeResp resp = client.im().v1().chatMenuTree().sort(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/SortTabsChatTabSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/SortTabsChatTabSample.java index d49449f76..5e8a6e384 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/SortTabsChatTabSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/SortTabsChatTabSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SortTabsChatTabResp resp = client.im().chatTab().sortTabs(req); + SortTabsChatTabResp resp = client.im().v1().chatTab().sortTabs(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateChatModerationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateChatModerationSample.java index 35d3beee9..f522458d1 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateChatModerationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateChatModerationSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateChatModerationResp resp = client.im().chatModeration().update(req); + UpdateChatModerationResp resp = client.im().v1().chatModeration().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateChatSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateChatSample.java index 71173628a..080be91b9 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateChatSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateChatSample.java @@ -36,7 +36,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateChatResp resp = client.im().chat().update(req); + UpdateChatResp resp = client.im().v1().chat().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateMessageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateMessageSample.java index b7879f05c..752634b34 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateMessageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateMessageSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateMessageResp resp = client.im().message().update(req); + UpdateMessageResp resp = client.im().v1().message().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateTabsChatTabSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateTabsChatTabSample.java index bbbdb5715..e37f2a055 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateTabsChatTabSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UpdateTabsChatTabSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateTabsChatTabResp resp = client.im().chatTab().updateTabs(req); + UpdateTabsChatTabResp resp = client.im().v1().chatTab().updateTabs(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UrgentAppMessageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UrgentAppMessageSample.java index 883922736..69821d49e 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UrgentAppMessageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UrgentAppMessageSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UrgentAppMessageResp resp = client.im().message().urgentApp(req); + UrgentAppMessageResp resp = client.im().v1().message().urgentApp(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UrgentPhoneMessageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UrgentPhoneMessageSample.java index 06c1399a8..48bb912e7 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UrgentPhoneMessageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UrgentPhoneMessageSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UrgentPhoneMessageResp resp = client.im().message().urgentPhone(req); + UrgentPhoneMessageResp resp = client.im().v1().message().urgentPhone(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UrgentSmsMessageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UrgentSmsMessageSample.java index 93dc8694c..1a6972719 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UrgentSmsMessageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/imv1/UrgentSmsMessageSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UrgentSmsMessageResp resp = client.im().message().urgentSms(req); + UrgentSmsMessageResp resp = client.im().v1().message().urgentSms(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/CreateDraftSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/CreateDraftSample.java index 80080d3db..8d30fff93 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/CreateDraftSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/CreateDraftSample.java @@ -28,7 +28,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateDraftResp resp = client.lingo().draft().create(req); + CreateDraftResp resp = client.lingo().v1().draft().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/CreateEntitySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/CreateEntitySample.java index 955472dfa..0fb44ed6b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/CreateEntitySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/CreateEntitySample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateEntityResp resp = client.lingo().entity().create(req); + CreateEntityResp resp = client.lingo().v1().entity().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/DeleteEntitySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/DeleteEntitySample.java new file mode 100644 index 000000000..73b71375f --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/DeleteEntitySample.java @@ -0,0 +1,35 @@ +package com.lark.oapi.sample.apiall.lingov1; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.lingo.v1.model.DeleteEntityReq; +import com.lark.oapi.service.lingo.v1.model.DeleteEntityResp; + +// DELETE /open-apis/lingo/v1/entities/:entity_id +public class DeleteEntitySample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + DeleteEntityReq req = DeleteEntityReq.newBuilder() + .entityId("enterprise_43742132363") + .provider("星云") + .outerId("123aaa") + .build(); + + // 发起请求 + DeleteEntityResp resp = client.lingo().v1().entity().delete(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/DownloadFileSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/DownloadFileSample.java index e04f79f85..a28b7b145 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/DownloadFileSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/DownloadFileSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DownloadFileResp resp = client.lingo().file().download(req); + DownloadFileResp resp = client.lingo().v1().file().download(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/GetEntitySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/GetEntitySample.java index 3b81b6742..013a3fc8b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/GetEntitySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/GetEntitySample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetEntityResp resp = client.lingo().entity().get(req); + GetEntityResp resp = client.lingo().v1().entity().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/HighlightEntitySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/HighlightEntitySample.java index 6e27d2206..16728a004 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/HighlightEntitySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/HighlightEntitySample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - HighlightEntityResp resp = client.lingo().entity().highlight(req); + HighlightEntityResp resp = client.lingo().v1().entity().highlight(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/ListClassificationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/ListClassificationSample.java index 98bd92c66..1d4dadfdf 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/ListClassificationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/ListClassificationSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListClassificationResp resp = client.lingo().classification().list(req); + ListClassificationResp resp = client.lingo().v1().classification().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/ListEntitySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/ListEntitySample.java index f93e6f891..6ed8d6f59 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/ListEntitySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/ListEntitySample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListEntityResp resp = client.lingo().entity().list(req); + ListEntityResp resp = client.lingo().v1().entity().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/MatchEntitySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/MatchEntitySample.java index d4c00a00a..4ac3dfdb4 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/MatchEntitySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/MatchEntitySample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - MatchEntityResp resp = client.lingo().entity().match(req); + MatchEntityResp resp = client.lingo().v1().entity().match(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/SearchEntitySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/SearchEntitySample.java index c7233890e..5a3460dff 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/SearchEntitySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/SearchEntitySample.java @@ -29,7 +29,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SearchEntityResp resp = client.lingo().entity().search(req); + SearchEntityResp resp = client.lingo().v1().entity().search(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/UpdateDraftSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/UpdateDraftSample.java index d24407e8e..852a68c99 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/UpdateDraftSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/UpdateDraftSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateDraftResp resp = client.lingo().draft().update(req); + UpdateDraftResp resp = client.lingo().v1().draft().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/UpdateEntitySample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/UpdateEntitySample.java index e944f64ab..c12c4d990 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/UpdateEntitySample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/UpdateEntitySample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateEntityResp resp = client.lingo().entity().update(req); + UpdateEntityResp resp = client.lingo().v1().entity().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/UploadFileSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/UploadFileSample.java index 5f9b82c23..71c888371 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/UploadFileSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/lingov1/UploadFileSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UploadFileResp resp = client.lingo().file().upload(req); + UploadFileResp resp = client.lingo().v1().file().upload(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreateMailgroupManagerSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreateMailgroupManagerSample.java index 6f22f2c77..e525e75bc 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreateMailgroupManagerSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreateMailgroupManagerSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchCreateMailgroupManagerResp resp = client.mail().mailgroupManager().batchCreate(req); + BatchCreateMailgroupManagerResp resp = client.mail().v1().mailgroupManager().batchCreate(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreateMailgroupMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreateMailgroupMemberSample.java index 586fabcac..5d5f825b9 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreateMailgroupMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreateMailgroupMemberSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchCreateMailgroupMemberResp resp = client.mail().mailgroupMember().batchCreate(req); + BatchCreateMailgroupMemberResp resp = client.mail().v1().mailgroupMember().batchCreate(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreateMailgroupPermissionMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreateMailgroupPermissionMemberSample.java index 539e82784..49d101d9d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreateMailgroupPermissionMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreateMailgroupPermissionMemberSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchCreateMailgroupPermissionMemberResp resp = client.mail().mailgroupPermissionMember().batchCreate(req); + BatchCreateMailgroupPermissionMemberResp resp = client.mail().v1().mailgroupPermissionMember().batchCreate(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreatePublicMailboxMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreatePublicMailboxMemberSample.java index d61163e66..89d91027f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreatePublicMailboxMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchCreatePublicMailboxMemberSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchCreatePublicMailboxMemberResp resp = client.mail().publicMailboxMember().batchCreate(req); + BatchCreatePublicMailboxMemberResp resp = client.mail().v1().publicMailboxMember().batchCreate(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeleteMailgroupManagerSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeleteMailgroupManagerSample.java index fea67a3ac..d99f075ff 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeleteMailgroupManagerSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeleteMailgroupManagerSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchDeleteMailgroupManagerResp resp = client.mail().mailgroupManager().batchDelete(req); + BatchDeleteMailgroupManagerResp resp = client.mail().v1().mailgroupManager().batchDelete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeleteMailgroupMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeleteMailgroupMemberSample.java index 5427d56eb..036ce4c10 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeleteMailgroupMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeleteMailgroupMemberSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchDeleteMailgroupMemberResp resp = client.mail().mailgroupMember().batchDelete(req); + BatchDeleteMailgroupMemberResp resp = client.mail().v1().mailgroupMember().batchDelete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeleteMailgroupPermissionMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeleteMailgroupPermissionMemberSample.java index a9e65f90d..b44de6e79 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeleteMailgroupPermissionMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeleteMailgroupPermissionMemberSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchDeleteMailgroupPermissionMemberResp resp = client.mail().mailgroupPermissionMember().batchDelete(req); + BatchDeleteMailgroupPermissionMemberResp resp = client.mail().v1().mailgroupPermissionMember().batchDelete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeletePublicMailboxMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeletePublicMailboxMemberSample.java index 607f7036a..12073a987 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeletePublicMailboxMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/BatchDeletePublicMailboxMemberSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchDeletePublicMailboxMemberResp resp = client.mail().publicMailboxMember().batchDelete(req); + BatchDeletePublicMailboxMemberResp resp = client.mail().v1().publicMailboxMember().batchDelete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ClearPublicMailboxMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ClearPublicMailboxMemberSample.java index f1239e45c..f6939c740 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ClearPublicMailboxMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ClearPublicMailboxMemberSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ClearPublicMailboxMemberResp resp = client.mail().publicMailboxMember().clear(req); + ClearPublicMailboxMemberResp resp = client.mail().v1().publicMailboxMember().clear(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupAliasSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupAliasSample.java index 748de4eba..5460724c3 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupAliasSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupAliasSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateMailgroupAliasResp resp = client.mail().mailgroupAlias().create(req); + CreateMailgroupAliasResp resp = client.mail().v1().mailgroupAlias().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupMemberSample.java index e2a643711..00a8e9daf 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupMemberSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateMailgroupMemberResp resp = client.mail().mailgroupMember().create(req); + CreateMailgroupMemberResp resp = client.mail().v1().mailgroupMember().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupPermissionMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupPermissionMemberSample.java index 576886e78..678462ca0 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupPermissionMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupPermissionMemberSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateMailgroupPermissionMemberResp resp = client.mail().mailgroupPermissionMember().create(req); + CreateMailgroupPermissionMemberResp resp = client.mail().v1().mailgroupPermissionMember().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupSample.java index 990b08eaf..4441c9b7b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateMailgroupSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateMailgroupResp resp = client.mail().mailgroup().create(req); + CreateMailgroupResp resp = client.mail().v1().mailgroup().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreatePublicMailboxAliasSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreatePublicMailboxAliasSample.java index 3ec74210a..83c0ee5e3 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreatePublicMailboxAliasSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreatePublicMailboxAliasSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreatePublicMailboxAliasResp resp = client.mail().publicMailboxAlias().create(req); + CreatePublicMailboxAliasResp resp = client.mail().v1().publicMailboxAlias().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreatePublicMailboxMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreatePublicMailboxMemberSample.java index 89862ce85..235b5863a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreatePublicMailboxMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreatePublicMailboxMemberSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreatePublicMailboxMemberResp resp = client.mail().publicMailboxMember().create(req); + CreatePublicMailboxMemberResp resp = client.mail().v1().publicMailboxMember().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreatePublicMailboxSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreatePublicMailboxSample.java index 7a4be3def..a8fc6bd98 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreatePublicMailboxSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreatePublicMailboxSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreatePublicMailboxResp resp = client.mail().publicMailbox().create(req); + CreatePublicMailboxResp resp = client.mail().v1().publicMailbox().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateUserMailboxAliasSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateUserMailboxAliasSample.java index 746e0b752..c79f6450e 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateUserMailboxAliasSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/CreateUserMailboxAliasSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateUserMailboxAliasResp resp = client.mail().userMailboxAlias().create(req); + CreateUserMailboxAliasResp resp = client.mail().v1().userMailboxAlias().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupAliasSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupAliasSample.java index bec2ac73e..040216b69 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupAliasSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupAliasSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteMailgroupAliasResp resp = client.mail().mailgroupAlias().delete(req); + DeleteMailgroupAliasResp resp = client.mail().v1().mailgroupAlias().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupMemberSample.java index cb53b736c..0cb6855a1 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupMemberSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteMailgroupMemberResp resp = client.mail().mailgroupMember().delete(req); + DeleteMailgroupMemberResp resp = client.mail().v1().mailgroupMember().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupPermissionMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupPermissionMemberSample.java index 1894c89bd..e71a97ae6 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupPermissionMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupPermissionMemberSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteMailgroupPermissionMemberResp resp = client.mail().mailgroupPermissionMember().delete(req); + DeleteMailgroupPermissionMemberResp resp = client.mail().v1().mailgroupPermissionMember().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupSample.java index 98767a568..bdfd9a02f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteMailgroupSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteMailgroupResp resp = client.mail().mailgroup().delete(req); + DeleteMailgroupResp resp = client.mail().v1().mailgroup().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeletePublicMailboxAliasSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeletePublicMailboxAliasSample.java index ccce43de0..a0bce724b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeletePublicMailboxAliasSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeletePublicMailboxAliasSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeletePublicMailboxAliasResp resp = client.mail().publicMailboxAlias().delete(req); + DeletePublicMailboxAliasResp resp = client.mail().v1().publicMailboxAlias().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeletePublicMailboxMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeletePublicMailboxMemberSample.java index 0e899d4a7..7e7c7e42d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeletePublicMailboxMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeletePublicMailboxMemberSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeletePublicMailboxMemberResp resp = client.mail().publicMailboxMember().delete(req); + DeletePublicMailboxMemberResp resp = client.mail().v1().publicMailboxMember().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeletePublicMailboxSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeletePublicMailboxSample.java index 7d38ed862..4c12218cd 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeletePublicMailboxSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeletePublicMailboxSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeletePublicMailboxResp resp = client.mail().publicMailbox().delete(req); + DeletePublicMailboxResp resp = client.mail().v1().publicMailbox().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteUserMailboxAliasSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteUserMailboxAliasSample.java index c66076ae7..4a1fd9666 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteUserMailboxAliasSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteUserMailboxAliasSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteUserMailboxAliasResp resp = client.mail().userMailboxAlias().delete(req); + DeleteUserMailboxAliasResp resp = client.mail().v1().userMailboxAlias().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteUserMailboxSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteUserMailboxSample.java index 1ee8db082..fedc8d891 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteUserMailboxSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/DeleteUserMailboxSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteUserMailboxResp resp = client.mail().userMailbox().delete(req); + DeleteUserMailboxResp resp = client.mail().v1().userMailbox().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetMailgroupMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetMailgroupMemberSample.java index 228e5d6e1..da7406f12 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetMailgroupMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetMailgroupMemberSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetMailgroupMemberResp resp = client.mail().mailgroupMember().get(req); + GetMailgroupMemberResp resp = client.mail().v1().mailgroupMember().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetMailgroupPermissionMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetMailgroupPermissionMemberSample.java index db31101ff..c938fd420 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetMailgroupPermissionMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetMailgroupPermissionMemberSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetMailgroupPermissionMemberResp resp = client.mail().mailgroupPermissionMember().get(req); + GetMailgroupPermissionMemberResp resp = client.mail().v1().mailgroupPermissionMember().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetMailgroupSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetMailgroupSample.java index 9fbb34f78..21ffc67f0 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetMailgroupSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetMailgroupSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetMailgroupResp resp = client.mail().mailgroup().get(req); + GetMailgroupResp resp = client.mail().v1().mailgroup().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetPublicMailboxMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetPublicMailboxMemberSample.java index 288beed7d..bba4593b1 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetPublicMailboxMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetPublicMailboxMemberSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetPublicMailboxMemberResp resp = client.mail().publicMailboxMember().get(req); + GetPublicMailboxMemberResp resp = client.mail().v1().publicMailboxMember().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetPublicMailboxSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetPublicMailboxSample.java index e6d78992f..a0e2d1660 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetPublicMailboxSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/GetPublicMailboxSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetPublicMailboxResp resp = client.mail().publicMailbox().get(req); + GetPublicMailboxResp resp = client.mail().v1().publicMailbox().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupAliasSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupAliasSample.java index 5544e21fc..c15ac6e16 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupAliasSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupAliasSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListMailgroupAliasResp resp = client.mail().mailgroupAlias().list(req); + ListMailgroupAliasResp resp = client.mail().v1().mailgroupAlias().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupManagerSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupManagerSample.java index bc85e5b6a..b9a0551bb 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupManagerSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupManagerSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListMailgroupManagerResp resp = client.mail().mailgroupManager().list(req); + ListMailgroupManagerResp resp = client.mail().v1().mailgroupManager().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupMemberSample.java index 3a7b3b55e..4af7e64eb 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupMemberSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListMailgroupMemberResp resp = client.mail().mailgroupMember().list(req); + ListMailgroupMemberResp resp = client.mail().v1().mailgroupMember().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupPermissionMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupPermissionMemberSample.java index 4920edb52..389edd5e6 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupPermissionMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupPermissionMemberSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListMailgroupPermissionMemberResp resp = client.mail().mailgroupPermissionMember().list(req); + ListMailgroupPermissionMemberResp resp = client.mail().v1().mailgroupPermissionMember().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupSample.java index 9346df2cd..4da22ebcc 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListMailgroupSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListMailgroupResp resp = client.mail().mailgroup().list(req); + ListMailgroupResp resp = client.mail().v1().mailgroup().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListPublicMailboxAliasSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListPublicMailboxAliasSample.java index d1658c1a7..ad1bc7010 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListPublicMailboxAliasSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListPublicMailboxAliasSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListPublicMailboxAliasResp resp = client.mail().publicMailboxAlias().list(req); + ListPublicMailboxAliasResp resp = client.mail().v1().publicMailboxAlias().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListPublicMailboxMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListPublicMailboxMemberSample.java index b41f14af4..be5e70c8a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListPublicMailboxMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListPublicMailboxMemberSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListPublicMailboxMemberResp resp = client.mail().publicMailboxMember().list(req); + ListPublicMailboxMemberResp resp = client.mail().v1().publicMailboxMember().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListPublicMailboxSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListPublicMailboxSample.java index c997700f4..8092fd1a4 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListPublicMailboxSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListPublicMailboxSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListPublicMailboxResp resp = client.mail().publicMailbox().list(req); + ListPublicMailboxResp resp = client.mail().v1().publicMailbox().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListUserMailboxAliasSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListUserMailboxAliasSample.java index c1c4b1077..dc9d91d4e 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListUserMailboxAliasSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/ListUserMailboxAliasSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListUserMailboxAliasResp resp = client.mail().userMailboxAlias().list(req); + ListUserMailboxAliasResp resp = client.mail().v1().userMailboxAlias().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/PatchMailgroupSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/PatchMailgroupSample.java index fe8ee884e..d6a209fdf 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/PatchMailgroupSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/PatchMailgroupSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchMailgroupResp resp = client.mail().mailgroup().patch(req); + PatchMailgroupResp resp = client.mail().v1().mailgroup().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/PatchPublicMailboxSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/PatchPublicMailboxSample.java index 134d00d11..b800a559a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/PatchPublicMailboxSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/PatchPublicMailboxSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchPublicMailboxResp resp = client.mail().publicMailbox().patch(req); + PatchPublicMailboxResp resp = client.mail().v1().publicMailbox().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/QueryUserSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/QueryUserSample.java index 19b03be16..0427a8d76 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/QueryUserSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/QueryUserSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - QueryUserResp resp = client.mail().user().query(req); + QueryUserResp resp = client.mail().v1().user().query(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/UpdateMailgroupSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/UpdateMailgroupSample.java index 3fb4022d5..87c929110 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/UpdateMailgroupSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/UpdateMailgroupSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateMailgroupResp resp = client.mail().mailgroup().update(req); + UpdateMailgroupResp resp = client.mail().v1().mailgroup().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/UpdatePublicMailboxSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/UpdatePublicMailboxSample.java index ebf93a1b9..c5072a5e8 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/UpdatePublicMailboxSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mailv1/UpdatePublicMailboxSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdatePublicMailboxResp resp = client.mail().publicMailbox().update(req); + UpdatePublicMailboxResp resp = client.mail().v1().publicMailbox().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mdmv1/BindUserAuthDataRelationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mdmv1/BindUserAuthDataRelationSample.java index 9b948b6ac..08a36ce59 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mdmv1/BindUserAuthDataRelationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mdmv1/BindUserAuthDataRelationSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BindUserAuthDataRelationResp resp = client.mdm().userAuthDataRelation().bind(req); + BindUserAuthDataRelationResp resp = client.mdm().v1().userAuthDataRelation().bind(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/mdmv1/UnbindUserAuthDataRelationSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/mdmv1/UnbindUserAuthDataRelationSample.java index b485ab2bb..59085a4f8 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/mdmv1/UnbindUserAuthDataRelationSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/mdmv1/UnbindUserAuthDataRelationSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UnbindUserAuthDataRelationResp resp = client.mdm().userAuthDataRelation().unbind(req); + UnbindUserAuthDataRelationResp resp = client.mdm().v1().userAuthDataRelation().unbind(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/BatchGetOkrSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/BatchGetOkrSample.java index c94ebee53..56008500d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/BatchGetOkrSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/BatchGetOkrSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchGetOkrResp resp = client.okr().okr().batchGet(req); + BatchGetOkrResp resp = client.okr().v1().okr().batchGet(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/CreateProgressRecordSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/CreateProgressRecordSample.java index 9fe9236f8..93f7db5bd 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/CreateProgressRecordSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/CreateProgressRecordSample.java @@ -29,7 +29,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateProgressRecordResp resp = client.okr().progressRecord().create(req); + CreateProgressRecordResp resp = client.okr().v1().progressRecord().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/DeleteProgressRecordSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/DeleteProgressRecordSample.java index 64a0a8ab3..66dadb831 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/DeleteProgressRecordSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/DeleteProgressRecordSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteProgressRecordResp resp = client.okr().progressRecord().delete(req); + DeleteProgressRecordResp resp = client.okr().v1().progressRecord().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/GetProgressRecordSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/GetProgressRecordSample.java index fc377cf9a..9de95aa07 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/GetProgressRecordSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/GetProgressRecordSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetProgressRecordResp resp = client.okr().progressRecord().get(req); + GetProgressRecordResp resp = client.okr().v1().progressRecord().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/ListPeriodSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/ListPeriodSample.java index 9a12c1b46..28e85d02c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/ListPeriodSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/ListPeriodSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListPeriodResp resp = client.okr().period().list(req); + ListPeriodResp resp = client.okr().v1().period().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/ListUserOkrSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/ListUserOkrSample.java index b29aab8cb..d42f2c377 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/ListUserOkrSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/ListUserOkrSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListUserOkrResp resp = client.okr().userOkr().list(req); + ListUserOkrResp resp = client.okr().v1().userOkr().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/UpdateProgressRecordSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/UpdateProgressRecordSample.java index ab2955c35..3b8ccd25d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/UpdateProgressRecordSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/UpdateProgressRecordSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateProgressRecordResp resp = client.okr().progressRecord().update(req); + UpdateProgressRecordResp resp = client.okr().v1().progressRecord().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/UploadImageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/UploadImageSample.java index 246198deb..3ea8e3d0f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/UploadImageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/okrv1/UploadImageSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UploadImageResp resp = client.okr().image().upload(req); + UploadImageResp resp = client.okr().v1().image().upload(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/optical_char_recognitionv1/BasicRecognizeImageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/optical_char_recognitionv1/BasicRecognizeImageSample.java index 49220c412..ff4cb20a3 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/optical_char_recognitionv1/BasicRecognizeImageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/optical_char_recognitionv1/BasicRecognizeImageSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BasicRecognizeImageResp resp = client.opticalCharRecognition().image().basicRecognize(req); + BasicRecognizeImageResp resp = client.opticalCharRecognition().v1().image().basicRecognize(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/passportv1/QuerySessionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/passportv1/QuerySessionSample.java index 6e550b313..50c072b12 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/passportv1/QuerySessionSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/passportv1/QuerySessionSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - QuerySessionResp resp = client.passport().session().query(req); + QuerySessionResp resp = client.passport().v1().session().query(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/BatchCloseSystemStatusSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/BatchCloseSystemStatusSample.java index 402552b57..d3472f8dc 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/BatchCloseSystemStatusSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/BatchCloseSystemStatusSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchCloseSystemStatusResp resp = client.personalSettings().systemStatus().batchClose(req); + BatchCloseSystemStatusResp resp = client.personalSettings().v1().systemStatus().batchClose(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/BatchOpenSystemStatusSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/BatchOpenSystemStatusSample.java index 17e92bf96..f3a896e85 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/BatchOpenSystemStatusSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/BatchOpenSystemStatusSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchOpenSystemStatusResp resp = client.personalSettings().systemStatus().batchOpen(req); + BatchOpenSystemStatusResp resp = client.personalSettings().v1().systemStatus().batchOpen(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/CreateSystemStatusSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/CreateSystemStatusSample.java index edc7923ec..feced4509 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/CreateSystemStatusSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/CreateSystemStatusSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateSystemStatusResp resp = client.personalSettings().systemStatus().create(req); + CreateSystemStatusResp resp = client.personalSettings().v1().systemStatus().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/DeleteSystemStatusSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/DeleteSystemStatusSample.java index 0e5a1f86d..2eae7810d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/DeleteSystemStatusSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/DeleteSystemStatusSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteSystemStatusResp resp = client.personalSettings().systemStatus().delete(req); + DeleteSystemStatusResp resp = client.personalSettings().v1().systemStatus().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/ListSystemStatusSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/ListSystemStatusSample.java index c6a54d99d..83f6b2f29 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/ListSystemStatusSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/ListSystemStatusSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListSystemStatusResp resp = client.personalSettings().systemStatus().list(req); + ListSystemStatusResp resp = client.personalSettings().v1().systemStatus().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/PatchSystemStatusSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/PatchSystemStatusSample.java index 6ed4fcaac..670711959 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/PatchSystemStatusSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/personal_settingsv1/PatchSystemStatusSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchSystemStatusResp resp = client.personalSettings().systemStatus().patch(req); + PatchSystemStatusResp resp = client.personalSettings().v1().systemStatus().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateAppSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateAppSample.java index adb054022..5c1b097ee 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateAppSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateAppSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateAppResp resp = client.search().app().create(req); + CreateAppResp resp = client.search().v2().app().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateDataSourceItemSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateDataSourceItemSample.java index 971bfed2b..14b0206e5 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateDataSourceItemSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateDataSourceItemSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateDataSourceItemResp resp = client.search().dataSourceItem().create(req); + CreateDataSourceItemResp resp = client.search().v2().dataSourceItem().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateDataSourceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateDataSourceSample.java index 4f005a27c..cbac332a7 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateDataSourceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateDataSourceSample.java @@ -31,7 +31,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateDataSourceResp resp = client.search().dataSource().create(req); + CreateDataSourceResp resp = client.search().v2().dataSource().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateMessageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateMessageSample.java index cc80ddc41..40e78ef8a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateMessageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateMessageSample.java @@ -32,7 +32,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateMessageResp resp = client.search().message().create(req); + CreateMessageResp resp = client.search().v2().message().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateSchemaSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateSchemaSample.java index 258a9a1aa..7d3c33120 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateSchemaSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/CreateSchemaSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateSchemaResp resp = client.search().schema().create(req); + CreateSchemaResp resp = client.search().v2().schema().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/DeleteDataSourceItemSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/DeleteDataSourceItemSample.java index e4d0e727c..142a26db1 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/DeleteDataSourceItemSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/DeleteDataSourceItemSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteDataSourceItemResp resp = client.search().dataSourceItem().delete(req); + DeleteDataSourceItemResp resp = client.search().v2().dataSourceItem().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/DeleteDataSourceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/DeleteDataSourceSample.java index 5755fd73c..696f41ff3 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/DeleteDataSourceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/DeleteDataSourceSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteDataSourceResp resp = client.search().dataSource().delete(req); + DeleteDataSourceResp resp = client.search().v2().dataSource().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/DeleteSchemaSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/DeleteSchemaSample.java index 7bf25c25a..f0d02fb6f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/DeleteSchemaSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/DeleteSchemaSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteSchemaResp resp = client.search().schema().delete(req); + DeleteSchemaResp resp = client.search().v2().schema().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/GetDataSourceItemSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/GetDataSourceItemSample.java index 908d96627..0a6e186e5 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/GetDataSourceItemSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/GetDataSourceItemSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetDataSourceItemResp resp = client.search().dataSourceItem().get(req); + GetDataSourceItemResp resp = client.search().v2().dataSourceItem().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/GetDataSourceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/GetDataSourceSample.java index 98fe16b28..84b8088db 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/GetDataSourceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/GetDataSourceSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetDataSourceResp resp = client.search().dataSource().get(req); + GetDataSourceResp resp = client.search().v2().dataSource().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/GetSchemaSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/GetSchemaSample.java index 8790d7758..b7911496c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/GetSchemaSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/GetSchemaSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetSchemaResp resp = client.search().schema().get(req); + GetSchemaResp resp = client.search().v2().schema().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/ListDataSourceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/ListDataSourceSample.java index c1d459261..3945b0bc8 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/ListDataSourceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/ListDataSourceSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListDataSourceResp resp = client.search().dataSource().list(req); + ListDataSourceResp resp = client.search().v2().dataSource().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/PatchDataSourceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/PatchDataSourceSample.java index 187fd52f0..734370c25 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/PatchDataSourceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/PatchDataSourceSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchDataSourceResp resp = client.search().dataSource().patch(req); + PatchDataSourceResp resp = client.search().v2().dataSource().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/PatchSchemaSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/PatchSchemaSample.java index c52cd3b54..5a3cd1873 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/PatchSchemaSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/searchv2/PatchSchemaSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchSchemaResp resp = client.search().schema().patch(req); + PatchSchemaResp resp = client.search().v2().schema().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/security_and_compliancev1/ListDataOpenapiLogSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/security_and_compliancev1/ListDataOpenapiLogSample.java index b19c2db06..b3c2bbf30 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/security_and_compliancev1/ListDataOpenapiLogSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/security_and_compliancev1/ListDataOpenapiLogSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListDataOpenapiLogResp resp = client.securityAndCompliance().openapiLog().listData(req); + ListDataOpenapiLogResp resp = client.securityAndCompliance().v1().openapiLog().listData(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSample.java index f7e264c5b..273798bf4 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateSpreadsheetResp resp = client.sheets().spreadsheet().create(req); + CreateSpreadsheetResp resp = client.sheets().v3().spreadsheet().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFilterSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFilterSample.java index c376fee46..99ea50ced 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFilterSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFilterSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateSpreadsheetSheetFilterResp resp = client.sheets().spreadsheetSheetFilter().create(req); + CreateSpreadsheetSheetFilterResp resp = client.sheets().v3().spreadsheetSheetFilter().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFilterViewConditionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFilterViewConditionSample.java index 84abdcf5e..5449e04e2 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFilterViewConditionSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFilterViewConditionSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateSpreadsheetSheetFilterViewConditionResp resp = client.sheets().spreadsheetSheetFilterViewCondition().create(req); + CreateSpreadsheetSheetFilterViewConditionResp resp = client.sheets().v3().spreadsheetSheetFilterViewCondition().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFilterViewSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFilterViewSample.java index b50415123..e4a8a517f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFilterViewSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFilterViewSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateSpreadsheetSheetFilterViewResp resp = client.sheets().spreadsheetSheetFilterView().create(req); + CreateSpreadsheetSheetFilterViewResp resp = client.sheets().v3().spreadsheetSheetFilterView().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFloatImageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFloatImageSample.java index 0fd2f60e4..637c9c712 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFloatImageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/CreateSpreadsheetSheetFloatImageSample.java @@ -29,7 +29,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateSpreadsheetSheetFloatImageResp resp = client.sheets().spreadsheetSheetFloatImage().create(req); + CreateSpreadsheetSheetFloatImageResp resp = client.sheets().v3().spreadsheetSheetFloatImage().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFilterSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFilterSample.java index 32d3223e5..50cace7d5 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFilterSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFilterSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteSpreadsheetSheetFilterResp resp = client.sheets().spreadsheetSheetFilter().delete(req); + DeleteSpreadsheetSheetFilterResp resp = client.sheets().v3().spreadsheetSheetFilter().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFilterViewConditionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFilterViewConditionSample.java index d126e28a6..b085da13a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFilterViewConditionSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFilterViewConditionSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteSpreadsheetSheetFilterViewConditionResp resp = client.sheets().spreadsheetSheetFilterViewCondition().delete(req); + DeleteSpreadsheetSheetFilterViewConditionResp resp = client.sheets().v3().spreadsheetSheetFilterViewCondition().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFilterViewSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFilterViewSample.java index cbc9cebc7..ed094141c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFilterViewSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFilterViewSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteSpreadsheetSheetFilterViewResp resp = client.sheets().spreadsheetSheetFilterView().delete(req); + DeleteSpreadsheetSheetFilterViewResp resp = client.sheets().v3().spreadsheetSheetFilterView().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFloatImageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFloatImageSample.java index 122804875..b5e58f614 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFloatImageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/DeleteSpreadsheetSheetFloatImageSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteSpreadsheetSheetFloatImageResp resp = client.sheets().spreadsheetSheetFloatImage().delete(req); + DeleteSpreadsheetSheetFloatImageResp resp = client.sheets().v3().spreadsheetSheetFloatImage().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/FindSpreadsheetSheetSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/FindSpreadsheetSheetSample.java index 07f02a2bd..7fb446d3f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/FindSpreadsheetSheetSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/FindSpreadsheetSheetSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - FindSpreadsheetSheetResp resp = client.sheets().spreadsheetSheet().find(req); + FindSpreadsheetSheetResp resp = client.sheets().v3().spreadsheetSheet().find(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSample.java index ba8a204ce..c99af9b28 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetSpreadsheetResp resp = client.sheets().spreadsheet().get(req); + GetSpreadsheetResp resp = client.sheets().v3().spreadsheet().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFilterSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFilterSample.java index c211a7552..dc039a96d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFilterSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFilterSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetSpreadsheetSheetFilterResp resp = client.sheets().spreadsheetSheetFilter().get(req); + GetSpreadsheetSheetFilterResp resp = client.sheets().v3().spreadsheetSheetFilter().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFilterViewConditionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFilterViewConditionSample.java index ed8d8c1fd..a51ea9c13 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFilterViewConditionSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFilterViewConditionSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetSpreadsheetSheetFilterViewConditionResp resp = client.sheets().spreadsheetSheetFilterViewCondition().get(req); + GetSpreadsheetSheetFilterViewConditionResp resp = client.sheets().v3().spreadsheetSheetFilterViewCondition().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFilterViewSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFilterViewSample.java index 2412bc280..88bbf46e0 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFilterViewSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFilterViewSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetSpreadsheetSheetFilterViewResp resp = client.sheets().spreadsheetSheetFilterView().get(req); + GetSpreadsheetSheetFilterViewResp resp = client.sheets().v3().spreadsheetSheetFilterView().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFloatImageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFloatImageSample.java index 25f12b03a..199df9cfc 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFloatImageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetFloatImageSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetSpreadsheetSheetFloatImageResp resp = client.sheets().spreadsheetSheetFloatImage().get(req); + GetSpreadsheetSheetFloatImageResp resp = client.sheets().v3().spreadsheetSheetFloatImage().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetSample.java index ceb91032e..03bc41fe3 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/GetSpreadsheetSheetSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetSpreadsheetSheetResp resp = client.sheets().spreadsheetSheet().get(req); + GetSpreadsheetSheetResp resp = client.sheets().v3().spreadsheetSheet().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/MoveDimensionSpreadsheetSheetSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/MoveDimensionSpreadsheetSheetSample.java index fec3f33e7..47e344100 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/MoveDimensionSpreadsheetSheetSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/MoveDimensionSpreadsheetSheetSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - MoveDimensionSpreadsheetSheetResp resp = client.sheets().spreadsheetSheet().moveDimension(req); + MoveDimensionSpreadsheetSheetResp resp = client.sheets().v3().spreadsheetSheet().moveDimension(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/PatchSpreadsheetSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/PatchSpreadsheetSample.java index e6efdd1c5..97b28d1ff 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/PatchSpreadsheetSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/PatchSpreadsheetSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchSpreadsheetResp resp = client.sheets().spreadsheet().patch(req); + PatchSpreadsheetResp resp = client.sheets().v3().spreadsheet().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/PatchSpreadsheetSheetFilterViewSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/PatchSpreadsheetSheetFilterViewSample.java index f13b17a27..b159c8cf9 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/PatchSpreadsheetSheetFilterViewSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/PatchSpreadsheetSheetFilterViewSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchSpreadsheetSheetFilterViewResp resp = client.sheets().spreadsheetSheetFilterView().patch(req); + PatchSpreadsheetSheetFilterViewResp resp = client.sheets().v3().spreadsheetSheetFilterView().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/PatchSpreadsheetSheetFloatImageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/PatchSpreadsheetSheetFloatImageSample.java index 22c3e194e..7d0cb7e10 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/PatchSpreadsheetSheetFloatImageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/PatchSpreadsheetSheetFloatImageSample.java @@ -29,7 +29,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchSpreadsheetSheetFloatImageResp resp = client.sheets().spreadsheetSheetFloatImage().patch(req); + PatchSpreadsheetSheetFloatImageResp resp = client.sheets().v3().spreadsheetSheetFloatImage().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetFilterViewConditionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetFilterViewConditionSample.java index e963f8553..19dfd8a44 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetFilterViewConditionSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetFilterViewConditionSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - QuerySpreadsheetSheetFilterViewConditionResp resp = client.sheets().spreadsheetSheetFilterViewCondition().query(req); + QuerySpreadsheetSheetFilterViewConditionResp resp = client.sheets().v3().spreadsheetSheetFilterViewCondition().query(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetFilterViewSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetFilterViewSample.java index 81065a362..e3ce955b0 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetFilterViewSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetFilterViewSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - QuerySpreadsheetSheetFilterViewResp resp = client.sheets().spreadsheetSheetFilterView().query(req); + QuerySpreadsheetSheetFilterViewResp resp = client.sheets().v3().spreadsheetSheetFilterView().query(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetFloatImageSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetFloatImageSample.java index c683391bd..e4411e939 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetFloatImageSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetFloatImageSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - QuerySpreadsheetSheetFloatImageResp resp = client.sheets().spreadsheetSheetFloatImage().query(req); + QuerySpreadsheetSheetFloatImageResp resp = client.sheets().v3().spreadsheetSheetFloatImage().query(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetSample.java index 3cf45901f..79c798d5d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/QuerySpreadsheetSheetSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - QuerySpreadsheetSheetResp resp = client.sheets().spreadsheetSheet().query(req); + QuerySpreadsheetSheetResp resp = client.sheets().v3().spreadsheetSheet().query(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/ReplaceSpreadsheetSheetSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/ReplaceSpreadsheetSheetSample.java index a71c05e76..c474892b5 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/ReplaceSpreadsheetSheetSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/ReplaceSpreadsheetSheetSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ReplaceSpreadsheetSheetResp resp = client.sheets().spreadsheetSheet().replace(req); + ReplaceSpreadsheetSheetResp resp = client.sheets().v3().spreadsheetSheet().replace(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/UpdateSpreadsheetSheetFilterSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/UpdateSpreadsheetSheetFilterSample.java index c240c0d04..56e7d1f40 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/UpdateSpreadsheetSheetFilterSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/UpdateSpreadsheetSheetFilterSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateSpreadsheetSheetFilterResp resp = client.sheets().spreadsheetSheetFilter().update(req); + UpdateSpreadsheetSheetFilterResp resp = client.sheets().v3().spreadsheetSheetFilter().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/UpdateSpreadsheetSheetFilterViewConditionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/UpdateSpreadsheetSheetFilterViewConditionSample.java index 79e358483..5e8d8b346 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/UpdateSpreadsheetSheetFilterViewConditionSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/sheetsv3/UpdateSpreadsheetSheetFilterViewConditionSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateSpreadsheetSheetFilterViewConditionResp resp = client.sheets().spreadsheetSheetFilterViewCondition().update(req); + UpdateSpreadsheetSheetFilterViewConditionResp resp = client.sheets().v3().spreadsheetSheetFilterViewCondition().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/speech_to_textv1/FileRecognizeSpeechSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/speech_to_textv1/FileRecognizeSpeechSample.java index 060559540..0f92d3447 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/speech_to_textv1/FileRecognizeSpeechSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/speech_to_textv1/FileRecognizeSpeechSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - FileRecognizeSpeechResp resp = client.speechToText().speech().fileRecognize(req); + FileRecognizeSpeechResp resp = client.speechToText().v1().speech().fileRecognize(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/speech_to_textv1/StreamRecognizeSpeechSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/speech_to_textv1/StreamRecognizeSpeechSample.java index ec2652990..7844e4ce7 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/speech_to_textv1/StreamRecognizeSpeechSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/speech_to_textv1/StreamRecognizeSpeechSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - StreamRecognizeSpeechResp resp = client.speechToText().speech().streamRecognize(req); + StreamRecognizeSpeechResp resp = client.speechToText().v1().speech().streamRecognize(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/BatchDeleteCollaboratorTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/BatchDeleteCollaboratorTaskSample.java index dadea49e2..792d2984c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/BatchDeleteCollaboratorTaskSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/BatchDeleteCollaboratorTaskSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchDeleteCollaboratorTaskResp resp = client.task().task().batchDeleteCollaborator(req); + BatchDeleteCollaboratorTaskResp resp = client.task().v1().task().batchDeleteCollaborator(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/BatchDeleteFollowerTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/BatchDeleteFollowerTaskSample.java index a4e7bc338..c3f73c247 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/BatchDeleteFollowerTaskSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/BatchDeleteFollowerTaskSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - BatchDeleteFollowerTaskResp resp = client.task().task().batchDeleteFollower(req); + BatchDeleteFollowerTaskResp resp = client.task().v1().task().batchDeleteFollower(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CompleteTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CompleteTaskSample.java index a07d9043b..d23f84b33 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CompleteTaskSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CompleteTaskSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CompleteTaskResp resp = client.task().task().complete(req); + CompleteTaskResp resp = client.task().v1().task().complete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskCollaboratorSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskCollaboratorSample.java index 88a69cb19..56593c454 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskCollaboratorSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskCollaboratorSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateTaskCollaboratorResp resp = client.task().taskCollaborator().create(req); + CreateTaskCollaboratorResp resp = client.task().v1().taskCollaborator().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskCommentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskCommentSample.java index 7b2b9b654..459e0d833 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskCommentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskCommentSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateTaskCommentResp resp = client.task().taskComment().create(req); + CreateTaskCommentResp resp = client.task().v1().taskComment().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskFollowerSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskFollowerSample.java index 88a117ffb..19684dde4 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskFollowerSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskFollowerSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateTaskFollowerResp resp = client.task().taskFollower().create(req); + CreateTaskFollowerResp resp = client.task().v1().taskFollower().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskReminderSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskReminderSample.java index 1aa0d4e78..5ed166def 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskReminderSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskReminderSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateTaskReminderResp resp = client.task().taskReminder().create(req); + CreateTaskReminderResp resp = client.task().v1().taskReminder().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskSample.java index 48d374c69..71c29de83 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/CreateTaskSample.java @@ -31,7 +31,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateTaskResp resp = client.task().task().create(req); + CreateTaskResp resp = client.task().v1().task().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskCollaboratorSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskCollaboratorSample.java index f1c27cdb1..8bdc95081 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskCollaboratorSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskCollaboratorSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteTaskCollaboratorResp resp = client.task().taskCollaborator().delete(req); + DeleteTaskCollaboratorResp resp = client.task().v1().taskCollaborator().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskCommentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskCommentSample.java index c76a6b432..5be0edc77 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskCommentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskCommentSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteTaskCommentResp resp = client.task().taskComment().delete(req); + DeleteTaskCommentResp resp = client.task().v1().taskComment().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskFollowerSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskFollowerSample.java index 5c66a796f..ae481a69d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskFollowerSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskFollowerSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteTaskFollowerResp resp = client.task().taskFollower().delete(req); + DeleteTaskFollowerResp resp = client.task().v1().taskFollower().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskReminderSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskReminderSample.java index 0d3d34b09..9a98dd2c0 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskReminderSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskReminderSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteTaskReminderResp resp = client.task().taskReminder().delete(req); + DeleteTaskReminderResp resp = client.task().v1().taskReminder().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskSample.java index 1266a36fd..26492dd1b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/DeleteTaskSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteTaskResp resp = client.task().task().delete(req); + DeleteTaskResp resp = client.task().v1().task().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/GetTaskCommentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/GetTaskCommentSample.java index 3b47ab08c..9b9286da1 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/GetTaskCommentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/GetTaskCommentSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetTaskCommentResp resp = client.task().taskComment().get(req); + GetTaskCommentResp resp = client.task().v1().taskComment().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/GetTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/GetTaskSample.java index d440fe3ae..157c2c876 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/GetTaskSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/GetTaskSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetTaskResp resp = client.task().task().get(req); + GetTaskResp resp = client.task().v1().task().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskCollaboratorSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskCollaboratorSample.java index 27286f3d8..16c4c7532 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskCollaboratorSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskCollaboratorSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListTaskCollaboratorResp resp = client.task().taskCollaborator().list(req); + ListTaskCollaboratorResp resp = client.task().v1().taskCollaborator().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskCommentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskCommentSample.java index 737353f8f..9b168124c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskCommentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskCommentSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListTaskCommentResp resp = client.task().taskComment().list(req); + ListTaskCommentResp resp = client.task().v1().taskComment().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskFollowerSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskFollowerSample.java index d9ea6427a..9681e1cb9 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskFollowerSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskFollowerSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListTaskFollowerResp resp = client.task().taskFollower().list(req); + ListTaskFollowerResp resp = client.task().v1().taskFollower().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskReminderSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskReminderSample.java index 134306aa2..db9424420 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskReminderSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskReminderSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListTaskReminderResp resp = client.task().taskReminder().list(req); + ListTaskReminderResp resp = client.task().v1().taskReminder().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskSample.java index cc0602766..a8ad98a07 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/ListTaskSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListTaskResp resp = client.task().task().list(req); + ListTaskResp resp = client.task().v1().task().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/PatchTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/PatchTaskSample.java index 686d16ba2..e6e31ef80 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/PatchTaskSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/PatchTaskSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchTaskResp resp = client.task().task().patch(req); + PatchTaskResp resp = client.task().v1().task().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/UncompleteTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/UncompleteTaskSample.java index 0d88e1031..b16c9e24a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/UncompleteTaskSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/UncompleteTaskSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UncompleteTaskResp resp = client.task().task().uncomplete(req); + UncompleteTaskResp resp = client.task().v1().task().uncomplete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/UpdateTaskCommentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/UpdateTaskCommentSample.java index d2fbba3b3..734354983 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/UpdateTaskCommentSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv1/UpdateTaskCommentSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateTaskCommentResp resp = client.task().taskComment().update(req); + UpdateTaskCommentResp resp = client.task().v1().taskComment().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddCustomFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddCustomFieldSample.java new file mode 100644 index 000000000..61a6e43c3 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddCustomFieldSample.java @@ -0,0 +1,38 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.AddCustomFieldReq; +import com.lark.oapi.service.task.v2.model.AddCustomFieldReqBody; +import com.lark.oapi.service.task.v2.model.AddCustomFieldResp; + +// POST /open-apis/task/v2/custom_fields/:custom_field_guid/add +public class AddCustomFieldSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + AddCustomFieldReq req = AddCustomFieldReq.newBuilder() + .customFieldGuid("0110a4bd-f24b-4a93-8c1a-1732b94f9593") + .addCustomFieldReqBody(AddCustomFieldReqBody.newBuilder() + .resourceType("tasklist") + .resourceId("0110a4bd-f24b-4a93-8c1a-1732b94f9593") + .build()) + .build(); + + // 发起请求 + AddCustomFieldResp resp = client.task().v2().customField().add(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddDependenciesTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddDependenciesTaskSample.java new file mode 100644 index 000000000..b4fefdc89 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddDependenciesTaskSample.java @@ -0,0 +1,38 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.AddDependenciesTaskReq; +import com.lark.oapi.service.task.v2.model.AddDependenciesTaskReqBody; +import com.lark.oapi.service.task.v2.model.AddDependenciesTaskResp; +import com.lark.oapi.service.task.v2.model.TaskDependency; + +// POST /open-apis/task/v2/tasks/:task_guid/add_dependencies +public class AddDependenciesTaskSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + AddDependenciesTaskReq req = AddDependenciesTaskReq.newBuilder() + .taskGuid("93b7bd05-35e6-4371-b3c9-6b7cbd7100c0") + .addDependenciesTaskReqBody(AddDependenciesTaskReqBody.newBuilder() + .dependencies(new TaskDependency[]{}) + .build()) + .build(); + + // 发起请求 + AddDependenciesTaskResp resp = client.task().v2().task().addDependencies(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddMembersTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddMembersTaskSample.java new file mode 100644 index 000000000..55d63341f --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddMembersTaskSample.java @@ -0,0 +1,40 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.AddMembersTaskReq; +import com.lark.oapi.service.task.v2.model.AddMembersTaskReqBody; +import com.lark.oapi.service.task.v2.model.AddMembersTaskResp; +import com.lark.oapi.service.task.v2.model.Member; + +// POST /open-apis/task/v2/tasks/:task_guid/add_members +public class AddMembersTaskSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + AddMembersTaskReq req = AddMembersTaskReq.newBuilder() + .taskGuid("d300a75f-c56a-4be9-80d1-e47653028ceb") + .userIdType("open_id") + .addMembersTaskReqBody(AddMembersTaskReqBody.newBuilder() + .members(new Member[]{}) + .clientToken("6d99f59c-4d7d-4452-98d6-3d0556393cf6") + .build()) + .build(); + + // 发起请求 + AddMembersTaskResp resp = client.task().v2().task().addMembers(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddMembersTasklistSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddMembersTasklistSample.java new file mode 100644 index 000000000..8f3dc6ca3 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddMembersTasklistSample.java @@ -0,0 +1,39 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.AddMembersTasklistReq; +import com.lark.oapi.service.task.v2.model.AddMembersTasklistReqBody; +import com.lark.oapi.service.task.v2.model.AddMembersTasklistResp; +import com.lark.oapi.service.task.v2.model.Member; + +// POST /open-apis/task/v2/tasklists/:tasklist_guid/add_members +public class AddMembersTasklistSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + AddMembersTasklistReq req = AddMembersTasklistReq.newBuilder() + .tasklistGuid("d300a75f-c56a-4be9-80d1-e47653028ceb") + .userIdType("open_id") + .addMembersTasklistReqBody(AddMembersTasklistReqBody.newBuilder() + .members(new Member[]{}) + .build()) + .build(); + + // 发起请求 + AddMembersTasklistResp resp = client.task().v2().tasklist().addMembers(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddRemindersTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddRemindersTaskSample.java new file mode 100644 index 000000000..f7c343485 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddRemindersTaskSample.java @@ -0,0 +1,39 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.AddRemindersTaskReq; +import com.lark.oapi.service.task.v2.model.AddRemindersTaskReqBody; +import com.lark.oapi.service.task.v2.model.AddRemindersTaskResp; +import com.lark.oapi.service.task.v2.model.Reminder; + +// POST /open-apis/task/v2/tasks/:task_guid/add_reminders +public class AddRemindersTaskSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + AddRemindersTaskReq req = AddRemindersTaskReq.newBuilder() + .taskGuid("d300a75f-c56a-4be9-80d1-e47653028ceb") + .userIdType("open_id") + .addRemindersTaskReqBody(AddRemindersTaskReqBody.newBuilder() + .reminders(new Reminder[]{}) + .build()) + .build(); + + // 发起请求 + AddRemindersTaskResp resp = client.task().v2().task().addReminders(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddTasklistTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddTasklistTaskSample.java new file mode 100644 index 000000000..bf7ee330b --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/AddTasklistTaskSample.java @@ -0,0 +1,39 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.AddTasklistTaskReq; +import com.lark.oapi.service.task.v2.model.AddTasklistTaskReqBody; +import com.lark.oapi.service.task.v2.model.AddTasklistTaskResp; + +// POST /open-apis/task/v2/tasks/:task_guid/add_tasklist +public class AddTasklistTaskSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + AddTasklistTaskReq req = AddTasklistTaskReq.newBuilder() + .taskGuid("d300a75f-c56a-4be9-80d1-e47653028ceb") + .userIdType("open_id") + .addTasklistTaskReqBody(AddTasklistTaskReqBody.newBuilder() + .tasklistGuid("d300a75f-c56a-4be9-80d1-e47653028ceb") + .sectionGuid("d300a75f-c56a-4be9-80d1-e47653028ceb") + .build()) + .build(); + + // 发起请求 + AddTasklistTaskResp resp = client.task().v2().task().addTasklist(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateCommentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateCommentSample.java new file mode 100644 index 000000000..1edcc0c41 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateCommentSample.java @@ -0,0 +1,40 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.CreateCommentReq; +import com.lark.oapi.service.task.v2.model.CreateCommentResp; +import com.lark.oapi.service.task.v2.model.InputComment; + +// POST /open-apis/task/v2/comments +public class CreateCommentSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + CreateCommentReq req = CreateCommentReq.newBuilder() + .userIdType("open_id") + .inputComment(InputComment.newBuilder() + .content("这是一条评论。") + .replyToCommentId("6937231762296684564") + .resourceType("task") + .resourceId("ccb55625-95d2-2e80-655f-0e40bf67953f") + .build()) + .build(); + + // 发起请求 + CreateCommentResp resp = client.task().v2().comment().create(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateCustomFieldOptionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateCustomFieldOptionSample.java new file mode 100644 index 000000000..9238e09f6 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateCustomFieldOptionSample.java @@ -0,0 +1,41 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.CreateCustomFieldOptionReq; +import com.lark.oapi.service.task.v2.model.CreateCustomFieldOptionResp; +import com.lark.oapi.service.task.v2.model.InputOption; + +// POST /open-apis/task/v2/custom_fields/:custom_field_guid/options +public class CreateCustomFieldOptionSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + CreateCustomFieldOptionReq req = CreateCustomFieldOptionReq.newBuilder() + .customFieldGuid("b13adf3c-cad6-4e02-8929-550c112b5633") + .inputOption(InputOption.newBuilder() + .name("高优") + .colorIndex(10) + .insertBefore("2bd905f8-ef38-408b-aa1f-2b2ad33b2913") + .insertAfter("b13adf3c-cad6-4e02-8929-550c112b5633") + .isHidden(false) + .build()) + .build(); + + // 发起请求 + CreateCustomFieldOptionResp resp = client.task().v2().customFieldOption().create(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateCustomFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateCustomFieldSample.java new file mode 100644 index 000000000..71ad16826 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateCustomFieldSample.java @@ -0,0 +1,44 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.*; + +// POST /open-apis/task/v2/custom_fields +public class CreateCustomFieldSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + CreateCustomFieldReq req = CreateCustomFieldReq.newBuilder() + .userIdType("open_id") + .inputCustomField(InputCustomField.newBuilder() + .resourceType("tasklist") + .resourceId("ec5ed63d-a4a9-44de-a935-7ba243471c0a") + .name("优先级") + .type("number") + .numberSetting(NumberSetting.newBuilder().build()) + .memberSetting(MemberSetting.newBuilder().build()) + .datetimeSetting(DatetimeSetting.newBuilder().build()) + .singleSelectSetting(SelectSetting.newBuilder().build()) + .multiSelectSetting(SelectSetting.newBuilder().build()) + .textSetting(TextSetting.newBuilder().build()) + .build()) + .build(); + + // 发起请求 + CreateCustomFieldResp resp = client.task().v2().customField().create(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateSectionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateSectionSample.java new file mode 100644 index 000000000..0fb1d78c6 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateSectionSample.java @@ -0,0 +1,41 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.CreateSectionReq; +import com.lark.oapi.service.task.v2.model.CreateSectionResp; +import com.lark.oapi.service.task.v2.model.InputSection; + +// POST /open-apis/task/v2/sections +public class CreateSectionSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + CreateSectionReq req = CreateSectionReq.newBuilder() + .userIdType("open_id") + .inputSection(InputSection.newBuilder() + .name("已经审核过的任务") + .resourceType("tasklist") + .resourceId("cc371766-6584-cf50-a222-c22cd9055004") + .insertBefore("e6e37dcc-f75a-5936-f589-12fb4b5c80c2") + .insertAfter("e6e37dcc-f75a-5936-f589-12fb4b5c80c2") + .build()) + .build(); + + // 发起请求 + CreateSectionResp resp = client.task().v2().section().create(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateTaskSample.java new file mode 100644 index 000000000..b2982eaa8 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateTaskSample.java @@ -0,0 +1,51 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.*; + +// POST /open-apis/task/v2/tasks +public class CreateTaskSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + CreateTaskReq req = CreateTaskReq.newBuilder() + .userIdType("open_id") + .inputTask(InputTask.newBuilder() + .summary("针对全年销售进行一次复盘") + .description("需要事先阅读复盘总结文档") + .due(Due.newBuilder().build()) + .origin(Origin.newBuilder().build()) + .extra("dGVzdA==") + .completedAt("0") + .members(new Member[]{}) + .repeatRule("FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR") + .customComplete(CustomComplete.newBuilder().build()) + .tasklists(new TaskInTasklistInfo[]{}) + .clientToken("daa2237f-8310-4707-a83b-52c8a81e0fb7") + .start(Start.newBuilder().build()) + .reminders(new Reminder[]{}) + .mode(2) + .isMilestone(false) + .customFields(new InputCustomFieldValue[]{}) + .docxSource(DocxSource.newBuilder().build()) + .build()) + .build(); + + // 发起请求 + CreateTaskResp resp = client.task().v2().task().create(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateTaskSubtaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateTaskSubtaskSample.java new file mode 100644 index 000000000..fa82d934d --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateTaskSubtaskSample.java @@ -0,0 +1,52 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.*; + +// POST /open-apis/task/v2/tasks/:task_guid/subtasks +public class CreateTaskSubtaskSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + CreateTaskSubtaskReq req = CreateTaskSubtaskReq.newBuilder() + .taskGuid("e297ddff-06ca-4166-b917-4ce57cd3a7a0") + .userIdType("open_id") + .inputTask(InputTask.newBuilder() + .summary("针对全年销售进行一次复盘") + .description("需要事先阅读复盘总结文档") + .due(Due.newBuilder().build()) + .origin(Origin.newBuilder().build()) + .extra("dGVzdA==") + .completedAt("0") + .members(new Member[]{}) + .repeatRule("FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR") + .customComplete(CustomComplete.newBuilder().build()) + .tasklists(new TaskInTasklistInfo[]{}) + .clientToken("daa2237f-8310-4707-a83b-52c8a81e0fb7") + .start(Start.newBuilder().build()) + .reminders(new Reminder[]{}) + .mode(2) + .isMilestone(false) + .customFields(new InputCustomFieldValue[]{}) + .docxSource(DocxSource.newBuilder().build()) + .build()) + .build(); + + // 发起请求 + CreateTaskSubtaskResp resp = client.task().v2().taskSubtask().create(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateTasklistActivitySubscriptionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateTasklistActivitySubscriptionSample.java new file mode 100644 index 000000000..722cbe4a4 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateTasklistActivitySubscriptionSample.java @@ -0,0 +1,42 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.CreateTasklistActivitySubscriptionReq; +import com.lark.oapi.service.task.v2.model.CreateTasklistActivitySubscriptionResp; +import com.lark.oapi.service.task.v2.model.Member; +import com.lark.oapi.service.task.v2.model.TasklistActivitySubscription; + +// POST /open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions +public class CreateTasklistActivitySubscriptionSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + CreateTasklistActivitySubscriptionReq req = CreateTasklistActivitySubscriptionReq.newBuilder() + .tasklistGuid("d19e3a2a-edc0-4e4e-b7cc-950e162b53ae") + .userIdType("open_id") + .tasklistActivitySubscription(TasklistActivitySubscription.newBuilder() + .name("我的订阅") + .subscribers(new Member[]{}) + .includeKeys(new Integer[]{}) + .disabled(false) + .build()) + .build(); + + // 发起请求 + CreateTasklistActivitySubscriptionResp resp = client.task().v2().tasklistActivitySubscription().create(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateTasklistSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateTasklistSample.java new file mode 100644 index 000000000..42550ed54 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/CreateTasklistSample.java @@ -0,0 +1,39 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.CreateTasklistReq; +import com.lark.oapi.service.task.v2.model.CreateTasklistResp; +import com.lark.oapi.service.task.v2.model.InputTasklist; +import com.lark.oapi.service.task.v2.model.Member; + +// POST /open-apis/task/v2/tasklists +public class CreateTasklistSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + CreateTasklistReq req = CreateTasklistReq.newBuilder() + .userIdType("open_id") + .inputTasklist(InputTasklist.newBuilder() + .name("年会工作任务清单") + .members(new Member[]{}) + .build()) + .build(); + + // 发起请求 + CreateTasklistResp resp = client.task().v2().tasklist().create(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteAttachmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteAttachmentSample.java new file mode 100644 index 000000000..c06bad3fa --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteAttachmentSample.java @@ -0,0 +1,33 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.DeleteAttachmentReq; +import com.lark.oapi.service.task.v2.model.DeleteAttachmentResp; + +// DELETE /open-apis/task/v2/attachments/:attachment_guid +public class DeleteAttachmentSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + DeleteAttachmentReq req = DeleteAttachmentReq.newBuilder() + .attachmentGuid("b59aa7a3-e98c-4830-8273-cbb29f89b837") + .build(); + + // 发起请求 + DeleteAttachmentResp resp = client.task().v2().attachment().delete(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteCommentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteCommentSample.java new file mode 100644 index 000000000..004ff1196 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteCommentSample.java @@ -0,0 +1,33 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.DeleteCommentReq; +import com.lark.oapi.service.task.v2.model.DeleteCommentResp; + +// DELETE /open-apis/task/v2/comments/:comment_id +public class DeleteCommentSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + DeleteCommentReq req = DeleteCommentReq.newBuilder() + .commentId("7198104824246747156") + .build(); + + // 发起请求 + DeleteCommentResp resp = client.task().v2().comment().delete(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteSectionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteSectionSample.java new file mode 100644 index 000000000..f13cc3752 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteSectionSample.java @@ -0,0 +1,33 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.DeleteSectionReq; +import com.lark.oapi.service.task.v2.model.DeleteSectionResp; + +// DELETE /open-apis/task/v2/sections/:section_guid +public class DeleteSectionSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + DeleteSectionReq req = DeleteSectionReq.newBuilder() + .sectionGuid("9842501a-9f47-4ff5-a622-d319eeecb97f") + .build(); + + // 发起请求 + DeleteSectionResp resp = client.task().v2().section().delete(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteTaskSample.java new file mode 100644 index 000000000..2a40fa2e1 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteTaskSample.java @@ -0,0 +1,33 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.DeleteTaskReq; +import com.lark.oapi.service.task.v2.model.DeleteTaskResp; + +// DELETE /open-apis/task/v2/tasks/:task_guid +public class DeleteTaskSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + DeleteTaskReq req = DeleteTaskReq.newBuilder() + .taskGuid("e297ddff-06ca-4166-b917-4ce57cd3a7a0") + .build(); + + // 发起请求 + DeleteTaskResp resp = client.task().v2().task().delete(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteTasklistActivitySubscriptionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteTasklistActivitySubscriptionSample.java new file mode 100644 index 000000000..d3cf843a1 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteTasklistActivitySubscriptionSample.java @@ -0,0 +1,34 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.DeleteTasklistActivitySubscriptionReq; +import com.lark.oapi.service.task.v2.model.DeleteTasklistActivitySubscriptionResp; + +// DELETE /open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid +public class DeleteTasklistActivitySubscriptionSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + DeleteTasklistActivitySubscriptionReq req = DeleteTasklistActivitySubscriptionReq.newBuilder() + .tasklistGuid("f5ca6747-5ac3-422e-a97e-972c1b2c24f3") + .activitySubscriptionGuid("d19e3a2a-edc0-4e4e-b7cc-950e162b53ae") + .build(); + + // 发起请求 + DeleteTasklistActivitySubscriptionResp resp = client.task().v2().tasklistActivitySubscription().delete(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteTasklistSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteTasklistSample.java new file mode 100644 index 000000000..82747772a --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/DeleteTasklistSample.java @@ -0,0 +1,33 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.DeleteTasklistReq; +import com.lark.oapi.service.task.v2.model.DeleteTasklistResp; + +// DELETE /open-apis/task/v2/tasklists/:tasklist_guid +public class DeleteTasklistSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + DeleteTasklistReq req = DeleteTasklistReq.newBuilder() + .tasklistGuid("d300a75f-c56a-4be9-80d1-e47653028ceb") + .build(); + + // 发起请求 + DeleteTasklistResp resp = client.task().v2().tasklist().delete(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetAttachmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetAttachmentSample.java new file mode 100644 index 000000000..0ac410cf8 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetAttachmentSample.java @@ -0,0 +1,34 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.GetAttachmentReq; +import com.lark.oapi.service.task.v2.model.GetAttachmentResp; + +// GET /open-apis/task/v2/attachments/:attachment_guid +public class GetAttachmentSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + GetAttachmentReq req = GetAttachmentReq.newBuilder() + .attachmentGuid("b59aa7a3-e98c-4830-8273-cbb29f89b837") + .userIdType("open_id") + .build(); + + // 发起请求 + GetAttachmentResp resp = client.task().v2().attachment().get(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetCommentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetCommentSample.java new file mode 100644 index 000000000..12d1b91de --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetCommentSample.java @@ -0,0 +1,34 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.GetCommentReq; +import com.lark.oapi.service.task.v2.model.GetCommentResp; + +// GET /open-apis/task/v2/comments/:comment_id +public class GetCommentSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + GetCommentReq req = GetCommentReq.newBuilder() + .commentId("7198104824246747156") + .userIdType("open_id") + .build(); + + // 发起请求 + GetCommentResp resp = client.task().v2().comment().get(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetCustomFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetCustomFieldSample.java new file mode 100644 index 000000000..b0b938fc1 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetCustomFieldSample.java @@ -0,0 +1,34 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.GetCustomFieldReq; +import com.lark.oapi.service.task.v2.model.GetCustomFieldResp; + +// GET /open-apis/task/v2/custom_fields/:custom_field_guid +public class GetCustomFieldSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + GetCustomFieldReq req = GetCustomFieldReq.newBuilder() + .customFieldGuid("5ffbe0ca-6600-41e0-a634-2b38cbcf13b8") + .userIdType("open_id") + .build(); + + // 发起请求 + GetCustomFieldResp resp = client.task().v2().customField().get(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetSectionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetSectionSample.java new file mode 100644 index 000000000..562fe4a0b --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetSectionSample.java @@ -0,0 +1,34 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.GetSectionReq; +import com.lark.oapi.service.task.v2.model.GetSectionResp; + +// GET /open-apis/task/v2/sections/:section_guid +public class GetSectionSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + GetSectionReq req = GetSectionReq.newBuilder() + .sectionGuid("9842501a-9f47-4ff5-a622-d319eeecb97f") + .userIdType("open_id") + .build(); + + // 发起请求 + GetSectionResp resp = client.task().v2().section().get(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetTaskSample.java new file mode 100644 index 000000000..b9fb1e031 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetTaskSample.java @@ -0,0 +1,34 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.GetTaskReq; +import com.lark.oapi.service.task.v2.model.GetTaskResp; + +// GET /open-apis/task/v2/tasks/:task_guid +public class GetTaskSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + GetTaskReq req = GetTaskReq.newBuilder() + .taskGuid("e297ddff-06ca-4166-b917-4ce57cd3a7a0") + .userIdType("open_id") + .build(); + + // 发起请求 + GetTaskResp resp = client.task().v2().task().get(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetTasklistActivitySubscriptionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetTasklistActivitySubscriptionSample.java new file mode 100644 index 000000000..062b12e37 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetTasklistActivitySubscriptionSample.java @@ -0,0 +1,35 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.GetTasklistActivitySubscriptionReq; +import com.lark.oapi.service.task.v2.model.GetTasklistActivitySubscriptionResp; + +// GET /open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid +public class GetTasklistActivitySubscriptionSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + GetTasklistActivitySubscriptionReq req = GetTasklistActivitySubscriptionReq.newBuilder() + .tasklistGuid("33991879-704f-444f-81d7-55a6aa7be80c") + .activitySubscriptionGuid("33991879-704f-444f-81d7-55a6aa7be80c") + .userIdType("open_id") + .build(); + + // 发起请求 + GetTasklistActivitySubscriptionResp resp = client.task().v2().tasklistActivitySubscription().get(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetTasklistSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetTasklistSample.java new file mode 100644 index 000000000..77f89031c --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/GetTasklistSample.java @@ -0,0 +1,34 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.GetTasklistReq; +import com.lark.oapi.service.task.v2.model.GetTasklistResp; + +// GET /open-apis/task/v2/tasklists/:tasklist_guid +public class GetTasklistSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + GetTasklistReq req = GetTasklistReq.newBuilder() + .tasklistGuid("d300a75f-c56a-4be9-80d1-e47653028ceb") + .userIdType("open_id") + .build(); + + // 发起请求 + GetTasklistResp resp = client.task().v2().tasklist().get(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListAttachmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListAttachmentSample.java new file mode 100644 index 000000000..059b047b9 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListAttachmentSample.java @@ -0,0 +1,37 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.ListAttachmentReq; +import com.lark.oapi.service.task.v2.model.ListAttachmentResp; + +// GET /open-apis/task/v2/attachments +public class ListAttachmentSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + ListAttachmentReq req = ListAttachmentReq.newBuilder() + .pageSize(50) + .pageToken("aWQ9NzEwMjMzMjMxMDE=") + .resourceType("task") + .resourceId("9842501a-9f47-4ff5-a622-d319eeecb97f") + .userIdType("open_id") + .build(); + + // 发起请求 + ListAttachmentResp resp = client.task().v2().attachment().list(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListCommentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListCommentSample.java new file mode 100644 index 000000000..a58a371bf --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListCommentSample.java @@ -0,0 +1,38 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.ListCommentReq; +import com.lark.oapi.service.task.v2.model.ListCommentResp; + +// GET /open-apis/task/v2/comments +public class ListCommentSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + ListCommentReq req = ListCommentReq.newBuilder() + .pageSize(50) + .pageToken("aWQ9NzEwMjMzMjMxMDE=") + .resourceType("task") + .resourceId("d300a75f-c56a-4be9-80d1-e47653028ceb") + .direction("asc") + .userIdType("open_id") + .build(); + + // 发起请求 + ListCommentResp resp = client.task().v2().comment().list(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListCustomFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListCustomFieldSample.java new file mode 100644 index 000000000..2f7c12b4b --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListCustomFieldSample.java @@ -0,0 +1,37 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.ListCustomFieldReq; +import com.lark.oapi.service.task.v2.model.ListCustomFieldResp; + +// GET /open-apis/task/v2/custom_fields +public class ListCustomFieldSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + ListCustomFieldReq req = ListCustomFieldReq.newBuilder() + .pageSize(50) + .pageToken("aWQ9NzEwMjMzMjMxMDE=") + .userIdType("open_id") + .resourceType("tasklist") + .resourceId("5ffbe0ca-6600-41e0-a634-2b38cbcf13b8") + .build(); + + // 发起请求 + ListCustomFieldResp resp = client.task().v2().customField().list(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListSectionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListSectionSample.java new file mode 100644 index 000000000..799feddf9 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListSectionSample.java @@ -0,0 +1,37 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.ListSectionReq; +import com.lark.oapi.service.task.v2.model.ListSectionResp; + +// GET /open-apis/task/v2/sections +public class ListSectionSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + ListSectionReq req = ListSectionReq.newBuilder() + .pageSize(50) + .pageToken("aWQ9NzEwMjMzMjMxMDE=") + .resourceType("tasklist") + .resourceId("caef228f-2342-23c1-c36d-91186414dc64") + .userIdType("open_id") + .build(); + + // 发起请求 + ListSectionResp resp = client.task().v2().section().list(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListTaskSample.java new file mode 100644 index 000000000..171743ab4 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListTaskSample.java @@ -0,0 +1,37 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.ListTaskReq; +import com.lark.oapi.service.task.v2.model.ListTaskResp; + +// GET /open-apis/task/v2/tasks +public class ListTaskSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + ListTaskReq req = ListTaskReq.newBuilder() + .pageSize(50) + .pageToken("aWQ9NzEwMjMzMjMxMDE=") + .completed(true) + .type("my_tasks") + .userIdType("open_id") + .build(); + + // 发起请求 + ListTaskResp resp = client.task().v2().task().list(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListTaskSubtaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListTaskSubtaskSample.java new file mode 100644 index 000000000..6663fa3ce --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListTaskSubtaskSample.java @@ -0,0 +1,36 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.ListTaskSubtaskReq; +import com.lark.oapi.service.task.v2.model.ListTaskSubtaskResp; + +// GET /open-apis/task/v2/tasks/:task_guid/subtasks +public class ListTaskSubtaskSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + ListTaskSubtaskReq req = ListTaskSubtaskReq.newBuilder() + .taskGuid("d300a75f-c56a-4be9-80d1-e47653028ceb") + .pageSize(50) + .pageToken("aWQ9NzEwMjMzMjMxMDE=") + .userIdType("open_id") + .build(); + + // 发起请求 + ListTaskSubtaskResp resp = client.task().v2().taskSubtask().list(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListTasklistActivitySubscriptionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListTasklistActivitySubscriptionSample.java new file mode 100644 index 000000000..4174d7ca9 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListTasklistActivitySubscriptionSample.java @@ -0,0 +1,35 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.ListTasklistActivitySubscriptionReq; +import com.lark.oapi.service.task.v2.model.ListTasklistActivitySubscriptionResp; + +// GET /open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions +public class ListTasklistActivitySubscriptionSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + ListTasklistActivitySubscriptionReq req = ListTasklistActivitySubscriptionReq.newBuilder() + .tasklistGuid("d19e3a2a-edc0-4e4e-b7cc-950e162b53ae") + .limit(50) + .userIdType("open_id") + .build(); + + // 发起请求 + ListTasklistActivitySubscriptionResp resp = client.task().v2().tasklistActivitySubscription().list(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListTasklistSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListTasklistSample.java new file mode 100644 index 000000000..f2f710d98 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/ListTasklistSample.java @@ -0,0 +1,35 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.ListTasklistReq; +import com.lark.oapi.service.task.v2.model.ListTasklistResp; + +// GET /open-apis/task/v2/tasklists +public class ListTasklistSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + ListTasklistReq req = ListTasklistReq.newBuilder() + .pageSize(50) + .pageToken("aWQ9NzEwMjMzMjMxMDE=") + .userIdType("open_id") + .build(); + + // 发起请求 + ListTasklistResp resp = client.task().v2().tasklist().list(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchCommentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchCommentSample.java new file mode 100644 index 000000000..eb02f05b7 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchCommentSample.java @@ -0,0 +1,40 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.InputComment; +import com.lark.oapi.service.task.v2.model.PatchCommentReq; +import com.lark.oapi.service.task.v2.model.PatchCommentReqBody; +import com.lark.oapi.service.task.v2.model.PatchCommentResp; + +// PATCH /open-apis/task/v2/comments/:comment_id +public class PatchCommentSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + PatchCommentReq req = PatchCommentReq.newBuilder() + .commentId("7198104824246747156") + .userIdType("open_id") + .patchCommentReqBody(PatchCommentReqBody.newBuilder() + .comment(InputComment.newBuilder().build()) + .updateFields(new String[]{}) + .build()) + .build(); + + // 发起请求 + PatchCommentResp resp = client.task().v2().comment().patch(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchCustomFieldOptionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchCustomFieldOptionSample.java new file mode 100644 index 000000000..15b14377a --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchCustomFieldOptionSample.java @@ -0,0 +1,40 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.InputOption; +import com.lark.oapi.service.task.v2.model.PatchCustomFieldOptionReq; +import com.lark.oapi.service.task.v2.model.PatchCustomFieldOptionReqBody; +import com.lark.oapi.service.task.v2.model.PatchCustomFieldOptionResp; + +// PATCH /open-apis/task/v2/custom_fields/:custom_field_guid/options/:option_guid +public class PatchCustomFieldOptionSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + PatchCustomFieldOptionReq req = PatchCustomFieldOptionReq.newBuilder() + .customFieldGuid("b13adf3c-cad6-4e02-8929-550c112b5633") + .optionGuid("b13adf3c-cad6-4e02-8929-550c112b5633") + .patchCustomFieldOptionReqBody(PatchCustomFieldOptionReqBody.newBuilder() + .option(InputOption.newBuilder().build()) + .updateFields(new String[]{}) + .build()) + .build(); + + // 发起请求 + PatchCustomFieldOptionResp resp = client.task().v2().customFieldOption().patch(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchCustomFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchCustomFieldSample.java new file mode 100644 index 000000000..76a8ef9f6 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchCustomFieldSample.java @@ -0,0 +1,40 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.InputCustomField; +import com.lark.oapi.service.task.v2.model.PatchCustomFieldReq; +import com.lark.oapi.service.task.v2.model.PatchCustomFieldReqBody; +import com.lark.oapi.service.task.v2.model.PatchCustomFieldResp; + +// PATCH /open-apis/task/v2/custom_fields/:custom_field_guid +public class PatchCustomFieldSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + PatchCustomFieldReq req = PatchCustomFieldReq.newBuilder() + .customFieldGuid("5ffbe0ca-6600-41e0-a634-2b38cbcf13b8") + .userIdType("open_id") + .patchCustomFieldReqBody(PatchCustomFieldReqBody.newBuilder() + .customField(InputCustomField.newBuilder().build()) + .updateFields(new String[]{}) + .build()) + .build(); + + // 发起请求 + PatchCustomFieldResp resp = client.task().v2().customField().patch(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchSectionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchSectionSample.java new file mode 100644 index 000000000..d9f3d138d --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchSectionSample.java @@ -0,0 +1,40 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.InputSection; +import com.lark.oapi.service.task.v2.model.PatchSectionReq; +import com.lark.oapi.service.task.v2.model.PatchSectionReqBody; +import com.lark.oapi.service.task.v2.model.PatchSectionResp; + +// PATCH /open-apis/task/v2/sections/:section_guid +public class PatchSectionSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + PatchSectionReq req = PatchSectionReq.newBuilder() + .sectionGuid("9842501a-9f47-4ff5-a622-d319eeecb97f") + .userIdType("open_id") + .patchSectionReqBody(PatchSectionReqBody.newBuilder() + .section(InputSection.newBuilder().build()) + .updateFields(new String[]{}) + .build()) + .build(); + + // 发起请求 + PatchSectionResp resp = client.task().v2().section().patch(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchTaskSample.java new file mode 100644 index 000000000..e8413914a --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchTaskSample.java @@ -0,0 +1,40 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.InputTask; +import com.lark.oapi.service.task.v2.model.PatchTaskReq; +import com.lark.oapi.service.task.v2.model.PatchTaskReqBody; +import com.lark.oapi.service.task.v2.model.PatchTaskResp; + +// PATCH /open-apis/task/v2/tasks/:task_guid +public class PatchTaskSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + PatchTaskReq req = PatchTaskReq.newBuilder() + .taskGuid("e297ddff-06ca-4166-b917-4ce57cd3a7a0") + .userIdType("open_id") + .patchTaskReqBody(PatchTaskReqBody.newBuilder() + .task(InputTask.newBuilder().build()) + .updateFields(new String[]{}) + .build()) + .build(); + + // 发起请求 + PatchTaskResp resp = client.task().v2().task().patch(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchTasklistActivitySubscriptionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchTasklistActivitySubscriptionSample.java new file mode 100644 index 000000000..2bf2a4807 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchTasklistActivitySubscriptionSample.java @@ -0,0 +1,41 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.PatchTasklistActivitySubscriptionReq; +import com.lark.oapi.service.task.v2.model.PatchTasklistActivitySubscriptionReqBody; +import com.lark.oapi.service.task.v2.model.PatchTasklistActivitySubscriptionResp; +import com.lark.oapi.service.task.v2.model.TasklistActivitySubscription; + +// PATCH /open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid +public class PatchTasklistActivitySubscriptionSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + PatchTasklistActivitySubscriptionReq req = PatchTasklistActivitySubscriptionReq.newBuilder() + .tasklistGuid("33991879-704f-444f-81d7-55a6aa7be80c") + .activitySubscriptionGuid("f5ca6747-5ac3-422e-a97e-972c1b2c24f3") + .userIdType("open_id") + .patchTasklistActivitySubscriptionReqBody(PatchTasklistActivitySubscriptionReqBody.newBuilder() + .activitySubscription(TasklistActivitySubscription.newBuilder().build()) + .updateFields(new String[]{}) + .build()) + .build(); + + // 发起请求 + PatchTasklistActivitySubscriptionResp resp = client.task().v2().tasklistActivitySubscription().patch(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchTasklistSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchTasklistSample.java new file mode 100644 index 000000000..85bdc8f4f --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/PatchTasklistSample.java @@ -0,0 +1,41 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.InputTasklist; +import com.lark.oapi.service.task.v2.model.PatchTasklistReq; +import com.lark.oapi.service.task.v2.model.PatchTasklistReqBody; +import com.lark.oapi.service.task.v2.model.PatchTasklistResp; + +// PATCH /open-apis/task/v2/tasklists/:tasklist_guid +public class PatchTasklistSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + PatchTasklistReq req = PatchTasklistReq.newBuilder() + .tasklistGuid("d300a75f-c56a-4be9-80d1-e47653028ceb") + .userIdType("open_id") + .patchTasklistReqBody(PatchTasklistReqBody.newBuilder() + .tasklist(InputTasklist.newBuilder().build()) + .updateFields(new String[]{}) + .originOwnerToRole("none") + .build()) + .build(); + + // 发起请求 + PatchTasklistResp resp = client.task().v2().tasklist().patch(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveCustomFieldSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveCustomFieldSample.java new file mode 100644 index 000000000..22d1f437b --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveCustomFieldSample.java @@ -0,0 +1,38 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.RemoveCustomFieldReq; +import com.lark.oapi.service.task.v2.model.RemoveCustomFieldReqBody; +import com.lark.oapi.service.task.v2.model.RemoveCustomFieldResp; + +// POST /open-apis/task/v2/custom_fields/:custom_field_guid/remove +public class RemoveCustomFieldSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + RemoveCustomFieldReq req = RemoveCustomFieldReq.newBuilder() + .customFieldGuid("0110a4bd-f24b-4a93-8c1a-1732b94f9593") + .removeCustomFieldReqBody(RemoveCustomFieldReqBody.newBuilder() + .resourceType("tasklist") + .resourceId("0110a4bd-f24b-4a93-8c1a-1732b94f9593") + .build()) + .build(); + + // 发起请求 + RemoveCustomFieldResp resp = client.task().v2().customField().remove(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveDependenciesTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveDependenciesTaskSample.java new file mode 100644 index 000000000..71417e486 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveDependenciesTaskSample.java @@ -0,0 +1,38 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.RemoveDependenciesTaskReq; +import com.lark.oapi.service.task.v2.model.RemoveDependenciesTaskReqBody; +import com.lark.oapi.service.task.v2.model.RemoveDependenciesTaskResp; +import com.lark.oapi.service.task.v2.model.TaskDependency; + +// POST /open-apis/task/v2/tasks/:task_guid/remove_dependencies +public class RemoveDependenciesTaskSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + RemoveDependenciesTaskReq req = RemoveDependenciesTaskReq.newBuilder() + .taskGuid("93b7bd05-35e6-4371-b3c9-6b7cbd7100c0") + .removeDependenciesTaskReqBody(RemoveDependenciesTaskReqBody.newBuilder() + .dependencies(new TaskDependency[]{}) + .build()) + .build(); + + // 发起请求 + RemoveDependenciesTaskResp resp = client.task().v2().task().removeDependencies(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveMembersTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveMembersTaskSample.java new file mode 100644 index 000000000..2e50e157a --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveMembersTaskSample.java @@ -0,0 +1,39 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.Member; +import com.lark.oapi.service.task.v2.model.RemoveMembersTaskReq; +import com.lark.oapi.service.task.v2.model.RemoveMembersTaskReqBody; +import com.lark.oapi.service.task.v2.model.RemoveMembersTaskResp; + +// POST /open-apis/task/v2/tasks/:task_guid/remove_members +public class RemoveMembersTaskSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + RemoveMembersTaskReq req = RemoveMembersTaskReq.newBuilder() + .taskGuid("d300a75f-c56a-4be9-80d1-e47653028ceb") + .userIdType("open_id") + .removeMembersTaskReqBody(RemoveMembersTaskReqBody.newBuilder() + .members(new Member[]{}) + .build()) + .build(); + + // 发起请求 + RemoveMembersTaskResp resp = client.task().v2().task().removeMembers(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveMembersTasklistSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveMembersTasklistSample.java new file mode 100644 index 000000000..22d1b15b4 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveMembersTasklistSample.java @@ -0,0 +1,39 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.Member; +import com.lark.oapi.service.task.v2.model.RemoveMembersTasklistReq; +import com.lark.oapi.service.task.v2.model.RemoveMembersTasklistReqBody; +import com.lark.oapi.service.task.v2.model.RemoveMembersTasklistResp; + +// POST /open-apis/task/v2/tasklists/:tasklist_guid/remove_members +public class RemoveMembersTasklistSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + RemoveMembersTasklistReq req = RemoveMembersTasklistReq.newBuilder() + .tasklistGuid("d300a75f-c56a-4be9-80d1-e47653028ceb") + .userIdType("open_id") + .removeMembersTasklistReqBody(RemoveMembersTasklistReqBody.newBuilder() + .members(new Member[]{}) + .build()) + .build(); + + // 发起请求 + RemoveMembersTasklistResp resp = client.task().v2().tasklist().removeMembers(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveRemindersTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveRemindersTaskSample.java new file mode 100644 index 000000000..78cfb62d1 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveRemindersTaskSample.java @@ -0,0 +1,38 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.RemoveRemindersTaskReq; +import com.lark.oapi.service.task.v2.model.RemoveRemindersTaskReqBody; +import com.lark.oapi.service.task.v2.model.RemoveRemindersTaskResp; + +// POST /open-apis/task/v2/tasks/:task_guid/remove_reminders +public class RemoveRemindersTaskSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + RemoveRemindersTaskReq req = RemoveRemindersTaskReq.newBuilder() + .taskGuid("d300a75f-c56a-4be9-80d1-e47653028ceb") + .userIdType("open_id") + .removeRemindersTaskReqBody(RemoveRemindersTaskReqBody.newBuilder() + .reminderIds(new String[]{}) + .build()) + .build(); + + // 发起请求 + RemoveRemindersTaskResp resp = client.task().v2().task().removeReminders(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveTasklistTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveTasklistTaskSample.java new file mode 100644 index 000000000..04ba23fff --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/RemoveTasklistTaskSample.java @@ -0,0 +1,38 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.RemoveTasklistTaskReq; +import com.lark.oapi.service.task.v2.model.RemoveTasklistTaskReqBody; +import com.lark.oapi.service.task.v2.model.RemoveTasklistTaskResp; + +// POST /open-apis/task/v2/tasks/:task_guid/remove_tasklist +public class RemoveTasklistTaskSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + RemoveTasklistTaskReq req = RemoveTasklistTaskReq.newBuilder() + .taskGuid("d300a75f-c56a-4be9-80d1-e47653028ceb") + .userIdType("open_id") + .removeTasklistTaskReqBody(RemoveTasklistTaskReqBody.newBuilder() + .tasklistGuid("d300a75f-c56a-4be9-80d1-e47653028ceb") + .build()) + .build(); + + // 发起请求 + RemoveTasklistTaskResp resp = client.task().v2().task().removeTasklist(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/TasklistsTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/TasklistsTaskSample.java new file mode 100644 index 000000000..e630fc2da --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/TasklistsTaskSample.java @@ -0,0 +1,33 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.TasklistsTaskReq; +import com.lark.oapi.service.task.v2.model.TasklistsTaskResp; + +// GET /open-apis/task/v2/tasks/:task_guid/tasklists +public class TasklistsTaskSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + TasklistsTaskReq req = TasklistsTaskReq.newBuilder() + .taskGuid("d300a75f-c56a-4be9-80d1-e47653028ceb") + .build(); + + // 发起请求 + TasklistsTaskResp resp = client.task().v2().task().tasklists(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/TasksSectionSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/TasksSectionSample.java new file mode 100644 index 000000000..68e546906 --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/TasksSectionSample.java @@ -0,0 +1,39 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.TasksSectionReq; +import com.lark.oapi.service.task.v2.model.TasksSectionResp; + +// GET /open-apis/task/v2/sections/:section_guid/tasks +public class TasksSectionSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + TasksSectionReq req = TasksSectionReq.newBuilder() + .sectionGuid("9842501a-9f47-4ff5-a622-d319eeecb97f") + .pageSize(50) + .pageToken("aWQ9NzEwMjMzMjMxMDE=") + .completed(true) + .createdFrom("1675742789470") + .createdTo("1675742789470") + .userIdType("open_id") + .build(); + + // 发起请求 + TasksSectionResp resp = client.task().v2().section().tasks(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/TasksTasklistSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/TasksTasklistSample.java new file mode 100644 index 000000000..9a3ab61ca --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/TasksTasklistSample.java @@ -0,0 +1,39 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.TasksTasklistReq; +import com.lark.oapi.service.task.v2.model.TasksTasklistResp; + +// GET /open-apis/task/v2/tasklists/:tasklist_guid/tasks +public class TasksTasklistSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + TasksTasklistReq req = TasksTasklistReq.newBuilder() + .tasklistGuid("d300a75f-c56a-4be9-80d1-e47653028ceb") + .pageSize(50) + .pageToken("aWQ9NzEwMjMzMjMxMDE=") + .completed(true) + .createdFrom("1675742789470") + .createdTo("1675742789470") + .userIdType("open_id") + .build(); + + // 发起请求 + TasksTasklistResp resp = client.task().v2().tasklist().tasks(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/UploadAttachmentSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/UploadAttachmentSample.java new file mode 100644 index 000000000..44618dd6d --- /dev/null +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/taskv2/UploadAttachmentSample.java @@ -0,0 +1,42 @@ +package com.lark.oapi.sample.apiall.taskv2; + +import com.lark.oapi.Client; +import com.lark.oapi.core.utils.Jsons; +import com.lark.oapi.service.task.v2.model.InputAttachment; +import com.lark.oapi.service.task.v2.model.UploadAttachmentReq; +import com.lark.oapi.service.task.v2.model.UploadAttachmentResp; + +import java.io.File; + +// POST /open-apis/task/v2/attachments/upload +public class UploadAttachmentSample { + + public static void main(String arg[]) throws Exception { + // 构建client + Client client = Client.newBuilder("appId", "appSecret").build(); + + // 创建请求对象 + File file = new File("filepath"); + UploadAttachmentReq req = UploadAttachmentReq.newBuilder() + .userIdType("open_id") + .inputAttachment(InputAttachment.newBuilder() + .resourceType("task") + .resourceId("fe96108d-b004-4a47-b2f8-6886e758b3a5") + .file(file) + .build()) + .build(); + + // 发起请求 + UploadAttachmentResp resp = client.task().v2().attachment().upload(req); + + // 处理服务端错误 + if (!resp.success()) { + System.out.println(String.format("code:%s,msg:%s,reqId:%s" + , resp.getCode(), resp.getMsg(), resp.getRequestId())); + return; + } + + // 业务数据处理 + System.out.println(Jsons.DEFAULT.toJson(resp.getData())); + } +} diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/translationv1/DetectTextSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/translationv1/DetectTextSample.java index 763661d2b..61476778e 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/translationv1/DetectTextSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/translationv1/DetectTextSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DetectTextResp resp = client.translation().text().detect(req); + DetectTextResp resp = client.translation().v1().text().detect(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/translationv1/TranslateTextSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/translationv1/TranslateTextSample.java index 340c9c116..213b6f080 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/translationv1/TranslateTextSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/translationv1/TranslateTextSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - TranslateTextResp resp = client.translation().text().translate(req); + TranslateTextResp resp = client.translation().v1().text().translate(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ApplyReserveSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ApplyReserveSample.java index 1cdf65905..add6f3d67 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ApplyReserveSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ApplyReserveSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ApplyReserveResp resp = client.vc().reserve().apply(req); + ApplyReserveResp resp = client.vc().v1().reserve().apply(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/CreateRoomLevelSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/CreateRoomLevelSample.java index e948a52dc..e3de473a0 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/CreateRoomLevelSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/CreateRoomLevelSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateRoomLevelResp resp = client.vc().roomLevel().create(req); + CreateRoomLevelResp resp = client.vc().v1().roomLevel().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/CreateRoomSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/CreateRoomSample.java index 91f0f7ae2..4daee504e 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/CreateRoomSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/CreateRoomSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateRoomResp resp = client.vc().room().create(req); + CreateRoomResp resp = client.vc().v1().room().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/CreateScopeConfigSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/CreateScopeConfigSample.java index b82d25b2f..206dc4d0c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/CreateScopeConfigSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/CreateScopeConfigSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateScopeConfigResp resp = client.vc().scopeConfig().create(req); + CreateScopeConfigResp resp = client.vc().v1().scopeConfig().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DelRoomLevelSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DelRoomLevelSample.java index df0a2ee11..630ac2df2 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DelRoomLevelSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DelRoomLevelSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DelRoomLevelResp resp = client.vc().roomLevel().del(req); + DelRoomLevelResp resp = client.vc().v1().roomLevel().del(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DeleteReserveSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DeleteReserveSample.java index 4b4b90f85..7a9af9223 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DeleteReserveSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DeleteReserveSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteReserveResp resp = client.vc().reserve().delete(req); + DeleteReserveResp resp = client.vc().v1().reserve().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DeleteRoomSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DeleteRoomSample.java index 2da326eba..9ac3ee0f3 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DeleteRoomSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DeleteRoomSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteRoomResp resp = client.vc().room().delete(req); + DeleteRoomResp resp = client.vc().v1().room().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DownloadExportSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DownloadExportSample.java index b9b4973ba..19c7dee0d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DownloadExportSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/DownloadExportSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DownloadExportResp resp = client.vc().export().download(req); + DownloadExportResp resp = client.vc().v1().export().download(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/EndMeetingSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/EndMeetingSample.java index da68345ee..f837a0b75 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/EndMeetingSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/EndMeetingSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - EndMeetingResp resp = client.vc().meeting().end(req); + EndMeetingResp resp = client.vc().v1().meeting().end(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetActiveMeetingReserveSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetActiveMeetingReserveSample.java index e9e1a6bb6..7cd808c20 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetActiveMeetingReserveSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetActiveMeetingReserveSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetActiveMeetingReserveResp resp = client.vc().reserve().getActiveMeeting(req); + GetActiveMeetingReserveResp resp = client.vc().v1().reserve().getActiveMeeting(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetDailyReportSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetDailyReportSample.java index b4808c3df..69ebe2dd9 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetDailyReportSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetDailyReportSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetDailyReportResp resp = client.vc().report().getDaily(req); + GetDailyReportResp resp = client.vc().v1().report().getDaily(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetExportSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetExportSample.java index 8636582b4..57f6ae2bc 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetExportSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetExportSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetExportResp resp = client.vc().export().get(req); + GetExportResp resp = client.vc().v1().export().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetMeetingListSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetMeetingListSample.java index 6fedaaed8..07ca0fed1 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetMeetingListSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetMeetingListSample.java @@ -16,6 +16,7 @@ public static void main(String arg[]) throws Exception { GetMeetingListReq req = GetMeetingListReq.newBuilder() .startTime("1655276858") .endTime("1655276858") + .meetingStatus(2) .meetingNo("123456789") .userId("ou_3ec3f6a28a0d08c45d895276e8e5e19b") .roomId("omm_eada1d61a550955240c28757e7dec3af") @@ -25,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetMeetingListResp resp = client.vc().meetingList().get(req); + GetMeetingListResp resp = client.vc().v1().meetingList().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetMeetingRecordingSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetMeetingRecordingSample.java index 645d526e6..d9bd888b4 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetMeetingRecordingSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetMeetingRecordingSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetMeetingRecordingResp resp = client.vc().meetingRecording().get(req); + GetMeetingRecordingResp resp = client.vc().v1().meetingRecording().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetMeetingSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetMeetingSample.java index 33f8890d1..92b9730f0 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetMeetingSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetMeetingSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetMeetingResp resp = client.vc().meeting().get(req); + GetMeetingResp resp = client.vc().v1().meeting().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetParticipantListSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetParticipantListSample.java index eaa0b9ad8..2214bfc03 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetParticipantListSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetParticipantListSample.java @@ -16,6 +16,7 @@ public static void main(String arg[]) throws Exception { GetParticipantListReq req = GetParticipantListReq.newBuilder() .meetingStartTime("1655276858") .meetingEndTime("1655276858") + .meetingStatus(2) .meetingNo("123456789") .userId("ou_3ec3f6a28a0d08c45d895276e8e5e19b") .roomId("omm_eada1d61a550955240c28757e7dec3af") @@ -25,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetParticipantListResp resp = client.vc().participantList().get(req); + GetParticipantListResp resp = client.vc().v1().participantList().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetParticipantQualityListSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetParticipantQualityListSample.java index 4bed0115f..f20569b9c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetParticipantQualityListSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetParticipantQualityListSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetParticipantQualityListResp resp = client.vc().participantQualityList().get(req); + GetParticipantQualityListResp resp = client.vc().v1().participantQualityList().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveConfigAdminSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveConfigAdminSample.java index ffa611c81..601a9619a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveConfigAdminSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveConfigAdminSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetReserveConfigAdminResp resp = client.vc().reserveConfigAdmin().get(req); + GetReserveConfigAdminResp resp = client.vc().v1().reserveConfigAdmin().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveConfigDisableInformSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveConfigDisableInformSample.java index 1c8d8eca1..8b71c9339 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveConfigDisableInformSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveConfigDisableInformSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetReserveConfigDisableInformResp resp = client.vc().reserveConfigDisableInform().get(req); + GetReserveConfigDisableInformResp resp = client.vc().v1().reserveConfigDisableInform().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveConfigFormSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveConfigFormSample.java index 14c6986c9..6622ac538 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveConfigFormSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveConfigFormSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetReserveConfigFormResp resp = client.vc().reserveConfigForm().get(req); + GetReserveConfigFormResp resp = client.vc().v1().reserveConfigForm().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveSample.java index 4f0a6fece..24393c3dc 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetReserveSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetReserveResp resp = client.vc().reserve().get(req); + GetReserveResp resp = client.vc().v1().reserve().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetResourceReservationListSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetResourceReservationListSample.java index 51b60351a..0c40c043b 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetResourceReservationListSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetResourceReservationListSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetResourceReservationListResp resp = client.vc().resourceReservationList().get(req); + GetResourceReservationListResp resp = client.vc().v1().resourceReservationList().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetRoomLevelSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetRoomLevelSample.java index 51c753539..fde8877dd 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetRoomLevelSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetRoomLevelSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetRoomLevelResp resp = client.vc().roomLevel().get(req); + GetRoomLevelResp resp = client.vc().v1().roomLevel().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetRoomSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetRoomSample.java index 07685dbbb..b92327021 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetRoomSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetRoomSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetRoomResp resp = client.vc().room().get(req); + GetRoomResp resp = client.vc().v1().room().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetScopeConfigSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetScopeConfigSample.java index a8f8e30eb..263117b26 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetScopeConfigSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetScopeConfigSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetScopeConfigResp resp = client.vc().scopeConfig().get(req); + GetScopeConfigResp resp = client.vc().v1().scopeConfig().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetTopUserReportSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetTopUserReportSample.java index 0ddf8e3aa..259cf6983 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetTopUserReportSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/GetTopUserReportSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetTopUserReportResp resp = client.vc().report().getTopUser(req); + GetTopUserReportResp resp = client.vc().v1().report().getTopUser(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/InviteMeetingSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/InviteMeetingSample.java index a60f0e625..00ee5554c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/InviteMeetingSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/InviteMeetingSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - InviteMeetingResp resp = client.vc().meeting().invite(req); + InviteMeetingResp resp = client.vc().v1().meeting().invite(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/KickoutMeetingSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/KickoutMeetingSample.java index 281a046e1..ba7645ca7 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/KickoutMeetingSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/KickoutMeetingSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - KickoutMeetingResp resp = client.vc().meeting().kickout(req); + KickoutMeetingResp resp = client.vc().v1().meeting().kickout(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListAlertSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListAlertSample.java index 02753d8d3..02fc031dc 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListAlertSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListAlertSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListAlertResp resp = client.vc().alert().list(req); + ListAlertResp resp = client.vc().v1().alert().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListByNoMeetingSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListByNoMeetingSample.java index 1e68c6763..a9fbb403c 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListByNoMeetingSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListByNoMeetingSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListByNoMeetingResp resp = client.vc().meeting().listByNo(req); + ListByNoMeetingResp resp = client.vc().v1().meeting().listByNo(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListRoomLevelSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListRoomLevelSample.java index 10b5f9392..806281828 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListRoomLevelSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListRoomLevelSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListRoomLevelResp resp = client.vc().roomLevel().list(req); + ListRoomLevelResp resp = client.vc().v1().roomLevel().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListRoomSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListRoomSample.java index 5fe8dfa82..da5d84e87 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListRoomSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ListRoomSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListRoomResp resp = client.vc().room().list(req); + ListRoomResp resp = client.vc().v1().room().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/MeetingListExportSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/MeetingListExportSample.java index 9890e0e5e..402c1ef1a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/MeetingListExportSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/MeetingListExportSample.java @@ -19,6 +19,7 @@ public static void main(String arg[]) throws Exception { .meetingListExportReqBody(MeetingListExportReqBody.newBuilder() .startTime("1655276858") .endTime("1655276858") + .meetingStatus(2) .meetingNo("123456789") .userId("ou_3ec3f6a28a0d08c45d895276e8e5e19b") .roomId("omm_eada1d61a550955240c28757e7dec3af") @@ -26,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - MeetingListExportResp resp = client.vc().export().meetingList(req); + MeetingListExportResp resp = client.vc().v1().export().meetingList(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/MgetRoomLevelSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/MgetRoomLevelSample.java index b4e967fa7..aae369f03 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/MgetRoomLevelSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/MgetRoomLevelSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - MgetRoomLevelResp resp = client.vc().roomLevel().mget(req); + MgetRoomLevelResp resp = client.vc().v1().roomLevel().mget(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/MgetRoomSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/MgetRoomSample.java index da7acaab6..f558948eb 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/MgetRoomSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/MgetRoomSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - MgetRoomResp resp = client.vc().room().mget(req); + MgetRoomResp resp = client.vc().v1().room().mget(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ParticipantListExportSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ParticipantListExportSample.java index d0d0bad03..951682025 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ParticipantListExportSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ParticipantListExportSample.java @@ -19,6 +19,7 @@ public static void main(String arg[]) throws Exception { .participantListExportReqBody(ParticipantListExportReqBody.newBuilder() .meetingStartTime("1655276858") .meetingEndTime("1655276858") + .meetingStatus(2) .meetingNo("123456789") .userId("ou_3ec3f6a28a0d08c45d895276e8e5e19b") .roomId("omm_eada1d61a550955240c28757e7dec3af") @@ -26,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ParticipantListExportResp resp = client.vc().export().participantList(req); + ParticipantListExportResp resp = client.vc().v1().export().participantList(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ParticipantQualityListExportSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ParticipantQualityListExportSample.java index f76612249..120ec31b7 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ParticipantQualityListExportSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ParticipantQualityListExportSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ParticipantQualityListExportResp resp = client.vc().export().participantQualityList(req); + ParticipantQualityListExportResp resp = client.vc().v1().export().participantQualityList(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigAdminSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigAdminSample.java index 57f4a1e41..ba29c7f66 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigAdminSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigAdminSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchReserveConfigAdminResp resp = client.vc().reserveConfigAdmin().patch(req); + PatchReserveConfigAdminResp resp = client.vc().v1().reserveConfigAdmin().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigDisableInformSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigDisableInformSample.java index f322ebce4..fb330fa25 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigDisableInformSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigDisableInformSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchReserveConfigDisableInformResp resp = client.vc().reserveConfigDisableInform().patch(req); + PatchReserveConfigDisableInformResp resp = client.vc().v1().reserveConfigDisableInform().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigFormSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigFormSample.java index 7ec24c534..c31a9a4a0 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigFormSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigFormSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchReserveConfigFormResp resp = client.vc().reserveConfigForm().patch(req); + PatchReserveConfigFormResp resp = client.vc().v1().reserveConfigForm().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigSample.java index 344b9514a..da03d26b5 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchReserveConfigSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchReserveConfigResp resp = client.vc().reserveConfig().patch(req); + PatchReserveConfigResp resp = client.vc().v1().reserveConfig().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchRoomLevelSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchRoomLevelSample.java index 473864f3c..b904f2179 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchRoomLevelSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchRoomLevelSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchRoomLevelResp resp = client.vc().roomLevel().patch(req); + PatchRoomLevelResp resp = client.vc().v1().roomLevel().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchRoomSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchRoomSample.java index a5f4562d7..e84713fe4 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchRoomSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/PatchRoomSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - PatchRoomResp resp = client.vc().room().patch(req); + PatchRoomResp resp = client.vc().v1().room().patch(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/QueryRoomConfigSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/QueryRoomConfigSample.java index d856d2116..5510587d7 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/QueryRoomConfigSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/QueryRoomConfigSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - QueryRoomConfigResp resp = client.vc().roomConfig().query(req); + QueryRoomConfigResp resp = client.vc().v1().roomConfig().query(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ReserveScopeReserveConfigSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ReserveScopeReserveConfigSample.java index 9a8688509..b0a743433 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ReserveScopeReserveConfigSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ReserveScopeReserveConfigSample.java @@ -20,7 +20,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ReserveScopeReserveConfigResp resp = client.vc().reserveConfig().reserveScope(req); + ReserveScopeReserveConfigResp resp = client.vc().v1().reserveConfig().reserveScope(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ResourceReservationListExportSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ResourceReservationListExportSample.java index 3b6629690..8a6ae8adb 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ResourceReservationListExportSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/ResourceReservationListExportSample.java @@ -26,7 +26,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ResourceReservationListExportResp resp = client.vc().export().resourceReservationList(req); + ResourceReservationListExportResp resp = client.vc().v1().export().resourceReservationList(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SearchRoomLevelSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SearchRoomLevelSample.java index 5885c4b5c..5172609ab 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SearchRoomLevelSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SearchRoomLevelSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SearchRoomLevelResp resp = client.vc().roomLevel().search(req); + SearchRoomLevelResp resp = client.vc().v1().roomLevel().search(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SearchRoomSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SearchRoomSample.java index 5d58fdd06..9511da382 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SearchRoomSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SearchRoomSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SearchRoomResp resp = client.vc().room().search(req); + SearchRoomResp resp = client.vc().v1().room().search(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetCheckboardAccessCodeRoomConfigSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetCheckboardAccessCodeRoomConfigSample.java index 0c40d4eb5..e6c268a94 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetCheckboardAccessCodeRoomConfigSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetCheckboardAccessCodeRoomConfigSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SetCheckboardAccessCodeRoomConfigResp resp = client.vc().roomConfig().setCheckboardAccessCode(req); + SetCheckboardAccessCodeRoomConfigResp resp = client.vc().v1().roomConfig().setCheckboardAccessCode(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetHostMeetingSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetHostMeetingSample.java index 4e0247295..b5edf2531 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetHostMeetingSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetHostMeetingSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SetHostMeetingResp resp = client.vc().meeting().setHost(req); + SetHostMeetingResp resp = client.vc().v1().meeting().setHost(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetPermissionMeetingRecordingSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetPermissionMeetingRecordingSample.java index 1e499cf2e..1318ad4fe 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetPermissionMeetingRecordingSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetPermissionMeetingRecordingSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SetPermissionMeetingRecordingResp resp = client.vc().meetingRecording().setPermission(req); + SetPermissionMeetingRecordingResp resp = client.vc().v1().meetingRecording().setPermission(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetRoomAccessCodeRoomConfigSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetRoomAccessCodeRoomConfigSample.java index d04fde44f..3b464067f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetRoomAccessCodeRoomConfigSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetRoomAccessCodeRoomConfigSample.java @@ -27,7 +27,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SetRoomAccessCodeRoomConfigResp resp = client.vc().roomConfig().setRoomAccessCode(req); + SetRoomAccessCodeRoomConfigResp resp = client.vc().v1().roomConfig().setRoomAccessCode(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetRoomConfigSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetRoomConfigSample.java index 5e3671f61..90bc9dada 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetRoomConfigSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/SetRoomConfigSample.java @@ -29,7 +29,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SetRoomConfigResp resp = client.vc().roomConfig().set(req); + SetRoomConfigResp resp = client.vc().v1().roomConfig().set(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/StartMeetingRecordingSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/StartMeetingRecordingSample.java index d43d24a9c..d9fad9004 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/StartMeetingRecordingSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/StartMeetingRecordingSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - StartMeetingRecordingResp resp = client.vc().meetingRecording().start(req); + StartMeetingRecordingResp resp = client.vc().v1().meetingRecording().start(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/StopMeetingRecordingSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/StopMeetingRecordingSample.java index bd1ea4e3a..628dee2e3 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/StopMeetingRecordingSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/StopMeetingRecordingSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - StopMeetingRecordingResp resp = client.vc().meetingRecording().stop(req); + StopMeetingRecordingResp resp = client.vc().v1().meetingRecording().stop(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/UpdateReserveSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/UpdateReserveSample.java index e8af696ee..0f586c64a 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/UpdateReserveSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/vcv1/UpdateReserveSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateReserveResp resp = client.vc().reserve().update(req); + UpdateReserveResp resp = client.vc().v1().reserve().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CopySpaceNodeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CopySpaceNodeSample.java index ab68b50eb..70e2e7e61 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CopySpaceNodeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CopySpaceNodeSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CopySpaceNodeResp resp = client.wiki().spaceNode().copy(req); + CopySpaceNodeResp resp = client.wiki().v2().spaceNode().copy(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CreateSpaceMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CreateSpaceMemberSample.java index 9e487d94b..87693536d 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CreateSpaceMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CreateSpaceMemberSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateSpaceMemberResp resp = client.wiki().spaceMember().create(req); + CreateSpaceMemberResp resp = client.wiki().v2().spaceMember().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CreateSpaceNodeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CreateSpaceNodeSample.java index cd2fe851f..5c5e3b91e 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CreateSpaceNodeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CreateSpaceNodeSample.java @@ -18,15 +18,15 @@ public static void main(String arg[]) throws Exception { .spaceId("6704147935988285963") .node(Node.newBuilder() .objType("doc") - .parentNodeToken("") + .parentNodeToken("wikcnKQ1k3p******8Vabcef") .nodeType("origin") - .originNodeToken("") - .title("") + .originNodeToken("wikcnKQ1k3p******8Vabcef") + .title("xxxx") .build()) .build(); // 发起请求 - CreateSpaceNodeResp resp = client.wiki().spaceNode().create(req); + CreateSpaceNodeResp resp = client.wiki().v2().spaceNode().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CreateSpaceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CreateSpaceSample.java index d51ec0a81..c51fa5b32 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CreateSpaceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/CreateSpaceSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - CreateSpaceResp resp = client.wiki().space().create(req); + CreateSpaceResp resp = client.wiki().v2().space().create(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/DeleteSpaceMemberSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/DeleteSpaceMemberSample.java index 2b3ce9fa5..6aece2f7f 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/DeleteSpaceMemberSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/DeleteSpaceMemberSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - DeleteSpaceMemberResp resp = client.wiki().spaceMember().delete(req); + DeleteSpaceMemberResp resp = client.wiki().v2().spaceMember().delete(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/GetNodeSpaceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/GetNodeSpaceSample.java index 0a4d2958d..c732cc5e8 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/GetNodeSpaceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/GetNodeSpaceSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetNodeSpaceResp resp = client.wiki().space().getNode(req); + GetNodeSpaceResp resp = client.wiki().v2().space().getNode(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/GetSpaceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/GetSpaceSample.java index b7778833d..07c079e26 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/GetSpaceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/GetSpaceSample.java @@ -18,7 +18,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetSpaceResp resp = client.wiki().space().get(req); + GetSpaceResp resp = client.wiki().v2().space().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/GetTaskSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/GetTaskSample.java index 38ff37bdf..cf90e55b2 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/GetTaskSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/GetTaskSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - GetTaskResp resp = client.wiki().task().get(req); + GetTaskResp resp = client.wiki().v2().task().get(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/ListSpaceNodeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/ListSpaceNodeSample.java index 1db0c3a7b..6cb7570e8 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/ListSpaceNodeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/ListSpaceNodeSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListSpaceNodeResp resp = client.wiki().spaceNode().list(req); + ListSpaceNodeResp resp = client.wiki().v2().spaceNode().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/ListSpaceSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/ListSpaceSample.java index 7b1e55451..44d9c18cb 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/ListSpaceSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/ListSpaceSample.java @@ -19,7 +19,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - ListSpaceResp resp = client.wiki().space().list(req); + ListSpaceResp resp = client.wiki().v2().space().list(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/MoveDocsToWikiSpaceNodeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/MoveDocsToWikiSpaceNodeSample.java index 5892e878d..17849f800 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/MoveDocsToWikiSpaceNodeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/MoveDocsToWikiSpaceNodeSample.java @@ -25,7 +25,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - MoveDocsToWikiSpaceNodeResp resp = client.wiki().spaceNode().moveDocsToWiki(req); + MoveDocsToWikiSpaceNodeResp resp = client.wiki().v2().spaceNode().moveDocsToWiki(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/MoveSpaceNodeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/MoveSpaceNodeSample.java index e599c2107..64ad4c7b1 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/MoveSpaceNodeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/MoveSpaceNodeSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - MoveSpaceNodeResp resp = client.wiki().spaceNode().move(req); + MoveSpaceNodeResp resp = client.wiki().v2().spaceNode().move(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/UpdateSpaceSettingSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/UpdateSpaceSettingSample.java index afe22ec83..ae2876997 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/UpdateSpaceSettingSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/UpdateSpaceSettingSample.java @@ -24,7 +24,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateSpaceSettingResp resp = client.wiki().spaceSetting().update(req); + UpdateSpaceSettingResp resp = client.wiki().v2().spaceSetting().update(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/UpdateTitleSpaceNodeSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/UpdateTitleSpaceNodeSample.java index 0de59c8c5..9d3863c56 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/UpdateTitleSpaceNodeSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/wikiv2/UpdateTitleSpaceNodeSample.java @@ -23,7 +23,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - UpdateTitleSpaceNodeResp resp = client.wiki().spaceNode().updateTitle(req); + UpdateTitleSpaceNodeResp resp = client.wiki().v2().spaceNode().updateTitle(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/workplacev1/SearchCustomWorkplaceAccessDataSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/workplacev1/SearchCustomWorkplaceAccessDataSample.java index dde059e79..8d50319d3 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/workplacev1/SearchCustomWorkplaceAccessDataSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/workplacev1/SearchCustomWorkplaceAccessDataSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SearchCustomWorkplaceAccessDataResp resp = client.workplace().customWorkplaceAccessData().search(req); + SearchCustomWorkplaceAccessDataResp resp = client.workplace().v1().customWorkplaceAccessData().search(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/workplacev1/SearchWorkplaceAccessDataSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/workplacev1/SearchWorkplaceAccessDataSample.java index 7c459eda8..c2b11c2c3 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/workplacev1/SearchWorkplaceAccessDataSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/workplacev1/SearchWorkplaceAccessDataSample.java @@ -21,7 +21,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SearchWorkplaceAccessDataResp resp = client.workplace().workplaceAccessData().search(req); + SearchWorkplaceAccessDataResp resp = client.workplace().v1().workplaceAccessData().search(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/apiall/workplacev1/SearchWorkplaceBlockAccessDataSample.java b/sample/src/main/java/com/lark/oapi/sample/apiall/workplacev1/SearchWorkplaceBlockAccessDataSample.java index 81cd048ce..a3caa37ee 100644 --- a/sample/src/main/java/com/lark/oapi/sample/apiall/workplacev1/SearchWorkplaceBlockAccessDataSample.java +++ b/sample/src/main/java/com/lark/oapi/sample/apiall/workplacev1/SearchWorkplaceBlockAccessDataSample.java @@ -22,7 +22,7 @@ public static void main(String arg[]) throws Exception { .build(); // 发起请求 - SearchWorkplaceBlockAccessDataResp resp = client.workplace().workplaceBlockAccessData().search(req); + SearchWorkplaceBlockAccessDataResp resp = client.workplace().v1().workplaceBlockAccessData().search(req); // 处理服务端错误 if (!resp.success()) { diff --git a/sample/src/main/java/com/lark/oapi/sample/event/EventController.java b/sample/src/main/java/com/lark/oapi/sample/event/EventController.java index 86354ddd9..cc81bfa30 100644 --- a/sample/src/main/java/com/lark/oapi/sample/event/EventController.java +++ b/sample/src/main/java/com/lark/oapi/sample/event/EventController.java @@ -15,21 +15,21 @@ import com.lark.oapi.core.utils.Jsons; import com.lark.oapi.event.EventDispatcher; import com.lark.oapi.sdk.servlet.ext.ServletAdapter; -import com.lark.oapi.service.application.v6.ApplicationService.P1AppOpenV6Handler; -import com.lark.oapi.service.application.v6.ApplicationService.P1AppStatusChangedV6Handler; -import com.lark.oapi.service.application.v6.ApplicationService.P1AppUninstalledV6Handler; -import com.lark.oapi.service.application.v6.ApplicationService.P1OrderPaidV6Handler; +import com.lark.oapi.service.application.ApplicationService.P1AppOpenV6Handler; +import com.lark.oapi.service.application.ApplicationService.P1AppStatusChangedV6Handler; +import com.lark.oapi.service.application.ApplicationService.P1AppUninstalledV6Handler; +import com.lark.oapi.service.application.ApplicationService.P1OrderPaidV6Handler; import com.lark.oapi.service.application.v6.model.P1AppOpenV6; import com.lark.oapi.service.application.v6.model.P1AppStatusChangedV6; import com.lark.oapi.service.application.v6.model.P1AppUninstalledV6; import com.lark.oapi.service.application.v6.model.P1OrderPaidV6; -import com.lark.oapi.service.approval.v4.ApprovalService.*; +import com.lark.oapi.service.approval.ApprovalService.*; import com.lark.oapi.service.approval.v4.model.*; -import com.lark.oapi.service.contact.v3.ContactService.*; +import com.lark.oapi.service.contact.ContactService.*; import com.lark.oapi.service.contact.v3.model.*; -import com.lark.oapi.service.im.v1.ImService.*; +import com.lark.oapi.service.im.ImService.*; import com.lark.oapi.service.im.v1.model.*; -import com.lark.oapi.service.meeting_room.v1.MeetingRoomService.P1ThirdPartyMeetingRoomChangedV1Handler; +import com.lark.oapi.service.meeting_room.MeetingRoomService.P1ThirdPartyMeetingRoomChangedV1Handler; import com.lark.oapi.service.meeting_room.v1.model.P1ThirdPartyMeetingRoomChangedV1; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping;